From: Andrew <andrew@daynix.com>
Added function that loads RSS eBPF program.
Added stub functions for RSS eBPF loader.
Added meson and configuration options.
By default, eBPF feature enabled if libbpf is present in the build system.
libbpf checked in configuration shell script and meson script.
Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
Signed-off-by: Andrew Melnychenko <andrew@daynix.com>
---
configure | 33 ++++
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 | 397 ++++++++++++++++++++++++++++++++++++++++
ebpf/trace-events | 4 +
ebpf/trace.h | 2 +
meson.build | 13 ++
9 files changed, 699 insertions(+)
create mode 100644 ebpf/ebpf_rss-stub.c
create mode 100644 ebpf/ebpf_rss.c
create mode 100644 ebpf/ebpf_rss.h
create mode 100644 ebpf/meson.build
create mode 100644 ebpf/rss.bpf.skeleton.h
create mode 100644 ebpf/trace-events
create mode 100644 ebpf/trace.h
diff --git a/configure b/configure
index 5860bdb77b..9d18e941f5 100755
--- a/configure
+++ b/configure
@@ -342,6 +342,7 @@ vhost_vsock="$default_feature"
vhost_user="no"
vhost_user_blk_server="auto"
vhost_user_fs="$default_feature"
+bpf=""
kvm="auto"
hax="auto"
hvf="auto"
@@ -1236,6 +1237,10 @@ for opt do
;;
--enable-membarrier) membarrier="yes"
;;
+ --disable-bpf) bpf="no"
+ ;;
+ --enable-bpf) bpf="yes"
+ ;;
--disable-blobs) blobs="false"
;;
--with-pkgversion=*) pkgversion="$optarg"
@@ -1845,6 +1850,7 @@ disabled with --disable-FEATURE, default is enabled if available
vhost-user vhost-user backend support
vhost-user-blk-server vhost-user-blk server support
vhost-vdpa vhost-vdpa kernel backend support
+ bpf BPF kernel support
spice spice
rbd rados block device (rbd)
libiscsi iscsi support
@@ -5057,6 +5063,30 @@ else
membarrier=no
fi
+##########################################
+# check for usable bpf system call
+if test "$bpf" = ""; then
+ have_bpf=no
+ if test "$linux" = "yes" -a "$bigendian" != "yes"; then
+ cat > $TMPC << EOF
+ #include <stdlib.h>
+ #include <bpf/libbpf.h>
+ int main(void) {
+ struct bpf_object *obj = NULL;
+ bpf_object__load(obj);
+ exit(0);
+ }
+EOF
+ if compile_prog "" "-lbpf" ; then
+ have_bpf=yes
+ bpf=yes
+ fi
+ fi
+ if test "$have_bpf" = "no"; then
+ feature_not_found "bpf" "the libbpf is not available"
+ fi
+fi
+
##########################################
# check if rtnetlink.h exists and is useful
have_rtnetlink=no
@@ -5905,6 +5935,9 @@ fi
if test "$membarrier" = "yes" ; then
echo "CONFIG_MEMBARRIER=y" >> $config_host_mak
fi
+if test "$bpf" = "yes" -a "$bigendian" != "yes" -a "$linux" = "yes" ; then
+ echo "CONFIG_EBPF=y" >> $config_host_mak
+fi
if test "$signalfd" = "yes" ; then
echo "CONFIG_SIGNALFD=y" >> $config_host_mak
fi
diff --git a/ebpf/ebpf_rss-stub.c b/ebpf/ebpf_rss-stub.c
new file mode 100644
index 0000000000..e71e229190
--- /dev/null
+++ b/ebpf/ebpf_rss-stub.c
@@ -0,0 +1,40 @@
+/*
+ * eBPF RSS stub file
+ *
+ * Developed by Daynix Computing LTD (http://www.daynix.com)
+ *
+ * Authors:
+ * Yuri Benditovich <yuri.benditovich@daynix.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2. See
+ * the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "ebpf/ebpf_rss.h"
+
+void ebpf_rss_init(struct EBPFRSSContext *ctx)
+{
+
+}
+
+bool ebpf_rss_is_loaded(struct EBPFRSSContext *ctx)
+{
+ return false;
+}
+
+bool ebpf_rss_load(struct EBPFRSSContext *ctx)
+{
+ return false;
+}
+
+bool ebpf_rss_set_all(struct EBPFRSSContext *ctx, struct EBPFRSSConfig *config,
+ uint16_t *indirections_table, uint8_t *toeplitz_key)
+{
+ return false;
+}
+
+void ebpf_rss_unload(struct EBPFRSSContext *ctx)
+{
+
+}
diff --git a/ebpf/ebpf_rss.c b/ebpf/ebpf_rss.c
new file mode 100644
index 0000000000..f7f7102da5
--- /dev/null
+++ b/ebpf/ebpf_rss.c
@@ -0,0 +1,165 @@
+/*
+ * eBPF RSS loader
+ *
+ * Developed by Daynix Computing LTD (http://www.daynix.com)
+ *
+ * Authors:
+ * Andrew Melnychenko <andrew@daynix.com>
+ * Yuri Benditovich <yuri.benditovich@daynix.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2. See
+ * the COPYING file in the top-level directory.
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/error-report.h"
+
+#include <bpf/libbpf.h>
+#include <bpf/bpf.h>
+
+#include "hw/virtio/virtio-net.h" /* VIRTIO_NET_RSS_MAX_TABLE_LEN */
+
+#include "ebpf/ebpf_rss.h"
+#include "ebpf/rss.bpf.skeleton.h"
+#include "trace.h"
+
+void ebpf_rss_init(struct EBPFRSSContext *ctx)
+{
+ if (ctx != NULL) {
+ ctx->obj = NULL;
+ }
+}
+
+bool ebpf_rss_is_loaded(struct EBPFRSSContext *ctx)
+{
+ return ctx != NULL && ctx->obj != NULL;
+}
+
+bool ebpf_rss_load(struct EBPFRSSContext *ctx)
+{
+ struct rss_bpf *rss_bpf_ctx;
+
+ if (ctx == NULL) {
+ return false;
+ }
+
+ rss_bpf_ctx = rss_bpf__open();
+ if (rss_bpf_ctx == NULL) {
+ trace_ebpf_error("eBPF RSS", "can not open eBPF RSS object");
+ goto l_issue;
+ }
+
+ bpf_program__set_socket_filter(rss_bpf_ctx->progs.tun_rss_steering_prog);
+
+ if (rss_bpf__load(rss_bpf_ctx)) {
+ trace_ebpf_error("eBPF RSS", "can not load RSS program");
+ goto l_issue;
+ }
+
+ ctx->obj = rss_bpf_ctx;
+ ctx->program_fd = bpf_program__fd(
+ rss_bpf_ctx->progs.tun_rss_steering_prog);
+ ctx->map_configuration = bpf_map__fd(
+ rss_bpf_ctx->maps.tap_rss_map_configurations);
+ ctx->map_indirections_table = bpf_map__fd(
+ rss_bpf_ctx->maps.tap_rss_map_indirection_table);
+ ctx->map_toeplitz_key = bpf_map__fd(
+ rss_bpf_ctx->maps.tap_rss_map_toeplitz_key);
+
+ return true;
+l_issue:
+ rss_bpf__destroy(rss_bpf_ctx);
+ ctx->obj = NULL;
+
+ return false;
+}
+
+static bool ebpf_rss_set_config(struct EBPFRSSContext *ctx,
+ struct EBPFRSSConfig *config)
+{
+ uint32_t map_key = 0;
+
+ if (!ebpf_rss_is_loaded(ctx)) {
+ return false;
+ }
+ if (bpf_map_update_elem(ctx->map_configuration,
+ &map_key, config, 0) < 0) {
+ return false;
+ }
+ return true;
+}
+
+static bool ebpf_rss_set_indirections_table(struct EBPFRSSContext *ctx,
+ uint16_t *indirections_table,
+ size_t len)
+{
+ uint32_t i = 0;
+
+ if (!ebpf_rss_is_loaded(ctx) || indirections_table == NULL ||
+ len > VIRTIO_NET_RSS_MAX_TABLE_LEN) {
+ return false;
+ }
+
+ for (; i < len; ++i) {
+ if (bpf_map_update_elem(ctx->map_indirections_table, &i,
+ indirections_table + i, 0) < 0) {
+ return false;
+ }
+ }
+ return true;
+}
+
+static bool ebpf_rss_set_toepliz_key(struct EBPFRSSContext *ctx,
+ uint8_t *toeplitz_key)
+{
+ uint32_t map_key = 0;
+
+ /* prepare toeplitz key */
+ uint8_t toe[VIRTIO_NET_RSS_MAX_KEY_SIZE] = {};
+
+ if (!ebpf_rss_is_loaded(ctx) || toeplitz_key == NULL) {
+ return false;
+ }
+ memcpy(toe, toeplitz_key, VIRTIO_NET_RSS_MAX_KEY_SIZE);
+ *(uint32_t *)toe = ntohl(*(uint32_t *)toe);
+
+ if (bpf_map_update_elem(ctx->map_toeplitz_key, &map_key, toe,
+ 0) < 0) {
+ return false;
+ }
+ return true;
+}
+
+bool ebpf_rss_set_all(struct EBPFRSSContext *ctx, struct EBPFRSSConfig *config,
+ uint16_t *indirections_table, uint8_t *toeplitz_key)
+{
+ if (!ebpf_rss_is_loaded(ctx) || config == NULL ||
+ indirections_table == NULL || toeplitz_key == NULL) {
+ return false;
+ }
+
+ if (!ebpf_rss_set_config(ctx, config)) {
+ return false;
+ }
+
+ if (!ebpf_rss_set_indirections_table(ctx, indirections_table,
+ config->indirections_len)) {
+ return false;
+ }
+
+ if (!ebpf_rss_set_toepliz_key(ctx, toeplitz_key)) {
+ return false;
+ }
+
+ return true;
+}
+
+void ebpf_rss_unload(struct EBPFRSSContext *ctx)
+{
+ if (!ebpf_rss_is_loaded(ctx)) {
+ return;
+ }
+
+ rss_bpf__destroy(ctx->obj);
+ ctx->obj = NULL;
+}
diff --git a/ebpf/ebpf_rss.h b/ebpf/ebpf_rss.h
new file mode 100644
index 0000000000..0fcb4e010f
--- /dev/null
+++ b/ebpf/ebpf_rss.h
@@ -0,0 +1,44 @@
+/*
+ * eBPF RSS header
+ *
+ * Developed by Daynix Computing LTD (http://www.daynix.com)
+ *
+ * Authors:
+ * Andrew Melnychenko <andrew@daynix.com>
+ * Yuri Benditovich <yuri.benditovich@daynix.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2. See
+ * the COPYING file in the top-level directory.
+ */
+
+#ifndef QEMU_EBPF_RSS_H
+#define QEMU_EBPF_RSS_H
+
+struct EBPFRSSContext {
+ void *obj;
+ int program_fd;
+ int map_configuration;
+ int map_toeplitz_key;
+ int map_indirections_table;
+};
+
+struct EBPFRSSConfig {
+ uint8_t redirect;
+ uint8_t populate_hash;
+ uint32_t hash_types;
+ uint16_t indirections_len;
+ uint16_t default_queue;
+};
+
+void ebpf_rss_init(struct EBPFRSSContext *ctx);
+
+bool ebpf_rss_is_loaded(struct EBPFRSSContext *ctx);
+
+bool ebpf_rss_load(struct EBPFRSSContext *ctx);
+
+bool ebpf_rss_set_all(struct EBPFRSSContext *ctx, struct EBPFRSSConfig *config,
+ uint16_t *indirections_table, uint8_t *toeplitz_key);
+
+void ebpf_rss_unload(struct EBPFRSSContext *ctx);
+
+#endif /* QEMU_EBPF_RSS_H */
diff --git a/ebpf/meson.build b/ebpf/meson.build
new file mode 100644
index 0000000000..f5bd5a0f01
--- /dev/null
+++ b/ebpf/meson.build
@@ -0,0 +1 @@
+common_ss.add(when: 'CONFIG_EBPF', if_true: files('ebpf_rss.c'), if_false: files('ebpf_rss-stub.c'))
diff --git a/ebpf/rss.bpf.skeleton.h b/ebpf/rss.bpf.skeleton.h
new file mode 100644
index 0000000000..76616a5ca6
--- /dev/null
+++ b/ebpf/rss.bpf.skeleton.h
@@ -0,0 +1,397 @@
+/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
+
+/* THIS FILE IS AUTOGENERATED! */
+#ifndef __RSS_BPF_SKEL_H__
+#define __RSS_BPF_SKEL_H__
+
+#include <stdlib.h>
+#include <bpf/libbpf.h>
+
+struct rss_bpf {
+ struct bpf_object_skeleton *skeleton;
+ struct bpf_object *obj;
+ struct {
+ struct bpf_map *tap_rss_map_configurations;
+ struct bpf_map *tap_rss_map_indirection_table;
+ struct bpf_map *tap_rss_map_toeplitz_key;
+ } maps;
+ struct {
+ struct bpf_program *tun_rss_steering_prog;
+ } progs;
+ struct {
+ struct bpf_link *tun_rss_steering_prog;
+ } links;
+};
+
+static void
+rss_bpf__destroy(struct rss_bpf *obj)
+{
+ if (!obj)
+ return;
+ if (obj->skeleton)
+ bpf_object__destroy_skeleton(obj->skeleton);
+ free(obj);
+}
+
+static inline int
+rss_bpf__create_skeleton(struct rss_bpf *obj);
+
+static inline struct rss_bpf *
+rss_bpf__open_opts(const struct bpf_object_open_opts *opts)
+{
+ struct rss_bpf *obj;
+
+ obj = (struct rss_bpf *)calloc(1, sizeof(*obj));
+ if (!obj)
+ return NULL;
+ if (rss_bpf__create_skeleton(obj))
+ goto err;
+ if (bpf_object__open_skeleton(obj->skeleton, opts))
+ goto err;
+
+ return obj;
+err:
+ rss_bpf__destroy(obj);
+ return NULL;
+}
+
+static inline struct rss_bpf *
+rss_bpf__open(void)
+{
+ return rss_bpf__open_opts(NULL);
+}
+
+static inline int
+rss_bpf__load(struct rss_bpf *obj)
+{
+ return bpf_object__load_skeleton(obj->skeleton);
+}
+
+static inline struct rss_bpf *
+rss_bpf__open_and_load(void)
+{
+ struct rss_bpf *obj;
+
+ obj = rss_bpf__open();
+ if (!obj)
+ return NULL;
+ if (rss_bpf__load(obj)) {
+ rss_bpf__destroy(obj);
+ return NULL;
+ }
+ return obj;
+}
+
+static inline int
+rss_bpf__attach(struct rss_bpf *obj)
+{
+ return bpf_object__attach_skeleton(obj->skeleton);
+}
+
+static inline void
+rss_bpf__detach(struct rss_bpf *obj)
+{
+ return bpf_object__detach_skeleton(obj->skeleton);
+}
+
+static inline int
+rss_bpf__create_skeleton(struct rss_bpf *obj)
+{
+ struct bpf_object_skeleton *s;
+
+ s = (struct bpf_object_skeleton *)calloc(1, sizeof(*s));
+ if (!s)
+ return -1;
+ obj->skeleton = s;
+
+ s->sz = sizeof(*s);
+ s->name = "rss_bpf";
+ s->obj = &obj->obj;
+
+ /* maps */
+ s->map_cnt = 3;
+ s->map_skel_sz = sizeof(*s->maps);
+ s->maps = (struct bpf_map_skeleton *)calloc(s->map_cnt, s->map_skel_sz);
+ if (!s->maps)
+ goto err;
+
+ s->maps[0].name = "tap_rss_map_configurations";
+ s->maps[0].map = &obj->maps.tap_rss_map_configurations;
+
+ s->maps[1].name = "tap_rss_map_indirection_table";
+ s->maps[1].map = &obj->maps.tap_rss_map_indirection_table;
+
+ s->maps[2].name = "tap_rss_map_toeplitz_key";
+ s->maps[2].map = &obj->maps.tap_rss_map_toeplitz_key;
+
+ /* programs */
+ s->prog_cnt = 1;
+ s->prog_skel_sz = sizeof(*s->progs);
+ s->progs = (struct bpf_prog_skeleton *)calloc(s->prog_cnt, s->prog_skel_sz);
+ if (!s->progs)
+ goto err;
+
+ s->progs[0].name = "tun_rss_steering_prog";
+ s->progs[0].prog = &obj->progs.tun_rss_steering_prog;
+ s->progs[0].link = &obj->links.tun_rss_steering_prog;
+
+ s->data_sz = 7088;
+ s->data = (void *)"\
+\x7f\x45\x4c\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x61\xa1\x60\xff\0\0\0\0\x63\x1a\xa4\xff\0\0\0\0\x69\xa1\x56\xff\0\0\0\0\x6b\
+\x1a\xa8\xff\0\0\0\0\x69\xa1\x58\xff\0\0\0\0\x6b\x1a\xaa\xff\0\0\0\0\x05\0\xf4\
+\0\0\0\0\0\x71\xa1\x51\xff\0\0\0\0\x15\x01\x5f\x01\0\0\0\0\x61\x71\x04\0\0\0\0\
+\0\x71\xa2\x53\xff\0\0\0\0\x15\x02\x3d\0\0\0\0\0\xbf\x12\0\0\0\0\0\0\x57\x02\0\
+\0\x10\0\0\0\x15\x02\x3a\0\0\0\0\0\xbf\xa2\0\0\0\0\0\0\x07\x02\0\0\x5c\xff\xff\
+\xff\x71\xa4\x54\xff\0\0\0\0\xbf\x23\0\0\0\0\0\0\x15\x04\x02\0\0\0\0\0\xbf\xa3\
+\0\0\0\0\0\0\x07\x03\0\0\x7c\xff\xff\xff\x67\x01\0\0\x38\0\0\0\xc7\x01\0\0\x38\
+\0\0\0\x65\x01\x01\0\xff\xff\xff\xff\xbf\x32\0\0\0\0\0\0\xbf\xa3\0\0\0\0\0\0\
+\x07\x03\0\0\x6c\xff\xff\xff\x71\xa5\x55\xff\0\0\0\0\xbf\x34\0\0\0\0\0\0\x15\
+\x05\x02\0\0\0\0\0\xbf\xa4\0\0\0\0\0\0\x07\x04\0\0\x8c\xff\xff\xff\x65\x01\x01\
+\0\xff\xff\xff\xff\xbf\x43\0\0\0\0\0\0\x61\x21\x04\0\0\0\0\0\x67\x01\0\0\x20\0\
+\0\0\x61\x24\0\0\0\0\0\0\x4f\x41\0\0\0\0\0\0\x7b\x1a\xa0\xff\0\0\0\0\x61\x21\
+\x08\0\0\0\0\0\x61\x22\x0c\0\0\0\0\0\x67\x02\0\0\x20\0\0\0\x4f\x12\0\0\0\0\0\0\
+\x7b\x2a\xa8\xff\0\0\0\0\x61\x31\0\0\0\0\0\0\x61\x32\x04\0\0\0\0\0\x61\x34\x08\
+\0\0\0\0\0\x61\x33\x0c\0\0\0\0\0\x69\xa5\x58\xff\0\0\0\0\x6b\x5a\xc2\xff\0\0\0\
+\0\x69\xa5\x56\xff\0\0\0\0\x6b\x5a\xc0\xff\0\0\0\0\x67\x03\0\0\x20\0\0\0\x4f\
+\x43\0\0\0\0\0\0\x7b\x3a\xb8\xff\0\0\0\0\x67\x02\0\0\x20\0\0\0\x4f\x12\0\0\0\0\
+\0\0\x7b\x2a\xb0\xff\0\0\0\0\x05\0\xbf\0\0\0\0\0\x71\xa2\x52\xff\0\0\0\0\x15\
+\x02\x04\0\0\0\0\0\xbf\x12\0\0\0\0\0\0\x57\x02\0\0\x04\0\0\0\x15\x02\x01\0\0\0\
+\0\0\x05\0\xbc\xff\0\0\0\0\x57\x01\0\0\x01\0\0\0\x15\x01\x24\x01\0\0\0\0\x61\
+\xa1\x5c\xff\0\0\0\0\x63\x1a\xa0\xff\0\0\0\0\x61\xa1\x60\xff\0\0\0\0\x63\x1a\
+\xa4\xff\0\0\0\0\x05\0\xb2\0\0\0\0\0\x71\xa2\x52\xff\0\0\0\0\x15\x02\x16\0\0\0\
+\0\0\xbf\x12\0\0\0\0\0\0\x57\x02\0\0\x20\0\0\0\x15\x02\x13\0\0\0\0\0\xbf\xa2\0\
+\0\0\0\0\0\x07\x02\0\0\x5c\xff\xff\xff\x71\xa4\x54\xff\0\0\0\0\xbf\x23\0\0\0\0\
+\0\0\x15\x04\x02\0\0\0\0\0\xbf\xa3\0\0\0\0\0\0\x07\x03\0\0\x7c\xff\xff\xff\x57\
+\x01\0\0\0\x01\0\0\x15\x01\x01\0\0\0\0\0\xbf\x32\0\0\0\0\0\0\xbf\xa3\0\0\0\0\0\
+\0\x07\x03\0\0\x6c\xff\xff\xff\x71\xa5\x55\xff\0\0\0\0\xbf\x34\0\0\0\0\0\0\x15\
+\x05\x02\0\0\0\0\0\xbf\xa4\0\0\0\0\0\0\x07\x04\0\0\x8c\xff\xff\xff\x15\x01\xc3\
+\xff\0\0\0\0\x05\0\xc1\xff\0\0\0\0\xbf\x12\0\0\0\0\0\0\x57\x02\0\0\x08\0\0\0\
+\x15\x02\x04\x01\0\0\0\0\xbf\xa2\0\0\0\0\0\0\x07\x02\0\0\x5c\xff\xff\xff\x71\
+\xa4\x54\xff\0\0\0\0\xbf\x23\0\0\0\0\0\0\x15\x04\x02\0\0\0\0\0\xbf\xa3\0\0\0\0\
+\0\0\x07\x03\0\0\x7c\xff\xff\xff\x57\x01\0\0\x40\0\0\0\x15\x01\x01\0\0\0\0\0\
+\xbf\x32\0\0\0\0\0\0\x61\x23\x04\0\0\0\0\0\x67\x03\0\0\x20\0\0\0\x61\x24\0\0\0\
+\0\0\0\x4f\x43\0\0\0\0\0\0\x7b\x3a\xa0\xff\0\0\0\0\x61\x23\x08\0\0\0\0\0\x61\
+\x22\x0c\0\0\0\0\0\x67\x02\0\0\x20\0\0\0\x4f\x32\0\0\0\0\0\0\x7b\x2a\xa8\xff\0\
+\0\0\0\x15\x01\x78\0\0\0\0\0\x71\xa1\x55\xff\0\0\0\0\x15\x01\x76\0\0\0\0\0\x61\
+\xa1\x98\xff\0\0\0\0\x67\x01\0\0\x20\0\0\0\x61\xa2\x94\xff\0\0\0\0\x4f\x21\0\0\
+\0\0\0\0\x7b\x1a\xb8\xff\0\0\0\0\x61\xa1\x90\xff\0\0\0\0\x67\x01\0\0\x20\0\0\0\
+\x61\xa2\x8c\xff\0\0\0\0\x05\0\x75\0\0\0\0\0\x15\x06\x54\xff\x87\0\0\0\x05\0\
+\x3e\0\0\0\0\0\x0f\x96\0\0\0\0\0\0\xbf\x62\0\0\0\0\0\0\x07\x02\0\0\x01\0\0\0\
+\x71\xa3\xff\xff\0\0\0\0\x67\x03\0\0\x03\0\0\0\x3d\x32\x22\0\0\0\0\0\x55\x01\
+\x0c\0\xc9\0\0\0\x79\xa1\x40\xff\0\0\0\0\x0f\x16\0\0\0\0\0\0\x07\x06\0\0\x02\0\
+\0\0\x79\xa1\x38\xff\0\0\0\0\xbf\x62\0\0\0\0\0\0\x79\xa3\x18\xff\0\0\0\0\xb7\
+\x04\0\0\x01\0\0\0\xb7\x05\0\0\x01\0\0\0\x85\0\0\0\x44\0\0\0\xb7\x01\0\0\x01\0\
+\0\0\x73\x1a\x54\xff\0\0\0\0\x05\0\x15\0\0\0\0\0\x07\x08\0\0\xff\xff\xff\xff\
+\xbf\x81\0\0\0\0\0\0\x67\x01\0\0\x20\0\0\0\x77\x01\0\0\x20\0\0\0\xbf\x69\0\0\0\
+\0\0\0\x15\x01\x0f\0\0\0\0\0\xbf\x92\0\0\0\0\0\0\x79\xa1\x40\xff\0\0\0\0\x0f\
+\x12\0\0\0\0\0\0\xbf\xa3\0\0\0\0\0\0\x07\x03\0\0\xf8\xff\xff\xff\xb7\x06\0\0\
+\x01\0\0\0\x79\xa1\x38\xff\0\0\0\0\xb7\x04\0\0\x02\0\0\0\xb7\x05\0\0\x01\0\0\0\
+\x85\0\0\0\x44\0\0\0\x71\xa1\xf8\xff\0\0\0\0\x15\x01\xdb\xff\0\0\0\0\x71\xa6\
+\xf9\xff\0\0\0\0\x07\x06\0\0\x02\0\0\0\x05\0\xd8\xff\0\0\0\0\x79\xa8\x30\xff\0\
+\0\0\0\x79\xa9\x28\xff\0\0\0\0\x71\xa1\xff\xff\0\0\0\0\x67\x01\0\0\x03\0\0\0\
+\x79\xa2\x40\xff\0\0\0\0\x0f\x12\0\0\0\0\0\0\x07\x02\0\0\x08\0\0\0\x7b\x2a\x40\
+\xff\0\0\0\0\x71\xa6\xfe\xff\0\0\0\0\x25\x06\x37\0\x3c\0\0\0\xb7\x01\0\0\x01\0\
+\0\0\x6f\x61\0\0\0\0\0\0\x18\x02\0\0\x01\0\0\0\0\0\0\0\0\x18\0\x1c\x5f\x21\0\0\
+\0\0\0\0\x55\x01\x01\0\0\0\0\0\x05\0\x30\0\0\0\0\0\x07\x07\0\0\x01\0\0\0\xbf\
+\x71\0\0\0\0\0\0\x67\x01\0\0\x20\0\0\0\x77\x01\0\0\x20\0\0\0\x55\x01\x02\0\x0b\
+\0\0\0\x79\xa7\x10\xff\0\0\0\0\x05\0\xda\xfe\0\0\0\0\xbf\xa3\0\0\0\0\0\0\x07\
+\x03\0\0\xfe\xff\xff\xff\x79\xa1\x38\xff\0\0\0\0\x79\xa2\x40\xff\0\0\0\0\xb7\
+\x04\0\0\x02\0\0\0\xb7\x05\0\0\x01\0\0\0\x85\0\0\0\x44\0\0\0\xbf\x61\0\0\0\0\0\
+\0\x15\x01\x1b\0\x3c\0\0\0\x55\x01\xe0\xff\x2b\0\0\0\xb7\x01\0\0\0\0\0\0\x63\
+\x1a\xf8\xff\0\0\0\0\xbf\xa3\0\0\0\0\0\0\x07\x03\0\0\xf8\xff\xff\xff\x79\xa6\
+\x38\xff\0\0\0\0\xbf\x61\0\0\0\0\0\0\x79\xa2\x40\xff\0\0\0\0\xb7\x04\0\0\x04\0\
+\0\0\xb7\x05\0\0\x01\0\0\0\x85\0\0\0\x44\0\0\0\x71\xa1\xfa\xff\0\0\0\0\x55\x01\
+\xd4\xff\x02\0\0\0\x71\xa1\xf9\xff\0\0\0\0\x55\x01\xd2\xff\x02\0\0\0\x71\xa1\
+\xfb\xff\0\0\0\0\x55\x01\xd0\xff\x01\0\0\0\x79\xa2\x40\xff\0\0\0\0\x07\x02\0\0\
+\x08\0\0\0\xbf\x61\0\0\0\0\0\0\x79\xa3\x20\xff\0\0\0\0\xb7\x04\0\0\x10\0\0\0\
+\xb7\x05\0\0\x01\0\0\0\x85\0\0\0\x44\0\0\0\xb7\x01\0\0\x01\0\0\0\x73\x1a\x55\
+\xff\0\0\0\0\x05\0\xc6\xff\0\0\0\0\xb7\x01\0\0\0\0\0\0\x6b\x1a\xf8\xff\0\0\0\0\
+\xb7\x09\0\0\x02\0\0\0\xb7\x08\0\0\x1e\0\0\0\x05\0\xb0\xff\0\0\0\0\x15\x06\xcf\
+\xff\x87\0\0\0\x05\0\xd3\xff\0\0\0\0\x61\xa1\x78\xff\0\0\0\0\x67\x01\0\0\x20\0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\0\x18\x01\0\0\0\0\x03\0\0\x11\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\0\0\0\0\x03\
+\0\x08\x11\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc1\0\0\0\0\0\x03\0\x10\x11\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\xba\0\0\0\0\0\x03\0\xf8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\x03\0\x03\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x6b\0\0\0\x11\0\x06\0\0\0\0\0\0\
+\0\0\0\x07\0\0\0\0\0\0\0\x25\0\0\0\x11\0\x05\0\0\0\0\0\0\0\0\0\x14\0\0\0\0\0\0\
+\0\x82\0\0\0\x11\0\x05\0\x28\0\0\0\0\0\0\0\x14\0\0\0\0\0\0\0\x01\0\0\0\x11\0\
+\x05\0\x14\0\0\0\0\0\0\0\x14\0\0\0\0\0\0\0\x40\0\0\0\x12\0\x03\0\0\0\0\0\0\0\0\
+\0\x20\x11\0\0\0\0\0\0\x28\0\0\0\0\0\0\0\x01\0\0\0\x31\0\0\0\x50\0\0\0\0\0\0\0\
+\x01\0\0\0\x33\0\0\0\xe0\x10\0\0\0\0\0\0\x01\0\0\0\x32\0\0\0\x1c\0\0\0\0\0\0\0\
+\x01\0\0\0\x2f\0\0\0\0\x74\x61\x70\x5f\x72\x73\x73\x5f\x6d\x61\x70\x5f\x74\x6f\
+\x65\x70\x6c\x69\x74\x7a\x5f\x6b\x65\x79\0\x2e\x74\x65\x78\x74\0\x6d\x61\x70\
+\x73\0\x74\x61\x70\x5f\x72\x73\x73\x5f\x6d\x61\x70\x5f\x63\x6f\x6e\x66\x69\x67\
+\x75\x72\x61\x74\x69\x6f\x6e\x73\0\x74\x75\x6e\x5f\x72\x73\x73\x5f\x73\x74\x65\
+\x65\x72\x69\x6e\x67\x5f\x70\x72\x6f\x67\0\x2e\x72\x65\x6c\x74\x75\x6e\x5f\x72\
+\x73\x73\x5f\x73\x74\x65\x65\x72\x69\x6e\x67\0\x5f\x6c\x69\x63\x65\x6e\x73\x65\
+\0\x2e\x72\x65\x6c\x2e\x65\x68\x5f\x66\x72\x61\x6d\x65\0\x74\x61\x70\x5f\x72\
+\x73\x73\x5f\x6d\x61\x70\x5f\x69\x6e\x64\x69\x72\x65\x63\x74\x69\x6f\x6e\x5f\
+\x74\x61\x62\x6c\x65\0\x72\x73\x73\x2e\x62\x70\x66\x2e\x63\0\x2e\x73\x74\x72\
+\x74\x61\x62\0\x2e\x73\x79\x6d\x74\x61\x62\0\x4c\x42\x42\x30\x5f\x39\0\x4c\x42\
+\x42\x30\x5f\x38\x39\0\x4c\x42\x42\x30\x5f\x37\x39\0\x4c\x42\x42\x30\x5f\x36\
+\x39\0\x4c\x42\x42\x30\x5f\x35\x39\0\x4c\x42\x42\x30\x5f\x34\x39\0\x4c\x42\x42\
+\x30\x5f\x33\x39\0\x4c\x42\x42\x30\x5f\x32\x39\0\x4c\x42\x42\x30\x5f\x38\0\x4c\
+\x42\x42\x30\x5f\x38\x38\0\x4c\x42\x42\x30\x5f\x35\x38\0\x4c\x42\x42\x30\x5f\
+\x33\x38\0\x4c\x42\x42\x30\x5f\x38\x37\0\x4c\x42\x42\x30\x5f\x36\x37\0\x4c\x42\
+\x42\x30\x5f\x34\x37\0\x4c\x42\x42\x30\x5f\x37\x36\0\x4c\x42\x42\x30\x5f\x35\
+\x36\0\x4c\x42\x42\x30\x5f\x32\x36\0\x4c\x42\x42\x30\x5f\x31\x36\0\x4c\x42\x42\
+\x30\x5f\x38\x35\0\x4c\x42\x42\x30\x5f\x36\x35\0\x4c\x42\x42\x30\x5f\x33\x35\0\
+\x4c\x42\x42\x30\x5f\x31\x35\0\x4c\x42\x42\x30\x5f\x34\0\x4c\x42\x42\x30\x5f\
+\x38\x34\0\x4c\x42\x42\x30\x5f\x37\x34\0\x4c\x42\x42\x30\x5f\x35\x34\0\x4c\x42\
+\x42\x30\x5f\x34\x34\0\x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\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd0\x16\0\0\0\0\0\0\x30\0\
+\0\0\0\0\0\0\x09\0\0\0\x03\0\0\0\x08\0\0\0\0\0\0\0\x10\0\0\0\0\0\0\0\x20\0\0\0\
+\x01\0\0\0\x03\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x60\x11\0\0\0\0\0\0\x3c\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\0\0\x04\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x6c\0\0\0\x01\0\0\0\x03\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x9c\x11\0\0\0\0\0\0\x07\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x78\0\0\0\x01\0\0\0\x02\0\0\0\0\0\0\0\
+\0\0\0\0\0\0\0\0\xa8\x11\0\0\0\0\0\0\x30\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x08\0\0\
+\0\0\0\0\0\0\0\0\0\0\0\0\0\x74\0\0\0\x09\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
+\0\x17\0\0\0\0\0\0\x10\0\0\0\0\0\0\0\x09\0\0\0\x07\0\0\0\x08\0\0\0\0\0\0\0\x10\
+\0\0\0\0\0\0\0\xb2\0\0\0\x02\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd8\x11\0\0\
+\0\0\0\0\xf8\x04\0\0\0\0\0\0\x01\0\0\0\x30\0\0\0\x08\0\0\0\0\0\0\0\x18\0\0\0\0\
+\0\0\0";
+
+ return 0;
+err:
+ bpf_object__destroy_skeleton(s);
+ return -1;
+}
+
+#endif /* __RSS_BPF_SKEL_H__ */
diff --git a/ebpf/trace-events b/ebpf/trace-events
new file mode 100644
index 0000000000..411b1e2be3
--- /dev/null
+++ b/ebpf/trace-events
@@ -0,0 +1,4 @@
+# See docs/devel/tracing.txt for syntax documentation.
+
+# ebpf-rss.c
+ebpf_error(const char *s1, const char *s2) "error in %s: %s"
diff --git a/ebpf/trace.h b/ebpf/trace.h
new file mode 100644
index 0000000000..ad570e6691
--- /dev/null
+++ b/ebpf/trace.h
@@ -0,0 +1,2 @@
+#include "trace/trace-ebpf.h"
+
diff --git a/meson.build b/meson.build
index 563688d682..27e41690e7 100644
--- a/meson.build
+++ b/meson.build
@@ -968,6 +968,13 @@ if not get_option('fuse_lseek').disabled()
endif
endif
+# libbpf
+libbpf = not_found
+if 'CONFIG_EBPF' in config_host
+ libbpf = cc.find_library('bpf', required: true)
+
+endif
+
if get_option('cfi')
cfi_flags=[]
# Check for dependency on LTO
@@ -1685,6 +1692,7 @@ if have_system
'backends',
'backends/tpm',
'chardev',
+ 'ebpf',
'hw/9pfs',
'hw/acpi',
'hw/alpha',
@@ -1850,6 +1858,9 @@ subdir('accel')
subdir('plugins')
subdir('bsd-user')
subdir('linux-user')
+subdir('ebpf')
+
+common_ss.add(libbpf)
bsd_user_ss.add(files('gdbstub.c'))
specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)
@@ -2415,6 +2426,7 @@ summary_info += {'vhost-user support': config_host.has_key('CONFIG_VHOST_USER')}
summary_info += {'vhost-user-blk server support': have_vhost_user_blk_server}
summary_info += {'vhost-user-fs support': config_host.has_key('CONFIG_VHOST_USER_FS')}
summary_info += {'vhost-vdpa support': config_host.has_key('CONFIG_VHOST_VDPA')}
+summary_info += {'bpf support': config_host.has_key('CONFIG_EBPF')}
summary_info += {'Trace backends': config_host['TRACE_BACKENDS']}
if config_host['TRACE_BACKENDS'].split().contains('simple')
summary_info += {'Trace output file': config_host['CONFIG_TRACE_FILE'] + '-<pid>'}
@@ -2516,3 +2528,4 @@ if not supported_oses.contains(targetos)
message('if you care about QEMU on this platform you should contact')
message('us upstream at qemu-devel@nongnu.org.')
endif
+
--
2.30.0
On 2021/1/15 上午5:16, Andrew Melnychenko wrote: > From: Andrew <andrew@daynix.com> > > Added function that loads RSS eBPF program. > Added stub functions for RSS eBPF loader. > Added meson and configuration options. > > By default, eBPF feature enabled if libbpf is present in the build system. > libbpf checked in configuration shell script and meson script. > > Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> > Signed-off-by: Andrew Melnychenko <andrew@daynix.com> > --- > configure | 33 ++++ > 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 | 397 ++++++++++++++++++++++++++++++++++++++++ > ebpf/trace-events | 4 + > ebpf/trace.h | 2 + > meson.build | 13 ++ > 9 files changed, 699 insertions(+) > create mode 100644 ebpf/ebpf_rss-stub.c > create mode 100644 ebpf/ebpf_rss.c > create mode 100644 ebpf/ebpf_rss.h > create mode 100644 ebpf/meson.build > create mode 100644 ebpf/rss.bpf.skeleton.h > create mode 100644 ebpf/trace-events > create mode 100644 ebpf/trace.h > > diff --git a/configure b/configure > index 5860bdb77b..9d18e941f5 100755 > --- a/configure > +++ b/configure > @@ -342,6 +342,7 @@ vhost_vsock="$default_feature" > vhost_user="no" > vhost_user_blk_server="auto" > vhost_user_fs="$default_feature" > +bpf="" > kvm="auto" > hax="auto" > hvf="auto" > @@ -1236,6 +1237,10 @@ for opt do > ;; > --enable-membarrier) membarrier="yes" > ;; > + --disable-bpf) bpf="no" > + ;; > + --enable-bpf) bpf="yes" > + ;; > --disable-blobs) blobs="false" > ;; > --with-pkgversion=*) pkgversion="$optarg" > @@ -1845,6 +1850,7 @@ disabled with --disable-FEATURE, default is enabled if available > vhost-user vhost-user backend support > vhost-user-blk-server vhost-user-blk server support > vhost-vdpa vhost-vdpa kernel backend support > + bpf BPF kernel support > spice spice > rbd rados block device (rbd) > libiscsi iscsi support > @@ -5057,6 +5063,30 @@ else > membarrier=no > fi > > +########################################## > +# check for usable bpf system call > +if test "$bpf" = ""; then This implies the bpf is enabled by default? > + have_bpf=no > + if test "$linux" = "yes" -a "$bigendian" != "yes"; then > + cat > $TMPC << EOF > + #include <stdlib.h> > + #include <bpf/libbpf.h> > + int main(void) { > + struct bpf_object *obj = NULL; > + bpf_object__load(obj); > + exit(0); > + } > +EOF > + if compile_prog "" "-lbpf" ; then > + have_bpf=yes > + bpf=yes > + fi > + fi > + if test "$have_bpf" = "no"; then > + feature_not_found "bpf" "the libbpf is not available" > + fi > +fi > + > ########################################## > # check if rtnetlink.h exists and is useful > have_rtnetlink=no > @@ -5905,6 +5935,9 @@ fi > if test "$membarrier" = "yes" ; then > echo "CONFIG_MEMBARRIER=y" >> $config_host_mak > fi > +if test "$bpf" = "yes" -a "$bigendian" != "yes" -a "$linux" = "yes" ; then > + echo "CONFIG_EBPF=y" >> $config_host_mak > +fi > if test "$signalfd" = "yes" ; then > echo "CONFIG_SIGNALFD=y" >> $config_host_mak > fi > diff --git a/ebpf/ebpf_rss-stub.c b/ebpf/ebpf_rss-stub.c > new file mode 100644 > index 0000000000..e71e229190 > --- /dev/null > +++ b/ebpf/ebpf_rss-stub.c > @@ -0,0 +1,40 @@ > +/* > + * eBPF RSS stub file > + * > + * Developed by Daynix Computing LTD (http://www.daynix.com) > + * > + * Authors: > + * Yuri Benditovich <yuri.benditovich@daynix.com> > + * > + * This work is licensed under the terms of the GNU GPL, version 2. See > + * the COPYING file in the top-level directory. > + */ > + > +#include "qemu/osdep.h" > +#include "ebpf/ebpf_rss.h" I wonder why not simply use #ifdef #else to exclude the rss functions. If I read code correctly, this stub requires rss_is_loaded called before ebpf_rss_set_all(), so actually ebpf_rss_is_loaded serve the same as > + > +void ebpf_rss_init(struct EBPFRSSContext *ctx) > +{ > + > +} > + > +bool ebpf_rss_is_loaded(struct EBPFRSSContext *ctx) > +{ > + return false; > +} > + > +bool ebpf_rss_load(struct EBPFRSSContext *ctx) > +{ > + return false; > +} > + > +bool ebpf_rss_set_all(struct EBPFRSSContext *ctx, struct EBPFRSSConfig *config, > + uint16_t *indirections_table, uint8_t *toeplitz_key) > +{ > + return false; > +} > + > +void ebpf_rss_unload(struct EBPFRSSContext *ctx) > +{ > + > +} > diff --git a/ebpf/ebpf_rss.c b/ebpf/ebpf_rss.c > new file mode 100644 > index 0000000000..f7f7102da5 > --- /dev/null > +++ b/ebpf/ebpf_rss.c > @@ -0,0 +1,165 @@ > +/* > + * eBPF RSS loader > + * > + * Developed by Daynix Computing LTD (http://www.daynix.com) > + * > + * Authors: > + * Andrew Melnychenko <andrew@daynix.com> > + * Yuri Benditovich <yuri.benditovich@daynix.com> > + * > + * This work is licensed under the terms of the GNU GPL, version 2. See > + * the COPYING file in the top-level directory. > + */ > + > +#include "qemu/osdep.h" > +#include "qemu/error-report.h" > + > +#include <bpf/libbpf.h> > +#include <bpf/bpf.h> > + > +#include "hw/virtio/virtio-net.h" /* VIRTIO_NET_RSS_MAX_TABLE_LEN */ > + > +#include "ebpf/ebpf_rss.h" > +#include "ebpf/rss.bpf.skeleton.h" > +#include "trace.h" > + > +void ebpf_rss_init(struct EBPFRSSContext *ctx) > +{ > + if (ctx != NULL) { > + ctx->obj = NULL; > + } > +} > + > +bool ebpf_rss_is_loaded(struct EBPFRSSContext *ctx) > +{ > + return ctx != NULL && ctx->obj != NULL; > +} > + > +bool ebpf_rss_load(struct EBPFRSSContext *ctx) > +{ > + struct rss_bpf *rss_bpf_ctx; > + > + if (ctx == NULL) { > + return false; > + } > + > + rss_bpf_ctx = rss_bpf__open(); > + if (rss_bpf_ctx == NULL) { > + trace_ebpf_error("eBPF RSS", "can not open eBPF RSS object"); > + goto l_issue; Nit: it's not easy to infer what did "l" mean, it's probably better to use "error". Thanks
On Fri, Jan 15, 2021 at 9:02 AM Jason Wang <jasowang@redhat.com> wrote: > > > On 2021/1/15 上午5:16, Andrew Melnychenko wrote: > > From: Andrew <andrew@daynix.com> > > > > Added function that loads RSS eBPF program. > > Added stub functions for RSS eBPF loader. > > Added meson and configuration options. > > > > By default, eBPF feature enabled if libbpf is present in the build system. > > libbpf checked in configuration shell script and meson script. > > > > Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> > > Signed-off-by: Andrew Melnychenko <andrew@daynix.com> > > --- > > configure | 33 ++++ > > 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 | 397 ++++++++++++++++++++++++++++++++++++++++ > > ebpf/trace-events | 4 + > > ebpf/trace.h | 2 + > > meson.build | 13 ++ > > 9 files changed, 699 insertions(+) > > create mode 100644 ebpf/ebpf_rss-stub.c > > create mode 100644 ebpf/ebpf_rss.c > > create mode 100644 ebpf/ebpf_rss.h > > create mode 100644 ebpf/meson.build > > create mode 100644 ebpf/rss.bpf.skeleton.h > > create mode 100644 ebpf/trace-events > > create mode 100644 ebpf/trace.h > > > > diff --git a/configure b/configure > > index 5860bdb77b..9d18e941f5 100755 > > --- a/configure > > +++ b/configure > > @@ -342,6 +342,7 @@ vhost_vsock="$default_feature" > > vhost_user="no" > > vhost_user_blk_server="auto" > > vhost_user_fs="$default_feature" > > +bpf="" > > kvm="auto" > > hax="auto" > > hvf="auto" > > @@ -1236,6 +1237,10 @@ for opt do > > ;; > > --enable-membarrier) membarrier="yes" > > ;; > > + --disable-bpf) bpf="no" > > + ;; > > + --enable-bpf) bpf="yes" > > + ;; > > --disable-blobs) blobs="false" > > ;; > > --with-pkgversion=*) pkgversion="$optarg" > > @@ -1845,6 +1850,7 @@ disabled with --disable-FEATURE, default is enabled if available > > vhost-user vhost-user backend support > > vhost-user-blk-server vhost-user-blk server support > > vhost-vdpa vhost-vdpa kernel backend support > > + bpf BPF kernel support > > spice spice > > rbd rados block device (rbd) > > libiscsi iscsi support > > @@ -5057,6 +5063,30 @@ else > > membarrier=no > > fi > > > > +########################################## > > +# check for usable bpf system call > > +if test "$bpf" = ""; then > > > This implies the bpf is enabled by default? Yes, assuming libbpf-devel present and bpf system call defined. Any problem with it? > > > > + have_bpf=no > > + if test "$linux" = "yes" -a "$bigendian" != "yes"; then > > + cat > $TMPC << EOF > > + #include <stdlib.h> > > + #include <bpf/libbpf.h> > > + int main(void) { > > + struct bpf_object *obj = NULL; > > + bpf_object__load(obj); > > + exit(0); > > + } > > +EOF > > + if compile_prog "" "-lbpf" ; then > > + have_bpf=yes > > + bpf=yes > > + fi > > + fi > > + if test "$have_bpf" = "no"; then > > + feature_not_found "bpf" "the libbpf is not available" > > + fi > > +fi > > + > > ########################################## > > # check if rtnetlink.h exists and is useful > > have_rtnetlink=no > > @@ -5905,6 +5935,9 @@ fi > > if test "$membarrier" = "yes" ; then > > echo "CONFIG_MEMBARRIER=y" >> $config_host_mak > > fi > > +if test "$bpf" = "yes" -a "$bigendian" != "yes" -a "$linux" = "yes" ; then > > + echo "CONFIG_EBPF=y" >> $config_host_mak > > +fi > > if test "$signalfd" = "yes" ; then > > echo "CONFIG_SIGNALFD=y" >> $config_host_mak > > fi > > diff --git a/ebpf/ebpf_rss-stub.c b/ebpf/ebpf_rss-stub.c > > new file mode 100644 > > index 0000000000..e71e229190 > > --- /dev/null > > +++ b/ebpf/ebpf_rss-stub.c > > @@ -0,0 +1,40 @@ > > +/* > > + * eBPF RSS stub file > > + * > > + * Developed by Daynix Computing LTD (http://www.daynix.com) > > + * > > + * Authors: > > + * Yuri Benditovich <yuri.benditovich@daynix.com> > > + * > > + * This work is licensed under the terms of the GNU GPL, version 2. See > > + * the COPYING file in the top-level directory. > > + */ > > + > > +#include "qemu/osdep.h" > > +#include "ebpf/ebpf_rss.h" > > > I wonder why not simply use #ifdef #else to exclude the rss functions. Just to make the reading easier. > > If I read code correctly, this stub requires rss_is_loaded called before > ebpf_rss_set_all(), so actually ebpf_rss_is_loaded serve the same as Can you please get into details? I think the stub does not require it, it just converts all the ebpf_rss calls to nop at link time. If I miss something please let us know, we'll fix it in v4. > > > > + > > +void ebpf_rss_init(struct EBPFRSSContext *ctx) > > +{ > > + > > +} > > + > > +bool ebpf_rss_is_loaded(struct EBPFRSSContext *ctx) > > +{ > > + return false; > > +} > > + > > +bool ebpf_rss_load(struct EBPFRSSContext *ctx) > > +{ > > + return false; > > +} > > + > > +bool ebpf_rss_set_all(struct EBPFRSSContext *ctx, struct EBPFRSSConfig *config, > > + uint16_t *indirections_table, uint8_t *toeplitz_key) > > +{ > > + return false; > > +} > > + > > +void ebpf_rss_unload(struct EBPFRSSContext *ctx) > > +{ > > + > > +} > > diff --git a/ebpf/ebpf_rss.c b/ebpf/ebpf_rss.c > > new file mode 100644 > > index 0000000000..f7f7102da5 > > --- /dev/null > > +++ b/ebpf/ebpf_rss.c > > @@ -0,0 +1,165 @@ > > +/* > > + * eBPF RSS loader > > + * > > + * Developed by Daynix Computing LTD (http://www.daynix.com) > > + * > > + * Authors: > > + * Andrew Melnychenko <andrew@daynix.com> > > + * Yuri Benditovich <yuri.benditovich@daynix.com> > > + * > > + * This work is licensed under the terms of the GNU GPL, version 2. See > > + * the COPYING file in the top-level directory. > > + */ > > + > > +#include "qemu/osdep.h" > > +#include "qemu/error-report.h" > > + > > +#include <bpf/libbpf.h> > > +#include <bpf/bpf.h> > > + > > +#include "hw/virtio/virtio-net.h" /* VIRTIO_NET_RSS_MAX_TABLE_LEN */ > > + > > +#include "ebpf/ebpf_rss.h" > > +#include "ebpf/rss.bpf.skeleton.h" > > +#include "trace.h" > > + > > +void ebpf_rss_init(struct EBPFRSSContext *ctx) > > +{ > > + if (ctx != NULL) { > > + ctx->obj = NULL; > > + } > > +} > > + > > +bool ebpf_rss_is_loaded(struct EBPFRSSContext *ctx) > > +{ > > + return ctx != NULL && ctx->obj != NULL; > > +} > > + > > +bool ebpf_rss_load(struct EBPFRSSContext *ctx) > > +{ > > + struct rss_bpf *rss_bpf_ctx; > > + > > + if (ctx == NULL) { > > + return false; > > + } > > + > > + rss_bpf_ctx = rss_bpf__open(); > > + if (rss_bpf_ctx == NULL) { > > + trace_ebpf_error("eBPF RSS", "can not open eBPF RSS object"); > > + goto l_issue; > > > Nit: it's not easy to infer what did "l" mean, it's probably better to > use "error". ok, will be renamed, 'l' means 'load' probably > > Thanks >
On 2021/1/19 下午10:53, Yuri Benditovich wrote: > On Fri, Jan 15, 2021 at 9:02 AM Jason Wang <jasowang@redhat.com> wrote: >> >> On 2021/1/15 上午5:16, Andrew Melnychenko wrote: >>> From: Andrew <andrew@daynix.com> >>> >>> Added function that loads RSS eBPF program. >>> Added stub functions for RSS eBPF loader. >>> Added meson and configuration options. >>> >>> By default, eBPF feature enabled if libbpf is present in the build system. >>> libbpf checked in configuration shell script and meson script. >>> >>> Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> >>> Signed-off-by: Andrew Melnychenko <andrew@daynix.com> >>> --- >>> configure | 33 ++++ >>> 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 | 397 ++++++++++++++++++++++++++++++++++++++++ >>> ebpf/trace-events | 4 + >>> ebpf/trace.h | 2 + >>> meson.build | 13 ++ >>> 9 files changed, 699 insertions(+) >>> create mode 100644 ebpf/ebpf_rss-stub.c >>> create mode 100644 ebpf/ebpf_rss.c >>> create mode 100644 ebpf/ebpf_rss.h >>> create mode 100644 ebpf/meson.build >>> create mode 100644 ebpf/rss.bpf.skeleton.h >>> create mode 100644 ebpf/trace-events >>> create mode 100644 ebpf/trace.h >>> >>> diff --git a/configure b/configure >>> index 5860bdb77b..9d18e941f5 100755 >>> --- a/configure >>> +++ b/configure >>> @@ -342,6 +342,7 @@ vhost_vsock="$default_feature" >>> vhost_user="no" >>> vhost_user_blk_server="auto" >>> vhost_user_fs="$default_feature" >>> +bpf="" >>> kvm="auto" >>> hax="auto" >>> hvf="auto" >>> @@ -1236,6 +1237,10 @@ for opt do >>> ;; >>> --enable-membarrier) membarrier="yes" >>> ;; >>> + --disable-bpf) bpf="no" >>> + ;; >>> + --enable-bpf) bpf="yes" >>> + ;; >>> --disable-blobs) blobs="false" >>> ;; >>> --with-pkgversion=*) pkgversion="$optarg" >>> @@ -1845,6 +1850,7 @@ disabled with --disable-FEATURE, default is enabled if available >>> vhost-user vhost-user backend support >>> vhost-user-blk-server vhost-user-blk server support >>> vhost-vdpa vhost-vdpa kernel backend support >>> + bpf BPF kernel support >>> spice spice >>> rbd rados block device (rbd) >>> libiscsi iscsi support >>> @@ -5057,6 +5063,30 @@ else >>> membarrier=no >>> fi >>> >>> +########################################## >>> +# check for usable bpf system call >>> +if test "$bpf" = ""; then >> >> This implies the bpf is enabled by default? > Yes, assuming libbpf-devel present and bpf system call defined. > > Any problem with it? It means the configure will fail if libbpf is not installed. Consider libbpf is not very common at current stage. I think it's better to make it auto or disabled by default. > >> >>> + have_bpf=no >>> + if test "$linux" = "yes" -a "$bigendian" != "yes"; then >>> + cat > $TMPC << EOF >>> + #include <stdlib.h> >>> + #include <bpf/libbpf.h> >>> + int main(void) { >>> + struct bpf_object *obj = NULL; >>> + bpf_object__load(obj); >>> + exit(0); >>> + } >>> +EOF >>> + if compile_prog "" "-lbpf" ; then >>> + have_bpf=yes >>> + bpf=yes >>> + fi >>> + fi >>> + if test "$have_bpf" = "no"; then >>> + feature_not_found "bpf" "the libbpf is not available" >>> + fi >>> +fi >>> + >>> ########################################## >>> # check if rtnetlink.h exists and is useful >>> have_rtnetlink=no >>> @@ -5905,6 +5935,9 @@ fi >>> if test "$membarrier" = "yes" ; then >>> echo "CONFIG_MEMBARRIER=y" >> $config_host_mak >>> fi >>> +if test "$bpf" = "yes" -a "$bigendian" != "yes" -a "$linux" = "yes" ; then >>> + echo "CONFIG_EBPF=y" >> $config_host_mak >>> +fi >>> if test "$signalfd" = "yes" ; then >>> echo "CONFIG_SIGNALFD=y" >> $config_host_mak >>> fi >>> diff --git a/ebpf/ebpf_rss-stub.c b/ebpf/ebpf_rss-stub.c >>> new file mode 100644 >>> index 0000000000..e71e229190 >>> --- /dev/null >>> +++ b/ebpf/ebpf_rss-stub.c >>> @@ -0,0 +1,40 @@ >>> +/* >>> + * eBPF RSS stub file >>> + * >>> + * Developed by Daynix Computing LTD (http://www.daynix.com) >>> + * >>> + * Authors: >>> + * Yuri Benditovich <yuri.benditovich@daynix.com> >>> + * >>> + * This work is licensed under the terms of the GNU GPL, version 2. See >>> + * the COPYING file in the top-level directory. >>> + */ >>> + >>> +#include "qemu/osdep.h" >>> +#include "ebpf/ebpf_rss.h" >> >> I wonder why not simply use #ifdef #else to exclude the rss functions. > Just to make the reading easier. > >> If I read code correctly, this stub requires rss_is_loaded called before >> ebpf_rss_set_all(), so actually ebpf_rss_is_loaded serve the same as > Can you please get into details? > I think the stub does not require it, it just converts all the > ebpf_rss calls to nop at link time. > If I miss something please let us know, we'll fix it in v4. I mean the current can not be used without checking rss_is_loaded(). So rss_is_loaded() is somehow a guard like macro. I personally prefer #ifdef but it's not a must. Thanks
On Mon, Jan 25, 2021 at 11:03 AM Jason Wang <jasowang@redhat.com> wrote: > > > On 2021/1/19 下午10:53, Yuri Benditovich wrote: > > On Fri, Jan 15, 2021 at 9:02 AM Jason Wang <jasowang@redhat.com> wrote: > >> > >> On 2021/1/15 上午5:16, Andrew Melnychenko wrote: > >>> From: Andrew <andrew@daynix.com> > >>> > >>> Added function that loads RSS eBPF program. > >>> Added stub functions for RSS eBPF loader. > >>> Added meson and configuration options. > >>> > >>> By default, eBPF feature enabled if libbpf is present in the build system. > >>> libbpf checked in configuration shell script and meson script. > >>> > >>> Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> > >>> Signed-off-by: Andrew Melnychenko <andrew@daynix.com> > >>> --- > >>> configure | 33 ++++ > >>> 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 | 397 ++++++++++++++++++++++++++++++++++++++++ > >>> ebpf/trace-events | 4 + > >>> ebpf/trace.h | 2 + > >>> meson.build | 13 ++ > >>> 9 files changed, 699 insertions(+) > >>> create mode 100644 ebpf/ebpf_rss-stub.c > >>> create mode 100644 ebpf/ebpf_rss.c > >>> create mode 100644 ebpf/ebpf_rss.h > >>> create mode 100644 ebpf/meson.build > >>> create mode 100644 ebpf/rss.bpf.skeleton.h > >>> create mode 100644 ebpf/trace-events > >>> create mode 100644 ebpf/trace.h > >>> > >>> diff --git a/configure b/configure > >>> index 5860bdb77b..9d18e941f5 100755 > >>> --- a/configure > >>> +++ b/configure > >>> @@ -342,6 +342,7 @@ vhost_vsock="$default_feature" > >>> vhost_user="no" > >>> vhost_user_blk_server="auto" > >>> vhost_user_fs="$default_feature" > >>> +bpf="" > >>> kvm="auto" > >>> hax="auto" > >>> hvf="auto" > >>> @@ -1236,6 +1237,10 @@ for opt do > >>> ;; > >>> --enable-membarrier) membarrier="yes" > >>> ;; > >>> + --disable-bpf) bpf="no" > >>> + ;; > >>> + --enable-bpf) bpf="yes" > >>> + ;; > >>> --disable-blobs) blobs="false" > >>> ;; > >>> --with-pkgversion=*) pkgversion="$optarg" > >>> @@ -1845,6 +1850,7 @@ disabled with --disable-FEATURE, default is enabled if available > >>> vhost-user vhost-user backend support > >>> vhost-user-blk-server vhost-user-blk server support > >>> vhost-vdpa vhost-vdpa kernel backend support > >>> + bpf BPF kernel support > >>> spice spice > >>> rbd rados block device (rbd) > >>> libiscsi iscsi support > >>> @@ -5057,6 +5063,30 @@ else > >>> membarrier=no > >>> fi > >>> > >>> +########################################## > >>> +# check for usable bpf system call > >>> +if test "$bpf" = ""; then > >> > >> This implies the bpf is enabled by default? > > Yes, assuming libbpf-devel present and bpf system call defined. > > > > Any problem with it? > > > It means the configure will fail if libbpf is not installed. Consider > libbpf is not very common at current stage. I think it's better to make > it auto or disabled by default. > > > > > >> > >>> + have_bpf=no > >>> + if test "$linux" = "yes" -a "$bigendian" != "yes"; then > >>> + cat > $TMPC << EOF > >>> + #include <stdlib.h> > >>> + #include <bpf/libbpf.h> > >>> + int main(void) { > >>> + struct bpf_object *obj = NULL; > >>> + bpf_object__load(obj); > >>> + exit(0); > >>> + } > >>> +EOF > >>> + if compile_prog "" "-lbpf" ; then > >>> + have_bpf=yes > >>> + bpf=yes > >>> + fi > >>> + fi > >>> + if test "$have_bpf" = "no"; then > >>> + feature_not_found "bpf" "the libbpf is not available" > >>> + fi Yes, this is a mistake. These 3 lines are to be removed. If libbpf is not installed, this should not fail the build. > >>> +fi > >>> + > >>> ########################################## > >>> # check if rtnetlink.h exists and is useful > >>> have_rtnetlink=no > >>> @@ -5905,6 +5935,9 @@ fi > >>> if test "$membarrier" = "yes" ; then > >>> echo "CONFIG_MEMBARRIER=y" >> $config_host_mak > >>> fi > >>> +if test "$bpf" = "yes" -a "$bigendian" != "yes" -a "$linux" = "yes" ; then > >>> + echo "CONFIG_EBPF=y" >> $config_host_mak > >>> +fi > >>> if test "$signalfd" = "yes" ; then > >>> echo "CONFIG_SIGNALFD=y" >> $config_host_mak > >>> fi > >>> diff --git a/ebpf/ebpf_rss-stub.c b/ebpf/ebpf_rss-stub.c > >>> new file mode 100644 > >>> index 0000000000..e71e229190 > >>> --- /dev/null > >>> +++ b/ebpf/ebpf_rss-stub.c > >>> @@ -0,0 +1,40 @@ > >>> +/* > >>> + * eBPF RSS stub file > >>> + * > >>> + * Developed by Daynix Computing LTD (http://www.daynix.com) > >>> + * > >>> + * Authors: > >>> + * Yuri Benditovich <yuri.benditovich@daynix.com> > >>> + * > >>> + * This work is licensed under the terms of the GNU GPL, version 2. See > >>> + * the COPYING file in the top-level directory. > >>> + */ > >>> + > >>> +#include "qemu/osdep.h" > >>> +#include "ebpf/ebpf_rss.h" > >> > >> I wonder why not simply use #ifdef #else to exclude the rss functions. > > Just to make the reading easier. > > > >> If I read code correctly, this stub requires rss_is_loaded called before > >> ebpf_rss_set_all(), so actually ebpf_rss_is_loaded serve the same as > > Can you please get into details? > > I think the stub does not require it, it just converts all the > > ebpf_rss calls to nop at link time. > > If I miss something please let us know, we'll fix it in v4. > > > I mean the current can not be used without checking rss_is_loaded(). So > rss_is_loaded() is somehow a guard like macro. > > I personally prefer #ifdef but it's not a must. > > Thanks >
© 2016 - 2025 Red Hat, Inc.