Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/1][v2] PCI: VF resizable BAR
@ 2024-05-23  7:11 Lianjie Shi
  2024-05-23  7:11 ` [PATCH 1/1][v2] PCI: Support " Lianjie Shi
  0 siblings, 1 reply; 7+ messages in thread
From: Lianjie Shi @ 2024-05-23  7:11 UTC (permalink / raw)
  To: linux-pci, linux-kernel, Bjorn Helgaas
  Cc: HaiJun Chang, Jerry Jiang, Andy Zhang, Lianjie Shi

Similar to regular BAR, drivers can use pci_resize_resource() to resize
an IOV BAR to the desired size provided that is supported by the
hardware, which can be queried using pci_rebar_get_possible_sizes().

This feature is based on the fact that (default VF BAR size) * (supported
VF number) covers all possible resource/address ranges (rounded up to the
power of 2 size). For example, the total size of the resource behind the
BAR is 256GB, the supported maximum VF number is 4, the default VF BAR
size should then be set to 64GB. When the enabled vf_num changes, the VF
BAR size will adjust accordingly as
- For 1 VF, VF BAR size is 256GB
- For 2 VFs, VF BAR size is 128GB
- For 4 VFs, VF BAR size is 64GB

This feature is necessary to accommodate the limited address per PCI port.

Lianjie Shi (1):
  PCI: Support VF resizable BAR

 drivers/pci/pci.c             | 47 ++++++++++++++++++++++++++++++++++-
 drivers/pci/setup-res.c       | 45 +++++++++++++++++++++++++++------
 include/uapi/linux/pci_regs.h |  1 +
 3 files changed, 85 insertions(+), 8 deletions(-)


base-commit: cf87f46fd34d6c19283d9625a7822f20d90b64a4
-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH 0/1][v2] PCI: VF resizable BAR
@ 2024-06-12  8:42 Lianjie Shi
  2024-06-12  8:42 ` [PATCH 1/1][v2] PCI: Support " Lianjie Shi
  0 siblings, 1 reply; 7+ messages in thread
From: Lianjie Shi @ 2024-06-12  8:42 UTC (permalink / raw)
  To: christian.koenig
  Cc: linux-pci, linux-kernel, bhelgaas, HaiJun.Chang, Jerry.Jiang,
	Andy.Zhang, emily.deng, Lianjie Shi

Similar to regular BAR, drivers can use pci_resize_resource() to resize
an IOV BAR to the desired size provided that is supported by the
hardware, which can be queried using pci_rebar_get_possible_sizes().

This feature is based on the fact that (default VF BAR size) * (supported
VF number) covers all possible resource/address ranges (rounded up to the
power of 2 size). For example, the total size of the resource behind the
BAR is 256GB, the supported maximum VF number is 4, the default VF BAR
size should then be set to 64GB. When the enabled vf_num changes, the VF
BAR size will adjust accordingly as
- For 1 VF, VF BAR size is 256GB
- For 2 VFs, VF BAR size is 128GB
- For 4 VFs, VF BAR size is 64GB

This feature is necessary to accommodate the limited address per PCI port.

Lianjie Shi (1):
  PCI: Support VF resizable BAR

 drivers/pci/pci.c             | 47 ++++++++++++++++++++++++++++++++++-
 drivers/pci/setup-res.c       | 45 +++++++++++++++++++++++++++------
 include/uapi/linux/pci_regs.h |  1 +
 3 files changed, 85 insertions(+), 8 deletions(-)


base-commit: cf87f46fd34d6c19283d9625a7822f20d90b64a4
-- 
2.34.1


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

end of thread, other threads:[~2024-06-12  8:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-23  7:11 [PATCH 0/1][v2] PCI: VF resizable BAR Lianjie Shi
2024-05-23  7:11 ` [PATCH 1/1][v2] PCI: Support " Lianjie Shi
2024-05-31  4:26   ` Chang, HaiJun
2024-06-07  8:42     ` Chang, HaiJun
2024-06-07 11:37       ` Christian König
2024-06-07 20:40         ` Bjorn Helgaas
  -- strict thread matches above, loose matches on Subject: below --
2024-06-12  8:42 [PATCH 0/1][v2] PCI: " Lianjie Shi
2024-06-12  8:42 ` [PATCH 1/1][v2] PCI: Support " Lianjie Shi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox