linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND v5 0/4]  PCI: Rework pci_scan_slot() and isolated PCI functions
@ 2022-06-02 10:30 Niklas Schnelle
  2022-06-02 10:30 ` [PATCH RESEND v5 1/4] PCI: Clean up pci_scan_slot() Niklas Schnelle
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Niklas Schnelle @ 2022-06-02 10:30 UTC (permalink / raw)
  To: Bjorn Helgaas, Jan Kiszka, Matthew Rosato, Pierre Morel
  Cc: linux-s390, linux-pci, linux-kernel

Hi Bjorn, Hi Jan,

In an earlier version[0], I sought to apply the existing jailhouse special case
for isolated PCI functions to s390. As Bjorn noted in[1] there appears to be
some potential for cleaning things up and removing duplication though.

This series attempts to do this cleanup (Patches 1 and 2) followed by enabling
isolated PCI functions for s390 (Patches 3 and 4). If need be I can of course
split the cleanup off but for now I kept it as one as that's what I have
been testing.

Testing:
- On s390 with SR-IOV and a ConnectX NIC with PF 1 but not PF 0 passed throug
  i.e. the isolated function case. Also of course with just VFs and an NVMe.
- On x86_64 on a desktop system where ARI is disabled and with an SR-IOV NIC
  with non-contiguous VFs as well as the usual other PCI devices.

Thanks,
Niklas

Changes v4 -> v5:
- Remove unintended whitespace change in patch 1
Changes v3 -> v4:
- Use a do {} while loop in pci_scan_slot() as it is simpler (Bjorn)
- Explicitly check "fn == 0" as it is not a pointer or bool (Bjorn)
- Keep the "!dev" check in the ARI branch of next_fn() (Bjorn)
- Moved the "fn == 0 && !dev" condition out of next_fn() into pci_scan_slot().
  This allows us to keep the "!dev" case in the ARI branch and means there are
  no new conditions in next_fn() making it easier to verify that its behavior
  is equivalent to the existing code.
- Guard the assignment of dev->multifunction with "fn > 0"
  instead of "nr > 0". This matches the existing logic more closely and works
  for the jailhouse case which unconditionally sets dev->multifunction for
  "fn > 0". This also means fn == 0 is the single "first iteration" test.
- Remove some unneeded whitespace in patch 2

Changes v2 -> v3:
- Removed now unused nr_devs variable (kernel test robot)

Niklas Schnelle (4):
  PCI: Clean up pci_scan_slot()
  PCI: Move jailhouse's isolated function handling to pci_scan_slot()
  PCI: Extend isolated function probing to s390
  s390/pci: allow zPCI zbus without a function zero

 arch/s390/pci/pci_bus.c    | 82 ++++++++++----------------------------
 drivers/pci/probe.c        | 64 +++++++++++++----------------
 include/linux/hypervisor.h |  8 ++++
 3 files changed, 55 insertions(+), 99 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH RESEND v5 0/4]  PCI: Rework pci_scan_slot() and isolated PCI functions
@ 2022-05-05  8:38 Niklas Schnelle
  2022-05-05  8:38 ` [PATCH RESEND v5 2/4] PCI: Move jailhouse's isolated function handling to pci_scan_slot() Niklas Schnelle
  0 siblings, 1 reply; 7+ messages in thread
From: Niklas Schnelle @ 2022-05-05  8:38 UTC (permalink / raw)
  To: Bjorn Helgaas, Jan Kiszka, Matthew Rosato, Pierre Morel
  Cc: linux-kernel, virtualization, linux-s390, linux-pci

Hi Bjorn, Hi Jan,

In an earlier version[0], I sought to apply the existing jailhouse special case
for isolated PCI functions to s390. As Bjorn noted in[1] there appears to be
some potential for cleaning things up and removing duplication though.

This series attempts to do this cleanup (Patches 1 and 2) followed by enabling
isolated PCI functions for s390 (Patches 3 and 4). If need be I can of course
split the cleanup off but for now I kept it as one as that's what I have
been testing.

Testing:
- On s390 with SR-IOV and a ConnectX NIC with PF 1 but not PF 0 passed throug
  i.e. the isolated function case. Also of course with just VFs and an NVMe.
- On x86_64 on a desktop system where ARI is disabled and with an SR-IOV NIC
  with non-contiguous VFs as well as the usual other PCI devices.

Thanks,
Niklas

Changes v4 -> v5:
- Remove unintended whitespace change in patch 1
Changes v3 -> v4:
- Use a do {} while loop in pci_scan_slot() as it is simpler (Bjorn)
- Explicitly check "fn == 0" as it is not a pointer or bool (Bjorn)
- Keep the "!dev" check in the ARI branch of next_fn() (Bjorn)
- Moved the "fn == 0 && !dev" condition out of next_fn() into pci_scan_slot().
  This allows us to keep the "!dev" case in the ARI branch and means there are
  no new conditions in next_fn() making it easier to verify that its behavior
  is equivalent to the existing code.
- Guard the assignment of dev->multifunction with "fn > 0"
  instead of "nr > 0". This matches the existing logic more closely and works
  for the jailhouse case which unconditionally sets dev->multifunction for
  "fn > 0". This also means fn == 0 is the single "first iteration" test.
- Remove some unneeded whitespace in patch 2

Changes v2 -> v3:
- Removed now unused nr_devs variable (kernel test robot)

Niklas Schnelle (4):
  PCI: Clean up pci_scan_slot()
  PCI: Move jailhouse's isolated function handling to pci_scan_slot()
  PCI: Extend isolated function probing to s390
  s390/pci: allow zPCI zbus without a function zero

 arch/s390/pci/pci_bus.c    | 82 ++++++++++----------------------------
 drivers/pci/probe.c        | 64 +++++++++++++----------------
 include/linux/hypervisor.h |  8 ++++
 3 files changed, 55 insertions(+), 99 deletions(-)

-- 
2.32.0


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

end of thread, other threads:[~2022-06-15 11:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02 10:30 [PATCH RESEND v5 0/4] PCI: Rework pci_scan_slot() and isolated PCI functions Niklas Schnelle
2022-06-02 10:30 ` [PATCH RESEND v5 1/4] PCI: Clean up pci_scan_slot() Niklas Schnelle
2022-06-15 11:09   ` Niklas Schnelle
2022-06-02 10:30 ` [PATCH RESEND v5 2/4] PCI: Move jailhouse's isolated function handling to pci_scan_slot() Niklas Schnelle
2022-06-02 10:30 ` [PATCH RESEND v5 3/4] PCI: Extend isolated function probing to s390 Niklas Schnelle
2022-06-02 10:30 ` [PATCH RESEND v5 4/4] s390/pci: allow zPCI zbus without a function zero Niklas Schnelle
  -- strict thread matches above, loose matches on Subject: below --
2022-05-05  8:38 [PATCH RESEND v5 0/4] PCI: Rework pci_scan_slot() and isolated PCI functions Niklas Schnelle
2022-05-05  8:38 ` [PATCH RESEND v5 2/4] PCI: Move jailhouse's isolated function handling to pci_scan_slot() Niklas Schnelle

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).