[RFC PATCH 1/4] qemu_monitor: Added QEMU's "request-ebpf" support.

2023-10-08 Thread Andrew Melnychenko
an be retrieved using QAPI. To load eBPF program - administrative capabilities are required, so Libvirt may load it and pass it to the QEMU instance. For now, there is only "RSS"(Receive Side Scaling) for virtio-net eBPF program and maps. Signed-off-by: Andrew Melnychenko --- src/qemu

[RFC PATCH 4/4] qemu_command: Added "ebpf_rss_fds" support for virtio-net.

2023-10-08 Thread Andrew Melnychenko
Added logic for loading the "RSS" eBPF program. eBPF file descriptors passed to the QEMU. Signed-off-by: Andrew Melnychenko --- src/qemu/qemu_command.c | 53 + src/qemu/qemu_domain.c | 4 src/qemu/qemu_domain.h | 3 +++ 3 files c

[RFC PATCH 3/4] qemu_interface: Added routine for loading the eBPF objects.

2023-10-08 Thread Andrew Melnychenko
Also, added dependencies for libbpf with bpf option. Signed-off-by: Andrew Melnychenko --- meson.build | 6 ++ meson_options.txt | 1 + src/qemu/meson.build | 1 + src/qemu/qemu_interface.c | 42 +++ src/qemu/qemu_interface.h

[RFC PATCH 2/4] qemu_capabilities: Added new capability ebpf_rss_fds for QEMU.

2023-10-08 Thread Andrew Melnychenko
Also, added logic for retrieving eBPF objects from QEMU. eBPF objects stored in the hash table during runtime. eBPF objects cached encoded in base64 in the .xml cache file. Signed-off-by: Andrew Melnychenko --- src/qemu/qemu_capabilities.c | 181 +++ src/qemu

[RFC PATCH 0/4] Added virtio-net RSS with eBPF support.

2023-10-08 Thread Andrew Melnychenko
This series of rfc patches adds support for loading the RSS eBPF program and passing it to the QEMU. Comments and suggestions would be useful. QEMU with vhost may work with RSS through eBPF. To load eBPF, the capabilities required that Libvirt may provide. eBPF program and maps may be unique for

[PATCH v2 2/4] qemu_capabilities: Added capabilites for qemu's "rss" and "hash".

2022-01-09 Thread Andrew Melnychenko
And added capability QEMU_CAPS_VIRTIO_RSS. With "rss" and "rss_hash_report" from domain config, qemu should enable "rss" and "hash" for virtio-net. Added caps tests for qemu 5.2+. Signed-off-by: Andrew Melnychenko --- src/qemu/qemu_capabilities

[PATCH v2 4/4] test: Added xml2argv and xml2xml tests.

2022-01-09 Thread Andrew Melnychenko
Added rss, hash and rss+hash xml2argv tests. virtio-options tests was used for xml2xml test. Signed-off-by: Andrew Melnychenko --- .../net-virtio-rss.x86_64-latest.args | 43 +++ tests/qemuxml2argvdata/net-virtio-rss.xml | 39 + .../virtio

[PATCH v2 0/4] VirtioNet RSS support.

2022-01-09 Thread Andrew Melnychenko
O RSS. Changes since v1: * refactored patches * changed docs and tests Changes since RFC: * rebased and refactored * added tests * postponed the helper Andrew Melnychenko (4): domain_conf: Added configs for RSS and Hash report. qemu_capabilities: Added capabilites for qemu's &quo

[PATCH v2 3/4] qemu_command: Added "rss" and "hash" properties.

2022-01-09 Thread Andrew Melnychenko
Libvirt will create an NIC device command line with enabled "rss"/"hash". If domain config contains "rss" and/or "rss_hash_report" options for driver. Also if the qemu has device capabilities for RSS. Signed-off-by: Andrew Melnychenko --- sr

[PATCH v2 1/4] domain_conf: Added configs for RSS and Hash report.

2022-01-09 Thread Andrew Melnychenko
Added "rss" and "rss_hash_report" configuration that should be used with qemu virtio RSS. Both options are triswitches. Used as "driver" options and affects only NIC with model type "virtio". In other patches - options should turn on virtio-net RSS and

[PATCH 2/3] qemu_capabilities: Added capabilites for qemu's "rss" and "hash".

2021-12-29 Thread Andrew Melnychenko
_hash_report" options for driver. Libvirt will create an NIC device command line with enabled "rss"/"hash". Signed-off-by: Andrew Melnychenko --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 2 ++ src/qemu/qemu_

[PATCH 0/3] VirtioNet RSS support

2021-12-29 Thread Andrew Melnychenko
RSS. Changes since RFC: * rebased and refactored * added tests * postponed the helper Andrew Melnychenko (3): domain_conf: Added configs for RSS and Hash report. qemu_capabilities: Added capabilites for qemu's "rss" and "hash". test: Added caps, xml2argv and xm

[PATCH 1/3] domain_conf: Added configs for RSS and Hash report.

2021-12-29 Thread Andrew Melnychenko
Added "rss" and "rss_hash_report" configuration that should be used with qemu virtio RSS. Both options are triswitches. Used as "driver" options and affects only NIC with model type "virtio". In other patches - options should turn on virtio-net RSS and

[PATCH 3/3] test: Added caps, xml2argv and xml2xml tests.

2021-12-29 Thread Andrew Melnychenko
Added caps tests for qemu 5.2+. Added rss, hash and rss+hash xml2argv tests. virtio-options tests was used for xml2xml test. Signed-off-by: Andrew Melnychenko --- .../caps_5.1.0.x86_64.xml | 1 + .../caps_5.2.0.aarch64.xml| 1 + .../qemucapabilitiesdata

[RFC PATCH 05/10] qemu_capabilities: Added capability for qemu's "ebpf_rss_fds".

2021-07-28 Thread Andrew Melnychenko
Added check for qemu virtio-net "ebpf_rss_fds" property. This property allows to pass eBPF program/map file descriptors for RSS program. In other patches, libvirt may launch qemu-ebpf-rss-helper and pass fds to virtio-net qemu. Signed-off-by: Andrew Melnychenko --- src/qemu/qemu_capa

[RFC PATCH 09/10] qemu_hotplug: Added helper call for hotplug NIC.

2021-07-28 Thread Andrew Melnychenko
The helper called before NIC string creation. eBPF fds passed to the child process through qmp. Qemu should support "ebpf_rss_fds" and return path to the helper. Also added check for device "update". Signed-off-by: Andrew Melnychenko --- src/qemu

[RFC PATCH 08/10] qemu_command: Added ebpf RSS helper call for NIC creation.

2021-07-28 Thread Andrew Melnychenko
property. Signed-off-by: Andrew Melnychenko --- src/qemu/qemu_command.c | 36 +++- src/qemu/qemu_command.h | 2 ++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 67a396a513..2fffcee609 100644 ---

[RFC PATCH 04/10] virsocket: Added receive for multiple fds.

2021-07-28 Thread Andrew Melnychenko
Similar to virSocketRecvFD() added virSocketRecvMultipleFDs(). This function returns multiple fds through unix socket. New function is required for "qemu-ebpf-rss-helper" program. The helper may pass few file descriptors - eBPF program and maps. Signed-off-by: Andrew Melnychenko

[RFC PATCH 10/10] docs: Added descriptions for "rss" and "rss_hash_report" configurations.

2021-07-28 Thread Andrew Melnychenko
Signed-off-by: Andrew Melnychenko --- docs/formatdomain.rst | 16 1 file changed, 16 insertions(+) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 61ccd8895a..22ad19439f 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -5233,6 +5233,22

[RFC PATCH 03/10] qemu_command: Added "rss" and "hash" properties.

2021-07-28 Thread Andrew Melnychenko
If domain config contains "rss" and/or "rss_hash_report" options for driver. Also if the qemu has device capabilities for RSS. Libvirt will create an NIC device command line with enabled "rss"/"hash". Signed-off-by: Andrew Melnychenko --- src/qemu/qemu_c

[RFC PATCH 02/10] qemu_capabilities: Added capabilites for qemu's "rss" and "hash".

2021-07-28 Thread Andrew Melnychenko
Added qemu's property check for virtio-net. And added capability QEMU_CAPS_VIRTIO_RSS. With "rss" and "rss_hash_report" from domain config, qemu should enable "rss" and "hash" for virtio-net. Signed-off-by: Andrew Melnychenko --- s

[RFC PATCH 07/10] qemu_interface: Added ebpf helper call.

2021-07-28 Thread Andrew Melnychenko
New function to call "qemu-ebpf-rss-helper". The helper passes few fds through unix socket. Technically libvirt should not be aware how many and what those fds. The helper should return fds that should be passed to the qemu as is and in same order. Signed-off-by: Andrew Melnychenko

[RFC PATCH 00/10] VirtioNet RSS support

2021-07-28 Thread Andrew Melnychenko
. 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

[RFC PATCH 06/10] qemu_capabilities: Added capability for ebpf helper path.

2021-07-28 Thread Andrew Melnychenko
with "interface" for current qemu. So, qemu returns where to find the helper through qmp, if the qemu supports "ebpf_rss_fds". Signed-off-by: Andrew Melnychenko --- src/qemu/qemu_capabilities.c | 44 +++ src/qemu/qemu_capabilities.h | 3 +++ src/qe

[RFC PATCH 01/10] domain_conf: Added configs for RSS and Hash report.

2021-07-28 Thread Andrew Melnychenko
hash properties. Also "rss" may used to affect "ebpf_rss_fds" property of virtio-net in qemu. Signed-off-by: Andrew Melnychenko --- src/conf/domain_conf.c | 31 ++- src/conf/domain_conf.h | 2 ++ 2 files changed, 32 insertions(+), 1 deletion(-) diff -