[Skiboot] [PATCH RFC v2 0/6] core/pci: Sync VFs and the changes of bdfns between the firmware and the OS

Sergey Miroshnichenko s.miroshnichenko at yadro.com
Fri Mar 8 01:07:30 AEDT 2019


An OS may re-enumerate the PCIe tree during boot or after hot-plugging a
bridge, but this leads to de-sync of the cached and actual BDF addresses.

This patchset tracks the changes in bus numbers and updates the cached
topology (a tree consisting of struct pci_device nodes) correspondingly,
including allocation of newly discovered devices and activated virtual
functions within SR-IOV.

Tested on POWER8 PowerNV+PHB3 ppc64le (our Vesnin server) with:
 * Linux kernel 5.0;
   - the pciehp driver active;
   - the pnv_php driver disabled;
   - Extra pacthes applied: "powerpc/powernv/pci: Make hotplug
     self-sufficient, independent of FW and DT";
   - surprise hotplug of an NVME disk works;
   - controlled hotplug of a network card with SR-IOV works;
   - activating of SR-IOV on a network card works;
   - [with extra patches] manually initiated (via sysfs) rescan has found
     and turned on a hotplugged bridge;

 * Ubuntu's 4.15.0-45-generic kernel from 18.04.2 LTS:
   - boots and works just fine.

Changes since v1:
 - Fixed comparing 32-bit constant with uint16_t and uint8_t.

Sergey Miroshnichenko (6):
  core/pci: Add functions to find accessible devices by bdfn
  core/pci: Make the pci_scan_one() function public
  core/pci: Create the struct pci_device nodes automatically
  pci-iov: Fix device allocation for VFs
  pci-iov: Set parent of VFs to the bridge's downstream instead of PF
  core/pci: Hook up the writes to PRIMARY/SECONDARY/SUBORDINATE_BUS
    registers

 core/pci-iov.c  |  27 +++++++------
 core/pci-opal.c | 101 +++++++++++++++++++++++++++++++++++++++++++++---
 core/pci.c      |  87 ++++++++++++++++++++++++++++++++++++++++-
 include/pci.h   |   4 ++
 4 files changed, 201 insertions(+), 18 deletions(-)

-- 
2.20.1



More information about the Skiboot mailing list