[PATCH v2 0/6] hw/net/igb: emulated network device with SR-IOV

Sriram Yagnaraman posted 6 patches 1 year, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221229190817.25500-1-sriram.yagnaraman@est.tech
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Jason Wang <jasowang@redhat.com>, Dmitry Fleytman <dmitry.fleytman@gmail.com>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>
hw/i386/Kconfig                |    1 +
hw/net/Kconfig                 |    5 +
hw/net/e1000_regs.h            |  363 ++-
hw/net/e1000x_common.c         |   13 +
hw/net/e1000x_common.h         |   29 +
hw/net/igb.c                   |  619 ++++++
hw/net/igb.h                   |  175 ++
hw/net/igb_core.c              | 3800 ++++++++++++++++++++++++++++++++
hw/net/igb_core.h              |  207 ++
hw/net/igbvf.c                 |  254 +++
hw/net/meson.build             |    2 +
hw/net/net_tx_pkt.c            |   17 +-
hw/net/net_tx_pkt.h            |    8 +
hw/net/trace-events            |  190 ++
hw/pci/pcie_sriov.c            |    6 +
include/hw/pci/pcie_sriov.h    |    5 +
tests/qtest/igb-test.c         |  222 ++
tests/qtest/libqos/igb.c       |  245 ++
tests/qtest/libqos/igb.h       |   51 +
tests/qtest/libqos/meson.build |    1 +
tests/qtest/meson.build        |    1 +
21 files changed, 6179 insertions(+), 35 deletions(-)
create mode 100644 hw/net/igb.c
create mode 100644 hw/net/igb.h
create mode 100644 hw/net/igb_core.c
create mode 100644 hw/net/igb_core.h
create mode 100644 hw/net/igbvf.c
create mode 100644 tests/qtest/igb-test.c
create mode 100644 tests/qtest/libqos/igb.c
create mode 100644 tests/qtest/libqos/igb.h
[PATCH v2 0/6] hw/net/igb: emulated network device with SR-IOV
Posted by Sriram Yagnaraman 1 year, 4 months ago
A new attempt at adding support for Intel 82576 Gigabit Ethernet adapter
with SR-IOV support.

Start qemu with the following parameters.
   qemu-system-x86_64 -enable-kvm -M q35 \
   ...
   -device pcie-root-port,slot=3,id=pcie_port.3 \
   -netdev tap,id=net3,script=no,downscript=/tmp/rmtap,ifname=xcbr3_t2,queues=1 \
   -device igb,bus=pcie_port.3,netdev=net3,mac=00:00:00:01:03:02

Load IGB/IGBVF modules if needed.
modprobe igb
modprobe igbvf

Create VFs via /sys 
ls /sys/bus/pci/devices/0000:01:00.0/
echo 2 > /sys/bus/pci/devices/0000:01:00.0/sriov_numvfs

Changes since v1:
- Added qtest for igb

Sriram Yagnaraman (6):
  pcie: add helper function to get number of VFs
  hw/net/net_tx_pkt: helper function to get l2 hdr
  hw/net/igb: register definitions
  hw/net/igb: emulated intel IGB (82576EB) network device
  hw/net/igb: build support for igb/igbvf devices
  tests/qtest/igb-test: introduce qtest for igb

 hw/i386/Kconfig                |    1 +
 hw/net/Kconfig                 |    5 +
 hw/net/e1000_regs.h            |  363 ++-
 hw/net/e1000x_common.c         |   13 +
 hw/net/e1000x_common.h         |   29 +
 hw/net/igb.c                   |  619 ++++++
 hw/net/igb.h                   |  175 ++
 hw/net/igb_core.c              | 3800 ++++++++++++++++++++++++++++++++
 hw/net/igb_core.h              |  207 ++
 hw/net/igbvf.c                 |  254 +++
 hw/net/meson.build             |    2 +
 hw/net/net_tx_pkt.c            |   17 +-
 hw/net/net_tx_pkt.h            |    8 +
 hw/net/trace-events            |  190 ++
 hw/pci/pcie_sriov.c            |    6 +
 include/hw/pci/pcie_sriov.h    |    5 +
 tests/qtest/igb-test.c         |  222 ++
 tests/qtest/libqos/igb.c       |  245 ++
 tests/qtest/libqos/igb.h       |   51 +
 tests/qtest/libqos/meson.build |    1 +
 tests/qtest/meson.build        |    1 +
 21 files changed, 6179 insertions(+), 35 deletions(-)
 create mode 100644 hw/net/igb.c
 create mode 100644 hw/net/igb.h
 create mode 100644 hw/net/igb_core.c
 create mode 100644 hw/net/igb_core.h
 create mode 100644 hw/net/igbvf.c
 create mode 100644 tests/qtest/igb-test.c
 create mode 100644 tests/qtest/libqos/igb.c
 create mode 100644 tests/qtest/libqos/igb.h

-- 
2.34.1