Re: [PATCH RFC] PCI: Add warning about possible danger for pcie_bus_perf mode
From: Feng Tang
Date: Thu Nov 26 2026 - 06:03:48 EST
Hi Niklas,
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.
Right, only the 'pcie_bus_perf' mode can reproducde this issue. The
default mode works just fine.
We reproucded it on one arm64 server and one Intel server, the MPS for
the NVME device and root port are both set to 256 bytes in default mode
(no pcie_bus_perf parameter).
> 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?
I can give it a try after the quirk work suggested by Christoph Hellwig.
I haven't read through you patch, one question is, since current kernel
already works fine without 'pci=pcie_bus_perf', what' the intention of
this test?
Thanks,
Feng
> [1] https://lore.kernel.org/linux-pci/20261020122854.1500883-5-cassel@xxxxxxxxxx/
>
> Kind regards,
> Niklas