[PATCH v5 0/5] eBPF RSS through QMP support.

2023-08-02 Thread Andrew Melnychenko
since v1: * refactored virtio-net * moved hunks for ebpf mmap() * added qmp enum for eBPF id. Andrew Melnychenko (5): ebpf: Added eBPF map update through mmap. ebpf: Added eBPF initialization by fds. virtio-net: Added property to load eBPF RSS with fds. qmp: Added new command to retrieve

[PATCH v5 4/5] qmp: Added new command to retrieve eBPF blob.

2023-08-02 Thread Andrew Melnychenko
g QEMU. Overall, requesting the eBPF object from QEMU itself solves possible failures with acceptable effort. Links: [PATCH 3/5] qmp: Added the helper stamp check. https://lore.kernel.org/all/20230219162100.174318-4-and...@daynix.com/ Signed-off-by: Andrew Melnychenko --- ebpf/ebpf.c

[PATCH v5 1/5] ebpf: Added eBPF map update through mmap.

2023-08-02 Thread Andrew Melnychenko
Changed eBPF map updates through mmaped array. Mmaped arrays provide direct access to map data. It should omit using bpf_map_update_elem() call, which may require capabilities that are not present. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss.c | 117

[PATCH v5 2/5] ebpf: Added eBPF initialization by fds.

2023-08-02 Thread Andrew Melnychenko
It allows using file descriptors of eBPF provided outside of QEMU. QEMU may be run without capabilities for eBPF and run RSS program provided by management tool(g.e. libvirt). Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss-stub.c | 6 ++ ebpf/ebpf_rss.c | 27

[PATCH v5 3/5] virtio-net: Added property to load eBPF RSS with fds.

2023-08-02 Thread Andrew Melnychenko
eBPF RSS program and maps may now be passed during initialization. Initially was implemented for libvirt to launch qemu without permissions, and initialized eBPF program through the helper. Signed-off-by: Andrew Melnychenko --- hw/net/virtio-net.c| 55

[PATCH v5 5/5] ebpf: Updated eBPF program and skeleton.

2023-08-02 Thread Andrew Melnychenko
Updated section name, so libbpf should init/gues proper program type without specifications during open/load. Also, added map_flags with explicitly declared BPF_F_MMAPABLE. Signed-off-by: Andrew Melnychenko --- ebpf/rss.bpf.skeleton.h | 1460 --- tools/ebpf

[PATCH v9 1/5] ebpf: Added eBPF map update through mmap.

2024-02-05 Thread Andrew Melnychenko
Changed eBPF map updates through mmaped array. Mmaped arrays provide direct access to map data. It should omit using bpf_map_update_elem() call, which may require capabilities that are not present. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss.c | 117

[PATCH v9 3/5] virtio-net: Added property to load eBPF RSS with fds.

2024-02-05 Thread Andrew Melnychenko
eBPF RSS program and maps may now be passed during initialization. Initially was implemented for libvirt to launch qemu without permissions, and initialized eBPF program through the helper. Signed-off-by: Andrew Melnychenko --- hw/net/virtio-net.c| 54

[PATCH v9 5/5] ebpf: Updated eBPF program and skeleton.

2024-02-05 Thread Andrew Melnychenko
- some TCP/UDP packets may be considered fragmented if DF flag is set. Signed-off-by: Andrew Melnychenko --- ebpf/rss.bpf.skeleton.h | 1343 --- meson.build | 10 +- tools/ebpf/rss.bpf.c|7 +- 3 files changed, 687 insertions(+), 673

[PATCH v9 0/5] eBPF RSS through QMP support.

2024-02-05 Thread Andrew Melnychenko
virtio-net Changes since v1: * refactored virtio-net * moved hunks for ebpf mmap() * added qmp enum for eBPF id. Andrew Melnychenko (5): ebpf: Added eBPF map update through mmap. ebpf: Added eBPF initialization by fds. virtio-net: Added property to load eBPF RSS with fds. qmp: Added new

[PATCH v9 2/5] ebpf: Added eBPF initialization by fds.

2024-02-05 Thread Andrew Melnychenko
It allows using file descriptors of eBPF provided outside of QEMU. QEMU may be run without capabilities for eBPF and run RSS program provided by management tool(g.e. libvirt). Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss-stub.c | 6 ++ ebpf/ebpf_rss.c | 27

[PATCH v9 4/5] qmp: Added new command to retrieve eBPF blob.

2024-02-05 Thread Andrew Melnychenko
g QEMU. Overall, requesting the eBPF object from QEMU itself solves possible failures with acceptable effort. Links: [PATCH 3/5] qmp: Added the helper stamp check. https://lore.kernel.org/all/20230219162100.174318-4-and...@daynix.com/ Signed-off-by: Andrew Melnychenko --- ebpf/ebpf.c

[PATCH 1/1] ebpf: Added traces back. Changed source set for eBPF to 'system'.

2024-03-29 Thread Andrew Melnychenko
There was an issue with Qemu build with "--disable-system". The traces could be generated and the build fails. The traces were 'cut out' for previous patches, and overall, the 'system' source set should be used like in pre-'eBPF blob' patches. Sign

[PATCH v2 1/1] ebpf: Added traces back. Changed source set for eBPF to 'system'.

2024-04-22 Thread Andrew Melnychenko
There was an issue with Qemu build with "--disable-system". The traces could be generated and the build fails. The traces were 'cut out' for previous patches, and overall, the 'system' source set should be used like in pre-'eBPF blob' patches. Sign

[RFC PATCH 0/4] eBPF RSS through QMP support.

2023-03-29 Thread Andrew Melnychenko
. * Libvirt requests eBPF blob through QMP. * Libvirt loads blob for virtio-net. * Libvirt launches the QEMU with eBPF fds passed. Andrew Melnychenko (4): ebpf: Added eBPF initialization by fds and map update. virtio-net: Added property to load eBPF RSS with fds. ebpf: Added declaration

[RFC PATCH 1/5] ebpf: Added eBPF initialization by fds and map update.

2023-03-29 Thread Andrew Melnychenko
Changed eBPF map updates through mmaped array. Mmaped arrays provide direct access to map data. It should omit using bpf_map_update_elem() call, which may require capabilities that are not present. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss-stub.c | 6 +++ ebpf/ebpf_rss.c | 120

[RFC PATCH 4/5] qmp: Added new command to retrieve eBPF blob.

2023-03-29 Thread Andrew Melnychenko
Added command "request-ebpf". This command returns eBPF program encoded base64. The program taken from the skeleton and essentially is an ELF object that can be loaded in the future with libbpf. Signed-off-by: Andrew Melnychenko --- monitor/qmp-cmds.c | 17 + qapi

[RFC PATCH 5/5] ebpf: Updated eBPF program and skeleton.

2023-03-29 Thread Andrew Melnychenko
Updated section name, so libbpf should init/gues proper program type without specifications during open/load. Signed-off-by: Andrew Melnychenko --- ebpf/rss.bpf.skeleton.h | 1469 --- tools/ebpf/rss.bpf.c|2 +- 2 files changed, 741 insertions(+), 730

[RFC PATCH 3/5] ebpf: Added declaration/initialization routines.

2023-03-29 Thread Andrew Melnychenko
Now, the binary objects may be retrieved by id/name. It would require for future qmp commands that may require specific eBPF blob. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf.c | 48 ebpf/ebpf.h | 25 + ebpf

[RFC PATCH 2/5] virtio-net: Added property to load eBPF RSS with fds.

2023-03-29 Thread Andrew Melnychenko
eBPF RSS program and maps may now be passed during initialization. Initially was implemented for libvirt to launch qemu without permissions, and initialized eBPF program through the helper. Signed-off-by: Andrew Melnychenko --- hw/net/virtio-net.c| 77

[PATCH v2 3/6] virtio-net: Added property to load eBPF RSS with fds.

2023-05-12 Thread Andrew Melnychenko
eBPF RSS program and maps may now be passed during initialization. Initially was implemented for libvirt to launch qemu without permissions, and initialized eBPF program through the helper. Signed-off-by: Andrew Melnychenko --- hw/net/virtio-net.c| 55

[PATCH v2 2/6] ebpf: Added eBPF initialization by fds.

2023-05-12 Thread Andrew Melnychenko
It allows using file descriptors of eBPF provided outside of QEMU. QEMU may be run without capabilities for eBPF and run RSS program provided by management tool(g.e. libvirt). Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss-stub.c | 6 ++ ebpf/ebpf_rss.c | 27

[PATCH v2 5/6] qmp: Added new command to retrieve eBPF blob.

2023-05-12 Thread Andrew Melnychenko
Added command "request-ebpf". This command returns eBPF program encoded base64. The program taken from the skeleton and essentially is an ELF object that can be loaded in the future with libbpf. Signed-off-by: Andrew Melnychenko --- monitor/qmp-cmds.c | 16 qapi

[PATCH v2 0/6] eBPF RSS through QMP support.

2023-05-12 Thread Andrew Melnychenko
through mmap() call, so it should not require additional capabilities to bpf* calls. eBPF file descriptors can be passed to QEMU from parent process or by unix socket with sendfd() qmp command. Changes since v1: * refactored code. * eBPF program ids implemented as enums Andrew Melnychenko (6): ebpf

[PATCH v2 4/6] ebpf: Added declaration/initialization routines.

2023-05-12 Thread Andrew Melnychenko
Now, the binary objects may be retrieved by id. It would require for future qmp commands that may require specific eBPF blob. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf.c | 54 ebpf/ebpf.h | 31 +++ ebpf

[PATCH v2 6/6] ebpf: Updated eBPF program and skeleton.

2023-05-12 Thread Andrew Melnychenko
Updated section name, so libbpf should init/gues proper program type without specifications during open/load. Signed-off-by: Andrew Melnychenko --- ebpf/rss.bpf.skeleton.h | 1469 --- tools/ebpf/rss.bpf.c|2 +- 2 files changed, 741 insertions(+), 730

[PATCH v2 1/6] ebpf: Added eBPF map update through mmap.

2023-05-12 Thread Andrew Melnychenko
Changed eBPF map updates through mmaped array. Mmaped arrays provide direct access to map data. It should omit using bpf_map_update_elem() call, which may require capabilities that are not present. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss.c | 117

[PATCH 0/5] eBPF RSS through QMP support.

2023-05-01 Thread Andrew Melnychenko
) Andrew Melnychenko (5): ebpf: Added eBPF initialization by fds and map update. virtio-net: Added property to load eBPF RSS with fds. ebpf: Added declaration/initialization routines. qmp: Added new command to retrieve eBPF blob. ebpf: Updated eBPF program and skeleton. ebpf/ebpf.c

[PATCH 2/5] virtio-net: Added property to load eBPF RSS with fds.

2023-05-01 Thread Andrew Melnychenko
eBPF RSS program and maps may now be passed during initialization. Initially was implemented for libvirt to launch qemu without permissions, and initialized eBPF program through the helper. Signed-off-by: Andrew Melnychenko --- hw/net/virtio-net.c| 96

[PATCH 1/5] ebpf: Added eBPF initialization by fds and map update.

2023-05-01 Thread Andrew Melnychenko
Changed eBPF map updates through mmaped array. Mmaped arrays provide direct access to map data. It should omit using bpf_map_update_elem() call, which may require capabilities that are not present. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss-stub.c | 6 +++ ebpf/ebpf_rss.c | 120

[PATCH 5/5] ebpf: Updated eBPF program and skeleton.

2023-05-01 Thread Andrew Melnychenko
Updated section name, so libbpf should init/gues proper program type without specifications during open/load. Signed-off-by: Andrew Melnychenko --- ebpf/rss.bpf.skeleton.h | 1469 --- tools/ebpf/rss.bpf.c|2 +- 2 files changed, 741 insertions(+), 730

[PATCH 4/5] qmp: Added new command to retrieve eBPF blob.

2023-05-01 Thread Andrew Melnychenko
Added command "request-ebpf". This command returns eBPF program encoded base64. The program taken from the skeleton and essentially is an ELF object that can be loaded in the future with libbpf. Signed-off-by: Andrew Melnychenko --- monitor/qmp-cmds.c | 16 qapi

[PATCH 3/5] ebpf: Added declaration/initialization routines.

2023-05-01 Thread Andrew Melnychenko
Now, the binary objects may be retrieved by id/name. It would require for future qmp commands that may require specific eBPF blob. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf.c | 54 ebpf/ebpf.h | 31

[PATCH 3/5] qmp: Added the helper stamp check.

2023-02-19 Thread Andrew Melnychenko
Added a function to check the stamp in the helper. eBPF helper should have a special symbol that generates during the build. QEMU checks the helper and determines that it fits, so the helper will produce proper output. Signed-off-by: Andrew Melnychenko --- meson.build

[PATCH 4/5] ebpf_rss_helper: Added helper for eBPF RSS.

2023-02-19 Thread Andrew Melnychenko
no reason yet to build eBPF loader and helper for non-Linux systems, even if libbpf is present. Signed-off-by: Andrew Melnychenko --- ebpf/qemu-ebpf-rss-helper.c | 132 meson.build | 37 ++ 2 files changed, 156 insertions(+), 13

[PATCH 0/5] eBPF RSS Helper support.

2023-02-19 Thread Andrew Melnychenko
refactored helper. Andrew Melnychenko (5): ebpf: Added eBPF initialization by fds and map update. virtio-net: Added property to load eBPF RSS with fds. qmp: Added the helper stamp check. ebpf_rss_helper: Added helper for eBPF RSS. qmp: Added find-ebpf-rss-helper command. ebpf/ebpf_

[PATCH 5/5] qmp: Added find-ebpf-rss-helper command.

2023-02-19 Thread Andrew Melnychenko
eck the stamp of the helper to make sure that eBPF program is valid. Signed-off-by: Andrew Melnychenko --- monitor/qmp-cmds.c | 28 qapi/misc.json | 42 ++ 2 files changed, 70 insertions(+) diff --git a/monitor/qmp-cmds.c

[PATCH 1/5] ebpf: Added eBPF initialization by fds and map update.

2023-02-19 Thread Andrew Melnychenko
libvirt. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss-stub.c | 6 +++ ebpf/ebpf_rss.c | 120 ++- ebpf/ebpf_rss.h | 10 3 files changed, 113 insertions(+), 23 deletions(-) diff --git a/ebpf/ebpf_rss-stub.c b/ebpf/ebpf_rss-stub.c

[PATCH 2/5] virtio-net: Added property to load eBPF RSS with fds.

2023-02-19 Thread Andrew Melnychenko
eBPF RSS program and maps may now be passed during initialization. Initially was implemented for libvirt to launch qemu without permissions, and initialized eBPF program through the helper. Signed-off-by: Andrew Melnychenko --- hw/net/virtio-net.c| 77

[PATCH v8 4/5] qmp: Added new command to retrieve eBPF blob.

2024-01-25 Thread Andrew Melnychenko
g QEMU. Overall, requesting the eBPF object from QEMU itself solves possible failures with acceptable effort. Links: [PATCH 3/5] qmp: Added the helper stamp check. https://lore.kernel.org/all/20230219162100.174318-4-and...@daynix.com/ Signed-off-by: Andrew Melnychenko --- ebpf/ebpf.c

[PATCH v8 3/5] virtio-net: Added property to load eBPF RSS with fds.

2024-01-25 Thread Andrew Melnychenko
eBPF RSS program and maps may now be passed during initialization. Initially was implemented for libvirt to launch qemu without permissions, and initialized eBPF program through the helper. Signed-off-by: Andrew Melnychenko --- hw/net/virtio-net.c| 63

[PATCH v8 5/5] ebpf: Updated eBPF program and skeleton.

2024-01-25 Thread Andrew Melnychenko
- some TCP/UDP packets may be considered fragmented if DF flag is set. Signed-off-by: Andrew Melnychenko --- ebpf/rss.bpf.skeleton.h | 1343 --- meson.build | 10 +- tools/ebpf/rss.bpf.c|7 +- 3 files changed, 687 insertions(+), 673

[PATCH v8 1/5] ebpf: Added eBPF map update through mmap.

2024-01-25 Thread Andrew Melnychenko
Changed eBPF map updates through mmaped array. Mmaped arrays provide direct access to map data. It should omit using bpf_map_update_elem() call, which may require capabilities that are not present. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss.c | 120

[PATCH v8 0/5] eBPF RSS through QMP support.

2024-01-25 Thread Andrew Melnychenko
red virtio-net * moved hunks for ebpf mmap() * added qmp enum for eBPF id. Andrew Melnychenko (5): ebpf: Added eBPF map update through mmap. ebpf: Added eBPF initialization by fds. virtio-net: Added property to load eBPF RSS with fds. qmp: Added new command to retrieve eBPF blob. ebp

[PATCH v8 2/5] ebpf: Added eBPF initialization by fds.

2024-01-25 Thread Andrew Melnychenko
It allows using file descriptors of eBPF provided outside of QEMU. QEMU may be run without capabilities for eBPF and run RSS program provided by management tool(g.e. libvirt). Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss-stub.c | 9 +++-- ebpf/ebpf_rss.c | 27

[PATCH v6 0/5] eBPF RSS through QMP support.

2023-08-08 Thread Andrew Melnychenko
command * refactored virtio-net Changes since v1: * refactored virtio-net * moved hunks for ebpf mmap() * added qmp enum for eBPF id. Andrew Melnychenko (5): ebpf: Added eBPF map update through mmap. ebpf: Added eBPF initialization by fds. virtio-net: Added property to load eBPF RSS

[PATCH v6 3/5] virtio-net: Added property to load eBPF RSS with fds.

2023-08-08 Thread Andrew Melnychenko
eBPF RSS program and maps may now be passed during initialization. Initially was implemented for libvirt to launch qemu without permissions, and initialized eBPF program through the helper. Signed-off-by: Andrew Melnychenko --- hw/net/virtio-net.c| 55

[PATCH v6 2/5] ebpf: Added eBPF initialization by fds.

2023-08-08 Thread Andrew Melnychenko
It allows using file descriptors of eBPF provided outside of QEMU. QEMU may be run without capabilities for eBPF and run RSS program provided by management tool(g.e. libvirt). Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss-stub.c | 6 ++ ebpf/ebpf_rss.c | 27

[PATCH v6 4/5] qmp: Added new command to retrieve eBPF blob.

2023-08-08 Thread Andrew Melnychenko
g QEMU. Overall, requesting the eBPF object from QEMU itself solves possible failures with acceptable effort. Links: [PATCH 3/5] qmp: Added the helper stamp check. https://lore.kernel.org/all/20230219162100.174318-4-and...@daynix.com/ Signed-off-by: Andrew Melnychenko --- ebpf/ebpf.c

[PATCH v6 5/5] ebpf: Updated eBPF program and skeleton.

2023-08-08 Thread Andrew Melnychenko
Updated section name, so libbpf should init/gues proper program type without specifications during open/load. Also, added map_flags with explicitly declared BPF_F_MMAPABLE. Which would require kernel 5.5+. Signed-off-by: Andrew Melnychenko --- ebpf/rss.bpf.skeleton.h | 1460

[PATCH v6 1/5] ebpf: Added eBPF map update through mmap.

2023-08-08 Thread Andrew Melnychenko
Changed eBPF map updates through mmaped array. Mmaped arrays provide direct access to map data. It should omit using bpf_map_update_elem() call, which may require capabilities that are not present. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss.c | 117

[PATCH v4 0/6] eBPF RSS through QMP support.

2023-07-13 Thread Andrew Melnychenko
eBPF id. Andrew Melnychenko (6): ebpf: Added eBPF map update through mmap. ebpf: Added eBPF initialization by fds. virtio-net: Added property to load eBPF RSS with fds. ebpf: Added declaration/initialization routines. qmp: Added new command to retrieve eBPF blob. ebpf: Updated eBPF

[PATCH v4 3/6] virtio-net: Added property to load eBPF RSS with fds.

2023-07-13 Thread Andrew Melnychenko
eBPF RSS program and maps may now be passed during initialization. Initially was implemented for libvirt to launch qemu without permissions, and initialized eBPF program through the helper. Signed-off-by: Andrew Melnychenko --- hw/net/virtio-net.c| 55

[PATCH v4 6/6] ebpf: Updated eBPF program and skeleton.

2023-07-13 Thread Andrew Melnychenko
Updated section name, so libbpf should init/gues proper program type without specifications during open/load. Signed-off-by: Andrew Melnychenko --- ebpf/rss.bpf.skeleton.h | 1469 --- tools/ebpf/rss.bpf.c|2 +- 2 files changed, 741 insertions(+), 730

[PATCH v4 1/6] ebpf: Added eBPF map update through mmap.

2023-07-13 Thread Andrew Melnychenko
Changed eBPF map updates through mmaped array. Mmaped arrays provide direct access to map data. It should omit using bpf_map_update_elem() call, which may require capabilities that are not present. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss.c | 117

[PATCH v4 2/6] ebpf: Added eBPF initialization by fds.

2023-07-13 Thread Andrew Melnychenko
It allows using file descriptors of eBPF provided outside of QEMU. QEMU may be run without capabilities for eBPF and run RSS program provided by management tool(g.e. libvirt). Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss-stub.c | 6 ++ ebpf/ebpf_rss.c | 27

[PATCH v4 4/6] ebpf: Added declaration/initialization routines.

2023-07-13 Thread Andrew Melnychenko
Now, the binary objects may be retrieved by id. It would require for future qmp commands that may require specific eBPF blob. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf.c | 70 ebpf/ebpf.h | 31 + ebpf

[PATCH v4 5/6] qmp: Added new command to retrieve eBPF blob.

2023-07-13 Thread Andrew Melnychenko
g the eBPF object from QEMU itself solves possible failures with very little effort. Links: [PATCH 3/5] qmp: Added the helper stamp check. https://lore.kernel.org/all/20230219162100.174318-4-and...@daynix.com/ Signed-off-by: Andrew Melnychenko --- qapi/ebpf.json

[PATCH v3 0/6] eBPF RSS through QMP support.

2023-06-14 Thread Andrew Melnychenko
) Changes since v2: * moved/refactored QMP command * refactored virtio-net Changes since v1: * refactored virtio-net * moved hunks for ebpf mmap() * added qmp enum for eBPF id. Andrew Melnychenko (6): ebpf: Added eBPF map update through mmap. ebpf: Added eBPF initialization by fds. virtio-net

[PATCH v3 5/6] qmp: Added new command to retrieve eBPF blob.

2023-06-14 Thread Andrew Melnychenko
Added command "request-ebpf". This command returns eBPF program encoded base64. The program taken from the skeleton and essentially is an ELF object that can be loaded in the future with libbpf. Signed-off-by: Andrew Melnychenko --- qapi/ebpf.json

[PATCH v3 6/6] ebpf: Updated eBPF program and skeleton.

2023-06-14 Thread Andrew Melnychenko
Updated section name, so libbpf should init/gues proper program type without specifications during open/load. Signed-off-by: Andrew Melnychenko --- ebpf/rss.bpf.skeleton.h | 1469 --- tools/ebpf/rss.bpf.c|2 +- 2 files changed, 741 insertions(+), 730

[PATCH v3 4/6] ebpf: Added declaration/initialization routines.

2023-06-14 Thread Andrew Melnychenko
Now, the binary objects may be retrieved by id. It would require for future qmp commands that may require specific eBPF blob. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf.c | 70 ebpf/ebpf.h | 31 + ebpf

[PATCH v3 1/6] ebpf: Added eBPF map update through mmap.

2023-06-14 Thread Andrew Melnychenko
Changed eBPF map updates through mmaped array. Mmaped arrays provide direct access to map data. It should omit using bpf_map_update_elem() call, which may require capabilities that are not present. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss.c | 117

[PATCH v3 3/6] virtio-net: Added property to load eBPF RSS with fds.

2023-06-14 Thread Andrew Melnychenko
eBPF RSS program and maps may now be passed during initialization. Initially was implemented for libvirt to launch qemu without permissions, and initialized eBPF program through the helper. Signed-off-by: Andrew Melnychenko --- hw/net/virtio-net.c| 55

[PATCH v3 2/6] ebpf: Added eBPF initialization by fds.

2023-06-14 Thread Andrew Melnychenko
It allows using file descriptors of eBPF provided outside of QEMU. QEMU may be run without capabilities for eBPF and run RSS program provided by management tool(g.e. libvirt). Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss-stub.c | 6 ++ ebpf/ebpf_rss.c | 27

[PATCH v7 4/5] qmp: Added new command to retrieve eBPF blob.

2023-08-30 Thread Andrew Melnychenko
g QEMU. Overall, requesting the eBPF object from QEMU itself solves possible failures with acceptable effort. Links: [PATCH 3/5] qmp: Added the helper stamp check. https://lore.kernel.org/all/20230219162100.174318-4-and...@daynix.com/ Signed-off-by: Andrew Melnychenko --- ebpf/ebpf.c

[PATCH v7 1/5] ebpf: Added eBPF map update through mmap.

2023-08-30 Thread Andrew Melnychenko
Changed eBPF map updates through mmaped array. Mmaped arrays provide direct access to map data. It should omit using bpf_map_update_elem() call, which may require capabilities that are not present. Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss.c | 117

[PATCH v7 0/5] eBPF RSS through QMP support.

2023-08-30 Thread Andrew Melnychenko
the build if bpf disabled * rebased to the last master * refactored according to review Changes since v2: * moved/refactored QMP command * refactored virtio-net Changes since v1: * refactored virtio-net * moved hunks for ebpf mmap() * added qmp enum for eBPF id. Andrew Melnychenko (5

[PATCH v7 2/5] ebpf: Added eBPF initialization by fds.

2023-08-30 Thread Andrew Melnychenko
It allows using file descriptors of eBPF provided outside of QEMU. QEMU may be run without capabilities for eBPF and run RSS program provided by management tool(g.e. libvirt). Signed-off-by: Andrew Melnychenko --- ebpf/ebpf_rss-stub.c | 6 ++ ebpf/ebpf_rss.c | 27

[PATCH v7 3/5] virtio-net: Added property to load eBPF RSS with fds.

2023-08-30 Thread Andrew Melnychenko
eBPF RSS program and maps may now be passed during initialization. Initially was implemented for libvirt to launch qemu without permissions, and initialized eBPF program through the helper. Signed-off-by: Andrew Melnychenko --- hw/net/virtio-net.c| 55

[PATCH v7 5/5] ebpf: Updated eBPF program and skeleton.

2023-08-30 Thread Andrew Melnychenko
Updated section name, so libbpf should init/gues proper program type without specifications during open/load. Also, added map_flags with explicitly declared BPF_F_MMAPABLE. Added check for BPF_F_MMAPABLE flag to meson script and requirements to libbpf version. Signed-off-by: Andrew Melnychenko

[PATCH v5 1/7] net/tap: Added TUNSETSTEERINGEBPF code.

2021-03-25 Thread Andrew Melnychenko
From: Andrew Additional code that will be used for eBPF setting steering routine. Signed-off-by: Andrew Melnychenko --- net/tap-linux.h | 1 + 1 file changed, 1 insertion(+) diff --git a/net/tap-linux.h b/net/tap-linux.h index 2f36d100fc..1d06fe0de6 100644 --- a/net/tap-linux.h +++ b/net/tap

[PATCH v5 3/7] ebpf: Added eBPF RSS program.

2021-03-25 Thread Andrew Melnychenko
enditovich Signed-off-by: Andrew Melnychenko --- tools/ebpf/Makefile.ebpf | 22 ++ tools/ebpf/rss.bpf.c | 552 +++ 2 files changed, 574 insertions(+) create mode 100755 tools/ebpf/Makefile.ebpf create mode 100644 tools/ebpf/rss.bpf.c diff --git a/

[PATCH v5 5/7] virtio-net: Added eBPF RSS to virtio-net.

2021-03-25 Thread Andrew Melnychenko
hash population requested by the guest. Signed-off-by: Yuri Benditovich Signed-off-by: Andrew Melnychenko --- hw/net/vhost_net.c | 3 + hw/net/virtio-net.c| 115 - include/hw/virtio/virtio-net.h | 4 ++ net/vhost-vdpa.c

[PATCH v5 7/7] MAINTAINERS: Added eBPF maintainers information.

2021-03-25 Thread Andrew Melnychenko
From: Andrew Signed-off-by: Yuri Benditovich Signed-off-by: Andrew Melnychenko --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 5e4be6b667..0f74778ed7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3304,6 +3304,14 @@ F: include/hw

[PATCH v5 0/7] eBPF RSS support for virtio-net

2021-03-25 Thread Andrew Melnychenko
This set of patches introduces the usage of eBPF for packet steering and RSS hash calculation: * RSS(Receive Side Scaling) is used to distribute network packets to guest virtqueues by calculating packet hash * Additionally adding support for the usage of RSS with vhost The eBPF works on kernels 5.

[PATCH v5 6/7] docs: Added eBPF documentation.

2021-03-25 Thread Andrew Melnychenko
From: Andrew Signed-off-by: Yuri Benditovich Signed-off-by: Andrew Melnychenko --- docs/devel/ebpf_rss.rst | 125 docs/devel/index.rst| 1 + 2 files changed, 126 insertions(+) create mode 100644 docs/devel/ebpf_rss.rst diff --git a/docs/devel

[PATCH v5 2/7] net: Added SetSteeringEBPF method for NetClientState.

2021-03-25 Thread Andrew Melnychenko
From: Andrew For now, that method supported only by Linux TAP. Linux TAP uses TUNSETSTEERINGEBPF ioctl. Signed-off-by: Andrew Melnychenko --- include/net/net.h | 2 ++ net/tap-bsd.c | 5 + net/tap-linux.c | 13 + net/tap-solaris.c | 5 + net/tap-stub.c| 5

[PATCH v5 4/7] ebpf: Added eBPF RSS loader.

2021-03-25 Thread Andrew Melnychenko
: Yuri Benditovich Signed-off-by: Andrew Melnychenko --- configure | 8 +- ebpf/ebpf_rss-stub.c| 40 ebpf/ebpf_rss.c | 165 ebpf/ebpf_rss.h | 44 + ebpf/meson.build| 1 + ebpf/rss.bpf.skeleton.h | 423

[PATCH 0/1] libbpf dependecy for docker containers.

2021-04-06 Thread Andrew Melnychenko
ebian, libbpf is pressent but doesn't resolved as dependency by meson(may be pkg-config issues?). On those systems qemu will be build without eBPF RSS steering. The patch privedes changes for containers that able to build qemu with libbpf: Alpine, Centos8 and Fedora. Andrew Melnychenko (1): Ad

[PATCH 1/1] tests/docker: Added libbpf library to the docker files.

2021-04-06 Thread Andrew Melnychenko
The series of patches for eBPF RSS adds libbpf dependency for qemu. https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg08887.html With this patch, libbpf added: Alpine - added libbpf-dev Centos 8 - added libbpf-devel Fedora - added libbpf-devel Signed-off-by: Andrew Melnychenko

[PATCH v6 1/7] net/tap: Added TUNSETSTEERINGEBPF code.

2021-04-12 Thread Andrew Melnychenko
From: Andrew Additional code that will be used for eBPF setting steering routine. Signed-off-by: Andrew Melnychenko --- net/tap-linux.h | 1 + 1 file changed, 1 insertion(+) diff --git a/net/tap-linux.h b/net/tap-linux.h index 2f36d100fc..1d06fe0de6 100644 --- a/net/tap-linux.h +++ b/net/tap

[PATCH v6 0/7] eBPF RSS support for virtio-net

2021-04-12 Thread Andrew Melnychenko
This set of patches introduces the usage of eBPF for packet steering and RSS hash calculation: * RSS(Receive Side Scaling) is used to distribute network packets to guest virtqueues by calculating packet hash * Additionally adding support for the usage of RSS with vhost The eBPF works on kernels 5.

[PATCH v6 2/7] net: Added SetSteeringEBPF method for NetClientState.

2021-04-12 Thread Andrew Melnychenko
From: Andrew For now, that method supported only by Linux TAP. Linux TAP uses TUNSETSTEERINGEBPF ioctl. Signed-off-by: Andrew Melnychenko --- include/net/net.h | 2 ++ net/tap-bsd.c | 5 + net/tap-linux.c | 13 + net/tap-solaris.c | 5 + net/tap-stub.c| 5

[PATCH v6 5/7] virtio-net: Added eBPF RSS to virtio-net.

2021-04-12 Thread Andrew Melnychenko
hash population requested by the guest. Signed-off-by: Yuri Benditovich Signed-off-by: Andrew Melnychenko --- hw/net/vhost_net.c | 3 + hw/net/virtio-net.c| 115 - include/hw/virtio/virtio-net.h | 4 ++ net/vhost-vdpa.c

[PATCH v6 6/7] docs: Added eBPF documentation.

2021-04-12 Thread Andrew Melnychenko
From: Andrew Signed-off-by: Yuri Benditovich Signed-off-by: Andrew Melnychenko --- docs/devel/ebpf_rss.rst | 125 docs/devel/index.rst| 1 + 2 files changed, 126 insertions(+) create mode 100644 docs/devel/ebpf_rss.rst diff --git a/docs/devel

[PATCH v6 4/7] ebpf: Added eBPF RSS loader.

2021-04-12 Thread Andrew Melnychenko
: Yuri Benditovich Signed-off-by: Andrew Melnychenko --- configure | 8 +- ebpf/ebpf_rss-stub.c| 40 ebpf/ebpf_rss.c | 165 +++ ebpf/ebpf_rss.h | 44 ebpf/meson.build| 1 + ebpf/rss.bpf.skeleton.h | 431

[PATCH v6 3/7] ebpf: Added eBPF RSS program.

2021-04-12 Thread Andrew Melnychenko
enditovich Signed-off-by: Andrew Melnychenko --- tools/ebpf/Makefile.ebpf | 22 ++ tools/ebpf/rss.bpf.c | 569 +++ 2 files changed, 591 insertions(+) create mode 100755 tools/ebpf/Makefile.ebpf create mode 100644 tools/ebpf/rss.bpf.c diff --git a/

[PATCH v6 7/7] MAINTAINERS: Added eBPF maintainers information.

2021-04-12 Thread Andrew Melnychenko
From: Andrew Signed-off-by: Yuri Benditovich Signed-off-by: Andrew Melnychenko --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 58f342108e..e05a9fd9f6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3311,6 +3311,14 @@ F: include/hw

[PATCH v8 0/7] eBPF RSS support for virtio-net.

2021-05-14 Thread Andrew Melnychenko
parsing in the eBPF program. * added fragment packet parsing to skip L4. Changes since v6: * Added eBPF skeleton check to the meson.build file. Changes since v7: * Refactored code style and fixed warnings. * Added explicit pkg-config method for libbpf dependency. Andrew Melnychenko (7): net/tap

[PATCH v8 1/7] net/tap: Added TUNSETSTEERINGEBPF code.

2021-05-14 Thread Andrew Melnychenko
Additional code that will be used for eBPF setting steering routine. Signed-off-by: Andrew Melnychenko --- net/tap-linux.h | 1 + 1 file changed, 1 insertion(+) diff --git a/net/tap-linux.h b/net/tap-linux.h index 2f36d100fc..1d06fe0de6 100644 --- a/net/tap-linux.h +++ b/net/tap-linux.h

[PATCH v8 6/7] docs: Added eBPF documentation.

2021-05-14 Thread Andrew Melnychenko
Signed-off-by: Yuri Benditovich Signed-off-by: Andrew Melnychenko --- docs/devel/ebpf_rss.rst | 125 docs/devel/index.rst| 1 + 2 files changed, 126 insertions(+) create mode 100644 docs/devel/ebpf_rss.rst diff --git a/docs/devel/ebpf_rss.rst b

[PATCH v8 2/7] net: Added SetSteeringEBPF method for NetClientState.

2021-05-14 Thread Andrew Melnychenko
For now, that method supported only by Linux TAP. Linux TAP uses TUNSETSTEERINGEBPF ioctl. Signed-off-by: Andrew Melnychenko --- include/net/net.h | 2 ++ net/tap-bsd.c | 5 + net/tap-linux.c | 13 + net/tap-solaris.c | 5 + net/tap-stub.c| 5 + net/tap.c

[PATCH v8 3/7] ebpf: Added eBPF RSS program.

2021-05-14 Thread Andrew Melnychenko
ned-off-by: Andrew Melnychenko --- tools/ebpf/Makefile.ebpf | 22 ++ tools/ebpf/rss.bpf.c | 571 +++ 2 files changed, 593 insertions(+) create mode 100755 tools/ebpf/Makefile.ebpf create mode 100644 tools/ebpf/rss.bpf.c diff --git a/tools/ebpf/Makefile.ebpf b/

[PATCH v8 5/7] virtio-net: Added eBPF RSS to virtio-net.

2021-05-14 Thread Andrew Melnychenko
ation requested by the guest. Signed-off-by: Yuri Benditovich Signed-off-by: Andrew Melnychenko --- hw/net/vhost_net.c | 3 + hw/net/virtio-net.c| 116 - include/hw/virtio/virtio-net.h | 4 ++ net/vhost-vdpa.c | 2 + 4 files ch

[PATCH v8 7/7] MAINTAINERS: Added eBPF maintainers information.

2021-05-14 Thread Andrew Melnychenko
Signed-off-by: Yuri Benditovich Signed-off-by: Andrew Melnychenko --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 36055f14c5..c7e9a57cd9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3312,6 +3312,14 @@ F: include/hw/remote/proxy

[PATCH v8 4/7] ebpf: Added eBPF RSS loader.

2021-05-14 Thread Andrew Melnychenko
Signed-off-by: Andrew Melnychenko --- configure | 8 +- ebpf/ebpf_rss-stub.c| 40 ebpf/ebpf_rss.c | 165 +++ ebpf/ebpf_rss.h | 44 ebpf/meson.build| 1 + ebpf/rss.bpf.skeleton.h | 431

[PATCH v7 1/7] net/tap: Added TUNSETSTEERINGEBPF code.

2021-04-28 Thread Andrew Melnychenko
Additional code that will be used for eBPF setting steering routine. Signed-off-by: Andrew Melnychenko --- net/tap-linux.h | 1 + 1 file changed, 1 insertion(+) diff --git a/net/tap-linux.h b/net/tap-linux.h index 2f36d100fc..1d06fe0de6 100644 --- a/net/tap-linux.h +++ b/net/tap-linux.h

[PATCH v7 0/7] eBPF RSS support for virtio-net.

2021-04-28 Thread Andrew Melnychenko
This set of patches introduces the usage of eBPF for packet steering and RSS hash calculation: * RSS(Receive Side Scaling) is used to distribute network packets to guest virtqueues by calculating packet hash * Additionally adding support for the usage of RSS with vhost The eBPF works on kernels 5.

[PATCH v7 5/7] virtio-net: Added eBPF RSS to virtio-net.

2021-04-28 Thread Andrew Melnychenko
ation requested by the guest. Signed-off-by: Yuri Benditovich Signed-off-by: Andrew Melnychenko --- hw/net/vhost_net.c | 3 + hw/net/virtio-net.c| 115 - include/hw/virtio/virtio-net.h | 4 ++ net/vhost-vdpa.c | 2 + 4 files ch

  1   2   >