Ping

On Wed, Jul 28, 2021 at 11:17 AM Andrew Melnychenko <andrew@daynix.com> wrote:
This series of patches add RSS property support for virtio-net-pci.

Virtio RSS effectively works with TAP devices, it requires additional
vectors for VirtioNet, queues for TAP device, and vCPU cores.
Example of device configuration:
```
<interface type="network">
  <mac address="52:54:00:c4:90:25"/>
  <source network="default"/>
  <model type="virtio"/>
  <driver name="qemu" queues="9" rss="on" rss_hash_report="off"/>
  <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
</interface>
```

Capability "rss" enables RSS, "rss_hash_report" - enables hashes in vheader.
Qemu uses eBPF program as RSS driver.
For loading RSS eBPF program, the helper is used.
Path to the helper is provided by Qemu through "query-helper-paths" qmp command.
The helper "qemu-ebpf-rss-helper" is built with Qemu and may differ from build to build.
So it's required that the Qemu should provide a proper helper path.
Libvirt would call the helper and receive the program and map fd through unix socket.
Fds would be passed to Qemu in "ebpf_rss_fds" property by passing to child process or unix socket.
If libvirt would fail at helper call or Qemu didn't provide the path,
the Qemu would be launched without "ebpf_rss_fds" property.
Without "ebpf_rss_fds" property, Qemu would try to load eBPF program by
itself - usually, it would require additional system permissions.
Qemu may use "in-qemu" RSS as a fallback option, which will not require system
permissions, but doesn't work with vhost TAP.

Qemu patches: https://lists.nongnu.org/archive/html/qemu-devel/2021-07/msg03535.html

Andrew Melnychenko (10):
  domain_conf: Added configs for RSS and Hash report.
  qemu_capabilities: Added capabilites for qemu's "rss" and "hash".
  qemu_command: Added "rss" and "hash" properties.
  virsocket: Added receive for multiple fds.
  qemu_capabilities: Added capability for qemu's "ebpf_rss_fds".
  qemu_capabilities: Added capability for ebpf helper path.
  qemu_interface: Added ebpf helper call.
  qemu_command: Added ebpf RSS helper call for NIC creation.
  qemu_hotplug: Added helper call for hotplug NIC.
  docs: Added descriptions for "rss" and "rss_hash_report"
    configurations.

 docs/formatdomain.rst        | 16 +++++++
 src/conf/domain_conf.c       | 31 +++++++++++++-
 src/conf/domain_conf.h       |  2 +
 src/libvirt_private.syms     |  1 +
 src/qemu/qemu_capabilities.c | 48 +++++++++++++++++++++
 src/qemu/qemu_capabilities.h |  5 +++
 src/qemu/qemu_command.c      | 46 +++++++++++++++++++-
 src/qemu/qemu_command.h      |  2 +
 src/qemu/qemu_hotplug.c      | 30 ++++++++++++-
 src/qemu/qemu_interface.c    | 54 +++++++++++++++++++++++
 src/qemu/qemu_interface.h    |  2 +
 src/qemu/qemu_monitor.c      |  9 ++++
 src/qemu/qemu_monitor.h      |  3 ++
 src/qemu/qemu_monitor_json.c | 50 ++++++++++++++++++++++
 src/qemu/qemu_monitor_json.h |  3 ++
 src/qemu/qemu_validate.c     | 16 +++++++
 src/util/virsocket.c         | 83 ++++++++++++++++++++++++++++++++++++
 src/util/virsocket.h         |  2 +
 18 files changed, 399 insertions(+), 4 deletions(-)

--
2.31.1