]> git.ipfire.org Git - thirdparty/linux.git/commit
PCI/IOV: Allow drivers to control VF BAR size
authorMichał Winiarski <michal.winiarski@intel.com>
Wed, 2 Jul 2025 09:35:22 +0000 (11:35 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 14 Jul 2025 20:04:23 +0000 (15:04 -0500)
commit84f890414a12b8d1480045b92a5e4e6ac4ab3419
treedbfc2d8f06b4c37c8e1c4ed002f89ab7c1b6a793
parente1ba95a168e6f771960c0afc4e44984cf5cf659c
PCI/IOV: Allow drivers to control VF BAR size

Drivers could leverage the fact that the VF BAR MMIO reservation is created
for total number of VFs supported by the device by resizing the BAR to
larger size when smaller number of VFs is enabled.

Add pci_iov_vf_bar_set_size() to control the size and a
pci_iov_vf_bar_get_sizes() helper to get the VF BAR sizes that will allow
up to num_vfs to be successfully enabled with the current underlying
reservation size.

Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://patch.msgid.link/20250702093522.518099-6-michal.winiarski@intel.com
drivers/pci/iov.c
include/linux/pci.h