diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2024-08-01 03:44:42 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2024-08-01 04:32:00 -0400 |
commit | b1282f1e352db9947267a6524c6ded9678e82629 (patch) | |
tree | 402144b2fca75e3a8da095e09858bff9c7388ebd /include | |
parent | 9bab08da4e932e9c95919951792ae09d0a59f726 (diff) |
Revert "pcie_sriov: Reuse SR-IOV VF device instances"
This reverts commit 139610ae67f6ecf92127bb7bf53ac6265b459ec8.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/pci/pci.h | 5 | ||||
-rw-r--r-- | include/hw/pci/pci_device.h | 15 | ||||
-rw-r--r-- | include/hw/pci/pcie_sriov.h | 1 |
3 files changed, 6 insertions, 15 deletions
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 14a869eeaa..fe04b4fafd 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -680,4 +680,9 @@ static inline void pci_irq_pulse(PCIDevice *pci_dev) MSIMessage pci_get_msi_message(PCIDevice *dev, int vector); void pci_set_enabled(PCIDevice *pci_dev, bool state); +static inline void pci_set_power(PCIDevice *pci_dev, bool state) +{ + pci_set_enabled(pci_dev, state); +} + #endif diff --git a/include/hw/pci/pci_device.h b/include/hw/pci/pci_device.h index 1ff3ce94e2..f38fb31119 100644 --- a/include/hw/pci/pci_device.h +++ b/include/hw/pci/pci_device.h @@ -212,21 +212,6 @@ static inline uint16_t pci_get_bdf(PCIDevice *dev) return PCI_BUILD_BDF(pci_bus_num(pci_get_bus(dev)), dev->devfn); } -static inline void pci_set_power(PCIDevice *pci_dev, bool state) -{ - /* - * Don't change the enabled state of VFs when powering on/off the device. - * - * When powering on, VFs must not be enabled immediately but they must - * wait until the guest configures SR-IOV. - * When powering off, their corresponding PFs will be reset and disable - * VFs. - */ - if (!pci_is_vf(pci_dev)) { - pci_set_enabled(pci_dev, state); - } -} - uint16_t pci_requester_id(PCIDevice *dev); /* DMA access functions */ diff --git a/include/hw/pci/pcie_sriov.h b/include/hw/pci/pcie_sriov.h index 70649236c1..aa704e8f9d 100644 --- a/include/hw/pci/pcie_sriov.h +++ b/include/hw/pci/pcie_sriov.h @@ -18,6 +18,7 @@ typedef struct PCIESriovPF { uint16_t num_vfs; /* Number of virtual functions created */ uint8_t vf_bar_type[PCI_NUM_REGIONS]; /* Store type for each VF bar */ + const char *vfname; /* Reference to the device type used for the VFs */ PCIDevice **vf; /* Pointer to an array of num_vfs VF devices */ } PCIESriovPF; |