All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/5] ebpf: Added ebpf helper for libvirtd.
@ 2021-06-09 10:04 Andrew Melnychenko
  2021-06-09 10:04 ` [RFC PATCH 1/5] ebpf: Added eBPF initialization by fds Andrew Melnychenko
                   ` (5 more replies)
  0 siblings, 6 replies; 35+ messages in thread
From: Andrew Melnychenko @ 2021-06-09 10:04 UTC (permalink / raw)
  To: mst, yuri.benditovich, jasowang, armbru, eblake, berrange; +Cc: yan, qemu-devel

Libvirt usually launches qemu with strict permissions.
To enable eBPF RSS steering, qemu-ebpf-rss-helper was added.

Added property "ebpf_rss_fds" for "virtio-net" that allows to
initialize eBPF RSS context with passed program & maps fds.

Added qemu-ebpf-rss-helper - simple helper that loads eBPF
context and passes fds through unix socket.
Libvirt should call the helper and pass fds to qemu through
"ebpf_rss_fds" property.

Added explicit target OS check for libbpf dependency in meson.
eBPF RSS works only with Linux TAP, so there is no reason to
build eBPF loader/helper for non-Linux.

Overall, libvirt process should not be aware of the "interface"
of eBPF RSS, it will not be aware of eBPF maps/program "type" and
their quantity. That's why qemu and the helper should be from
the same build and be "synchronized". Technically each qemu may
have its own helper. That's why "query-helper-paths" qmp command
was added. Qemu should return the path to the helper that suits
and libvirt should use "that" helper for "that" emulator.

qmp sample:
C: { "execute": "query-helper-paths" }
S: { "return": [
     {
       "name": "qemu-ebpf-rss-helper",
       "path": "/usr/local/libexec/qemu-ebpf-rss-helper"
     }
    ]
   }

Andrew Melnychenko (5):
  ebpf: Added eBPF initialization by fds.
  virtio-net: Added property to load eBPF RSS with fds.
  ebpf_rss_helper: Added helper for eBPF RSS.
  qmp: Added qemu-ebpf-rss-path command.
  meson: libbpf dependency now exclusively for Linux.

 ebpf/ebpf_rss-stub.c           |   6 ++
 ebpf/ebpf_rss.c                |  31 +++++++-
 ebpf/ebpf_rss.h                |   5 ++
 ebpf/qemu-ebpf-rss-helper.c    | 130 +++++++++++++++++++++++++++++++++
 hw/net/virtio-net.c            |  77 ++++++++++++++++++-
 include/hw/virtio/virtio-net.h |   1 +
 meson.build                    |  37 ++++++----
 monitor/qmp-cmds.c             |  78 ++++++++++++++++++++
 qapi/misc.json                 |  29 ++++++++
 9 files changed, 374 insertions(+), 20 deletions(-)
 create mode 100644 ebpf/qemu-ebpf-rss-helper.c

-- 
2.31.1



^ permalink raw reply	[flat|nested] 35+ messages in thread
* [RFC PATCH 0/4] eBPF RSS through QMP support.
@ 2023-03-29 10:45 Andrew Melnychenko
  2023-03-29 10:45   ` Andrew Melnychenko
  0 siblings, 1 reply; 35+ messages in thread
From: Andrew Melnychenko @ 2023-03-29 10:45 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, mst, jasowang, yoshfuji, dsahern,
	netdev, linux-kernel, virtualization
  Cc: yan, yuri.benditovich

This series of patches provides the ability to retrieve eBPF program
through qmp, so management application may load bpf blob with proper capabilities.
Now, virtio-net devices can accept eBPF programs and maps through properties
as external file descriptors. Access to the eBPF map is direct 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.

Overall, the basic scenario of using the helper looks like this:
 * Libvirt checks for ebpf_fds property.
 * 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/initialization routines.
  qmp: Added new command to retrieve eBPF blob.

 ebpf/ebpf.c                    |  48 +++++++++++++
 ebpf/ebpf.h                    |  25 +++++++
 ebpf/ebpf_rss-stub.c           |   6 ++
 ebpf/ebpf_rss.c                | 124 +++++++++++++++++++++++++++------
 ebpf/ebpf_rss.h                |  10 +++
 ebpf/meson.build               |   1 +
 hw/net/virtio-net.c            |  77 ++++++++++++++++++--
 include/hw/virtio/virtio-net.h |   1 +
 monitor/qmp-cmds.c             |  17 +++++
 qapi/misc.json                 |  25 +++++++
 10 files changed, 307 insertions(+), 27 deletions(-)
 create mode 100644 ebpf/ebpf.c
 create mode 100644 ebpf/ebpf.h

-- 
2.39.1


^ permalink raw reply	[flat|nested] 35+ messages in thread
* [RFC PATCH 0/4] eBPF RSS through QMP support.
@ 2023-03-30  0:15 Andrew Melnychenko
  2023-03-30  0:15 ` [RFC PATCH 2/5] virtio-net: Added property to load eBPF RSS with fds Andrew Melnychenko
  0 siblings, 1 reply; 35+ messages in thread
From: Andrew Melnychenko @ 2023-03-30  0:15 UTC (permalink / raw)
  To: jasowang, mst, pbonzini, marcandre.lureau, berrange, thuth,
	philmd, armbru, eblake, qemu-devel, toke, mprivozn
  Cc: yuri.benditovich, yan

This series of patches provides the ability to retrieve eBPF program
through qmp, so management application may load bpf blob with proper capabilities.
Now, virtio-net devices can accept eBPF programs and maps through properties
as external file descriptors. Access to the eBPF map is direct 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.

Overall, the basic scenario of using the helper looks like this:
 * Libvirt checks for ebpf_fds property.
 * 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/initialization routines.
  qmp: Added new command to retrieve eBPF blob.

 ebpf/ebpf.c                    |  48 +++++++++++++
 ebpf/ebpf.h                    |  25 +++++++
 ebpf/ebpf_rss-stub.c           |   6 ++
 ebpf/ebpf_rss.c                | 124 +++++++++++++++++++++++++++------
 ebpf/ebpf_rss.h                |  10 +++
 ebpf/meson.build               |   1 +
 hw/net/virtio-net.c            |  77 ++++++++++++++++++--
 include/hw/virtio/virtio-net.h |   1 +
 monitor/qmp-cmds.c             |  17 +++++
 qapi/misc.json                 |  25 +++++++
 10 files changed, 307 insertions(+), 27 deletions(-)
 create mode 100644 ebpf/ebpf.c
 create mode 100644 ebpf/ebpf.h

-- 
2.39.1



^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2023-03-30  8:53 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 10:04 [RFC PATCH 0/5] ebpf: Added ebpf helper for libvirtd Andrew Melnychenko
2021-06-09 10:04 ` [RFC PATCH 1/5] ebpf: Added eBPF initialization by fds Andrew Melnychenko
2021-06-09 10:04 ` [RFC PATCH 2/5] virtio-net: Added property to load eBPF RSS with fds Andrew Melnychenko
2021-06-09 10:04 ` [RFC PATCH 3/5] ebpf_rss_helper: Added helper for eBPF RSS Andrew Melnychenko
2021-06-09 10:04 ` [RFC PATCH 4/5] qmp: Added qemu-ebpf-rss-path command Andrew Melnychenko
2021-06-11 14:15   ` Eric Blake
2021-06-11 17:21     ` Daniel P. Berrangé
2021-06-12  5:28   ` Markus Armbruster
2021-06-15 23:16     ` Andrew Melnichenko
2021-07-05 13:50       ` Andrew Melnichenko
2021-06-09 10:04 ` [RFC PATCH 5/5] meson: libbpf dependency now exclusively for Linux Andrew Melnychenko
2021-06-10  6:41 ` [RFC PATCH 0/5] ebpf: Added ebpf helper for libvirtd Jason Wang
2021-06-10  6:55   ` Yuri Benditovich
2021-06-11  5:36     ` Jason Wang
2021-06-11 16:49       ` Andrew Melnichenko
2021-06-11 17:24         ` Daniel P. Berrangé
2021-06-15  9:13         ` Jason Wang
2021-06-15 22:18           ` Andrew Melnichenko
2021-06-18 20:03             ` Andrew Melnichenko
2021-06-21  9:20               ` Jason Wang
2021-06-22  3:29                 ` Yuri Benditovich
2021-06-22  4:58                   ` Jason Wang
2021-06-22  8:25                     ` Toke Høiland-Jørgensen
2021-06-22  8:27                       ` Daniel P. Berrangé
2021-06-22  9:09                         ` Toke Høiland-Jørgensen
2021-06-22 13:01                           ` Andrew Melnichenko
2021-06-22 13:17                             ` Toke Høiland-Jørgensen
2021-06-23  0:47                           ` Jason Wang
2021-06-28 11:18                             ` Yuri Benditovich
2021-06-29  3:39                               ` Jason Wang
2021-06-30 16:40                                 ` Andrew Melnichenko
2023-03-29 10:45 [RFC PATCH 0/4] eBPF RSS through QMP support Andrew Melnychenko
2023-03-29 10:45 ` [RFC PATCH 2/5] virtio-net: Added property to load eBPF RSS with fds Andrew Melnychenko
2023-03-29 10:45   ` Andrew Melnychenko
2023-03-30  0:15 [RFC PATCH 0/4] eBPF RSS through QMP support Andrew Melnychenko
2023-03-30  0:15 ` [RFC PATCH 2/5] virtio-net: Added property to load eBPF RSS with fds Andrew Melnychenko
2023-03-30  8:52   ` Daniel P. Berrangé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.