[PATCH] nvmet: pci-epf: Always configure BAR0 as 64-bit

Damien Le Moal dlemoal at kernel.org
Fri Mar 14 04:06:12 PDT 2025


On 3/14/25 18:58, Niklas Cassel wrote:
> NVMe PCIe Transport Specification 1.1, section 2.1.10, claims that the
> BAR0 type is Implementation Specific.
> 
> However, in NVMe 1.1, the type is required to be 64-bit.
> 
> Thus, to make our PCI EPF work on as many host systems as possible,
> always configure the BAR0 type to be 64-bit.
> 
> In the rare case that the underlying PCI EPC does not support configuring
> BAR0 as 64-bit, the call to pci_epc_set_bar() will fail, and we will
> return a failure back to the user.
> 
> This should not be a problem, as most PCI EPCs support configuring a BAR
> as 64-bit (and those EPCs with .only_64bit set to true in epc_features
> only support configuring the BAR as 64-bit).
> 
> Signed-off-by: Niklas Cassel <cassel at kernel.org>

Tested-by: Damien Le Moal <dlemoal at kernel.org>

(please add the fixes tag I suggested)

-- 
Damien Le Moal
Western Digital Research



More information about the Linux-nvme mailing list