From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Andrew Melnychenko <andrew@daynix.com>
Cc: mst@redhat.com, jasowang@redhat.com, qemu-devel@nongnu.org,
yuri.benditovich@daynix.com, yan@daynix.com, pbonzini@redhat.com
Subject: Re: [RFC PATCH v4 4/7] ebpf: Added eBPF RSS loader.
Date: Mon, 8 Feb 2021 09:49:33 +0000 [thread overview]
Message-ID: <20210208094907.GB1141037@redhat.com> (raw)
In-Reply-To: <20210204170951.91805-5-andrew@daynix.com>
On Thu, Feb 04, 2021 at 07:09:48PM +0200, 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 | 30 +++
> 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, 696 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
When adding a new build dependancy we need to update the dockerfiles
in tests/docker/dockerfiles to add the required development package
on all the distros that have it available currently. It is in Fedora
at least, but have not checked other distros.
>
> diff --git a/configure b/configure
> index e85d6baf8f..38797e0116 100755
> --- a/configure
> +++ b/configure
> +##########################################
> +# 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
> +fi
libbpf provides a pkg-config file, so it should be probed using
pkg-config in meson.build. CC'ing Paolo to confirm.
> diff --git a/meson.build b/meson.build
> index 2d8b433ff0..9a24020bc3 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -995,6 +995,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
This is where you need todo the pkg-config search using 'dependency()'
instead of 'find_library'.
> +
> if get_option('cfi')
> cfi_flags=[]
> # Check for dependency on LTO
> @@ -1748,6 +1755,7 @@ if have_system
> 'backends',
> 'backends/tpm',
> 'chardev',
> + 'ebpf',
> 'hw/9pfs',
> 'hw/acpi',
> 'hw/adc',
> @@ -1914,6 +1922,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)
> @@ -2592,6 +2603,7 @@ summary_info += {'RDMA support': config_host.has_key('CONFIG_RDMA')}
> summary_info += {'PVRDMA support': config_host.has_key('CONFIG_PVRDMA')}
> summary_info += {'fdt support': fdt_opt == 'disabled' ? false : fdt_opt}
> summary_info += {'libcap-ng support': libcap_ng.found()}
> +summary_info += {'bpf support': config_host.has_key('CONFIG_EBPF')}
> # TODO: add back protocol and server version
> summary_info += {'spice support': config_host.has_key('CONFIG_SPICE')}
> summary_info += {'rbd support': rbd.found()}
> @@ -2653,3 +2665,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
>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2021-02-08 16:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-04 17:09 [RFC PATCH v4 0/7] eBPF RSS support for virtio-net Andrew Melnychenko
2021-02-04 16:58 ` no-reply
2021-02-04 17:09 ` [RFC PATCH v4 1/7] net/tap: Added TUNSETSTEERINGEBPF code Andrew Melnychenko
2021-02-04 17:09 ` [RFC PATCH v4 2/7] net: Added SetSteeringEBPF method for NetClientState Andrew Melnychenko
2021-02-04 17:09 ` [RFC PATCH v4 3/7] ebpf: Added eBPF RSS program Andrew Melnychenko
2021-02-04 17:09 ` [RFC PATCH v4 4/7] ebpf: Added eBPF RSS loader Andrew Melnychenko
2021-02-08 9:49 ` Daniel P. Berrangé [this message]
2021-02-04 17:09 ` [RFC PATCH v4 5/7] virtio-net: Added eBPF RSS to virtio-net Andrew Melnychenko
2021-02-08 9:56 ` Daniel P. Berrangé
2021-02-04 17:09 ` [RFC PATCH v4 6/7] docs: Added eBPF documentation Andrew Melnychenko
2021-02-04 17:09 ` [RFC PATCH v4 7/7] MAINTAINERS: Added eBPF maintainers information Andrew Melnychenko
2021-02-08 5:57 ` [RFC PATCH v4 0/7] eBPF RSS support for virtio-net Jason Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210208094907.GB1141037@redhat.com \
--to=berrange@redhat.com \
--cc=andrew@daynix.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yan@daynix.com \
--cc=yuri.benditovich@daynix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.