linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/7] PCI: VF resizable BAR
@ 2024-10-25 21:50 Michał Winiarski
  2024-10-25 21:50 ` [PATCH v4 1/7] PCI/IOV: Restore VF resizable BAR state after reset Michał Winiarski
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Michał Winiarski @ 2024-10-25 21:50 UTC (permalink / raw)
  To: linux-pci, intel-xe, dri-devel, linux-kernel, Bjorn Helgaas,
	Christian König, Krzysztof Wilczyński,
	Ilpo Järvinen
  Cc: Rodrigo Vivi, Michal Wajdeczko, Lucas De Marchi,
	Thomas Hellström, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Matt Roper,
	Michał Winiarski

Hi,

In v4, the approach to extending the BAR was changed to follow the
suggestion from Christian.
The control is now entirely on the driver side, with PCI subsystem
checking whether the resource fits during VF enabling.
I also added helpers to move between IOV / BAR # (suggested by Ilpo),
since the ifdefs started to look mighty ugly after addressing some of
the review feedback.

v3 can be found here:
https://lore.kernel.org/dri-devel/20241010103203.382898-1-michal.winiarski@intel.com/

For regular BAR, drivers can use pci_resize_resource to resize it to the
desired size provided that it is supported by the hardware, which the
driver can query using pci_rebar_get_possible_sizes.
This series expands the API to work with IOV BAR as well.
It also adds the additional API for drivers to change the VF BAR size
without resizing the entire underlying reservation (within the original
resource boundary).

Thanks,
-Michał

v1 -> v2:
- Add pci_iov_resource_extend() and usage in Xe driver
- Reduce the number of ifdefs (Christian)
- Drop patch 2/2 from v1 (Christian)
- Add a helper to avoid upsetting static analysis tools (Krzysztof)

v2 -> v3:
- Extract introducing pci_resource_is_iov to separate commit and
  use it elsewhere in PCI subsystem (Christian)
- Extract restoring VF rebar state to separate commit (Christian)
- Reorganize memory decoding check (Christian)
- Don't use dev_WARN (Ilpo)
- Fix build without CONFIG_PCI_IOV (CI)

v3 -> v4:
- Change the approach to extending the BAR (Christian)
- Tidy the commit messages, use 80 line limit where necessary (Bjorn)
- Add kerneldocs to exported functions (Bjorn)
- Add pci_resource_to_iov() / pci_resource_from_iov() helpers (Ilpo)
- Use FIELD_GET(), tidy whitespace (Ilpo)

Michał Winiarski (7):
  PCI/IOV: Restore VF resizable BAR state after reset
  PCI: Add a helper to identify IOV resources
  PCI: Add a helper to convert between standard and IOV resources
  PCI: Allow IOV resources to be resized in pci_resize_resource()
  PCI/IOV: Check that VF BAR fits within the reservation
  PCI: Allow drivers to control VF BAR size
  drm/xe/pf: Set VF LMEM BAR size

 drivers/gpu/drm/xe/regs/xe_bars.h |   1 +
 drivers/gpu/drm/xe/xe_pci_sriov.c |  22 +++++
 drivers/pci/iov.c                 | 158 +++++++++++++++++++++++++++---
 drivers/pci/pci.c                 |  10 +-
 drivers/pci/pci.h                 |  45 ++++++++-
 drivers/pci/setup-bus.c           |   9 +-
 drivers/pci/setup-res.c           |  40 ++++++--
 include/linux/pci.h               |   6 ++
 include/uapi/linux/pci_regs.h     |   1 +
 9 files changed, 261 insertions(+), 31 deletions(-)

-- 
2.47.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2024-11-12 14:56 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-25 21:50 [PATCH v4 0/7] PCI: VF resizable BAR Michał Winiarski
2024-10-25 21:50 ` [PATCH v4 1/7] PCI/IOV: Restore VF resizable BAR state after reset Michał Winiarski
2024-10-29 13:01   ` Christian König
2024-10-25 21:50 ` [PATCH v4 2/7] PCI: Add a helper to identify IOV resources Michał Winiarski
2024-10-29 13:18   ` Christian König
2024-10-25 21:50 ` [PATCH v4 3/7] PCI: Add a helper to convert between standard and " Michał Winiarski
2024-10-29 13:20   ` Christian König
2024-11-06 14:22   ` Ilpo Järvinen
2024-11-12 14:40     ` Michał Winiarski
2024-10-25 21:50 ` [PATCH v4 4/7] PCI: Allow IOV resources to be resized in pci_resize_resource() Michał Winiarski
2024-10-25 21:50 ` [PATCH v4 5/7] PCI/IOV: Check that VF BAR fits within the reservation Michał Winiarski
2024-10-28 11:20   ` Michał Winiarski
2024-10-28 16:56   ` Bjorn Helgaas
2024-10-30 11:43     ` Michał Winiarski
2024-10-30 16:55       ` Bjorn Helgaas
2024-11-12 14:31         ` Michał Winiarski
2024-10-25 21:50 ` [PATCH v4 6/7] PCI: Allow drivers to control VF BAR size Michał Winiarski
2024-10-28 16:50   ` Bjorn Helgaas
2024-11-12 14:55     ` Michał Winiarski
2024-10-25 21:50 ` [PATCH v4 7/7] drm/xe/pf: Set VF LMEM " Michał Winiarski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).