Re: [PATCH RFC] PCI: Add warning about possible danger for pcie_bus_perf mode
From: Feng Tang
Date: Tue Dec 01 2026 - 09:17:11 EST
On Thu, Nov 26, 2026 at 09:39:44AM +0100, Niklas Cassel wrote:
> On Wed, Nov 25, 2026 at 11:58:29PM +0800, Feng Tang wrote:
> > During stability test, there was a bug that running 'mount' on a type
> > of commercial NVME disk failed on an arm64 server and raised PCIe RAS
> > error and panic the kernel later, when using "pci=pcie_bus_perf" kernel
> > cmdline parameter.
> >
> > The NVME device has MPS(Max Payload Size) capability of 256 bytes while
> > its corresponding root port is capable of 512 bytes. When enabling
> > PCIE_BUS_PERFORMANCE mode, its MPS and MRRS(Max Read Request Size) are
> > both set to 256, while the root port's are both set to 512. But the
> > NVME device doesn't comply with PCIe spec (v6.3), Section 7.5.3.4:
>
> I assume that you are using pcie_bus_perf rather than the default strategy,
> because with the default strategy never raises the Root Port above what
> firmware programmed, which may be only 128 bytes.
>
> pcie_bus_perf gives a Root Port its own maximum MPS without looking at
> the devices below it, and relies on MRRS to keep Completions within the
> endpoint's MPS, so a device that ignores its MRRS gets Completions
> larger than its MPS.
>
> My series [1] avoids this without pcie_bus_perf: with the default strategy,
> it sets each Root Port hierarchy to the largest MPS that all of its devices
> support, i.e. 256 bytes for both your Root Port and the NVMe. Since a
> Function must not generate TLPs larger than its own Max_Payload_Size, the
> Root Port then returns Completions of at most 256 bytes, even for the
> 512-byte reads your NVMe issues. The NVMe also gets the same 256-byte
> payloads as with pcie_bus_perf, so nothing is lost by dropping it: the Root
> Port's 512 bytes don't help a link whose only device supports 256.
>
> Would you be able to test the series on that server, without
> pci=pcie_bus_perf?
>
> [1] https://lore.kernel.org/linux-pci/20261020122854.1500883-5-cassel@xxxxxxxxxx/
Hi Niklas,
I tested your series with this NVMe device, it worked fine without
'pci=pcie_bus_perf', and also triggered the "Malformed TLP" error
with the parameter, same as the mainline kernel.
You asked about why we use 'pcie_bus_perf'. Our test engineers run
stress test for PCI subsystems, with many kinds of PCIe devices (NVMe,
NICs), and many PCI configurations, like 'pci=nomsi',
'pci=pcie_bus_perf', etc. That's how they found the issue.
Thanks,
Feng