[PATCH 08/14] qdev: Add qdev_device_new_from_qdict()

2023-12-02 Thread Akihiko Odaki
qdev_device_new_from_qdict() can be used to create a device from QDict without realizing it. Signed-off-by: Akihiko Odaki --- include/monitor/qdev.h | 2 ++ system/qdev-monitor.c | 23 --- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git

[PATCH 05/14] virtio-net: Implement pci-failover

2023-12-02 Thread Akihiko Odaki
This change removes the parsing of pci-device's failover_pair_id property from virtio-net, and lets pci-device to report an error if an unknown ID is specified for the property. Signed-off-by: Akihiko Odaki --- include/hw/virtio/virtio-net.h | 3 ++- hw/net/virtio-net.c| 24

[PATCH 12/14] pcie_sriov: Allow to specify VF device options

2023-12-02 Thread Akihiko Odaki
Specifying VF device options will be useful to create VFs based on conventional device emulation code which have user-configurable options. Signed-off-by: Akihiko Odaki --- docs/pcie_sriov.txt | 2 +- include/hw/pci/pcie_sriov.h | 13 ++-- hw/net/igb.c| 2 +-

[PATCH 09/14] hw/pci: Do not add ROM BAR for SR-IOV VF

2023-12-02 Thread Akihiko Odaki
A SR-IOV VF cannot have a ROM BAR. Co-developed-by: Yui Washizu Signed-off-by: Akihiko Odaki --- hw/pci/pci.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 67d8ae3f61..54d9e0f4cf 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2419,6 +2419,14 @@

[PATCH 03/14] qdev: Add DeviceClass::hide()

2023-12-02 Thread Akihiko Odaki
DeviceClass::hide() is a better alternative to DeviceListener::hide_device() that does not need listener registration and is contained in specific devices that need the hiding capability. Signed-off-by: Akihiko Odaki --- include/hw/qdev-core.h | 33 +++--

[PATCH 14/14] virtio-net: Add SR-IOV capability

2023-12-02 Thread Akihiko Odaki
This enables the SR-IO capability previously added to virtio-pci for virtio-net-pci. Buglink: https://issues.redhat.com/browse/RHEL-1216 Signed-off-by: Akihiko Odaki --- hw/virtio/virtio-net-pci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/virtio-net-pci.c

[PATCH 06/14] qdev: Remove DeviceListener::hide_device()

2023-12-02 Thread Akihiko Odaki
It is no longer used. Signed-off-by: Akihiko Odaki --- include/hw/qdev-core.h | 24 hw/core/qdev.c | 18 -- system/qdev-monitor.c | 9 - 3 files changed, 51 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h

[PATCH 04/14] hw/pci: Add pci-failover

2023-12-02 Thread Akihiko Odaki
pci-failover allows to create a device capable of failover without relying on DeviceListener::hide_device(), which intrudes the pci-device implementation from outside. Signed-off-by: Akihiko Odaki --- include/hw/pci/pci_device.h | 14 ++ hw/pci/pci.c| 43

[PATCH 11/14] pcie_sriov: Release VFs failed to realize

2023-12-02 Thread Akihiko Odaki
Release VFs failed to realize just as we do in unregister_vfs(). Signed-off-by: Akihiko Odaki --- hw/pci/pcie_sriov.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c index 5ef8950940..3ec786d341 100644 --- a/hw/pci/pcie_sriov.c +++

[PATCH 13/14] virtio-pci: add SR-IOV capability

2023-12-02 Thread Akihiko Odaki
This enables SR-IOV emulation on virtio-pci devices. It introduces a property 'sriov-pf' to state that the device will be a VF, and it will be paired with the PF identified with the property. Currently this feature needs to be explicitly enabled by a subclass. Co-developed-by: Yui Washizu

[PATCH 02/14] hw/qdev: Remove opts member

2023-12-02 Thread Akihiko Odaki
It is no longer used. Signed-off-by: Akihiko Odaki --- include/hw/pci/pci_device.h | 2 +- include/hw/qdev-core.h | 4 hw/core/qdev.c | 1 - system/qdev-monitor.c | 12 +++- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git

[PATCH 10/14] msix: Call pcie_sriov_vf_register_bar() for SR-IOV VF

2023-12-02 Thread Akihiko Odaki
A SR-IOV VF needs to use pcie_sriov_vf_register_bar() instead of pci_register_bar(). Co-developed-by: Yui Washizu Signed-off-by: Akihiko Odaki --- hw/pci/msix.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/pci/msix.c b/hw/pci/msix.c index

Re: [PATCH 00/14] virtio-net: add support for SR-IOV emulation

2023-12-02 Thread Akihiko Odaki
On 2023/12/02 17:00, Akihiko Odaki wrote: Introduction This series is based on the RFC series submitted by Yui Washizu[1]. See also [2] for the context. This series enables SR-IOV emulation for virtio-net. It is useful to test SR-IOV support on the guest, or to expose several vDPA

[PATCH 00/14] virtio-net: add support for SR-IOV emulation

2023-12-02 Thread Akihiko Odaki
18 files changed, 442 insertions(+), 124 deletions(-) --- base-commit: 4705fc0c8511d073bee4751c3c974aab2b10a970 change-id: 20231202-sriov-9402fb262be8 Best regards, -- Akihiko Odaki

[PATCH 01/14] vfio: Avoid inspecting option QDict for rombar

2023-12-02 Thread Akihiko Odaki
vfio determines if rombar is explicitly enabled by inspecting QDict. Inspecting QDict is not nice because QDict is untyped and depends on the details on the external interface. Instead of inspecting QDict, inspect PCIDevice::rom_bar. PCIDevice::rom_bar is changed to have -1 by the default to tell

[PATCH 07/14] hw/pci: Add hide()

2023-12-02 Thread Akihiko Odaki
hide() can be implemented to prevent creating a PCI device and get device options. Signed-off-by: Akihiko Odaki --- include/hw/pci/pci_device.h | 2 ++ hw/pci/pci.c| 8 2 files changed, 10 insertions(+) diff --git a/include/hw/pci/pci_device.h