From: Prashant Bhole <prashantbhole.linux@gmail.com>
To: "Michael S . Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>,
qemu-devel@nongnu.org
Cc: Song Liu <songliubraving@fb.com>,
Jakub Kicinski <jakub.kicinski@netronome.com>,
Jesper Dangaard Brouer <hawk@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
netdev@vger.kernel.org, John Fastabend <john.fastabend@gmail.com>,
Alexei Starovoitov <ast@kernel.org>,
Martin KaFai Lau <kafai@fb.com>,
Prashant Bhole <prashantbhole.linux@gmail.com>,
kvm@vger.kernel.org, Yonghong Song <yhs@fb.com>,
Andrii Nakryiko <andriin@fb.com>,
"David S . Miller" <davem@davemloft.net>
Subject: [RFC 1/3] configure: add libbpf support
Date: Tue, 26 Nov 2019 19:09:12 +0900 [thread overview]
Message-ID: <20191126100914.5150-2-prashantbhole.linux@gmail.com> (raw)
In-Reply-To: <20191126100914.5150-1-prashantbhole.linux@gmail.com>
This is a preparation to add libbpf support for Qemu. When it is
enabled Qemu can load eBPF programs and manipulated eBPF maps
libbpf APIs.
When configured with --enable-libbpf, availability of libbpf is
checked. If it exists then CONFIG_LIBBPF is defined and the qemu
binary is linked with libbpf.
Signed-off-by: Prashant Bhole <prashantbhole.linux@gmail.com>
---
configure | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/configure b/configure
index 6099be1d84..a7e8a8450d 100755
--- a/configure
+++ b/configure
@@ -504,6 +504,7 @@ debug_mutex="no"
libpmem=""
default_devices="yes"
plugins="no"
+libbpf="no"
supported_cpu="no"
supported_os="no"
@@ -1539,6 +1540,8 @@ for opt do
;;
--disable-plugins) plugins="no"
;;
+ --enable-libbpf) libbpf="yes"
+ ;;
*)
echo "ERROR: unknown option $opt"
echo "Try '$0 --help' for more information"
@@ -1825,6 +1828,7 @@ disabled with --disable-FEATURE, default is enabled if available:
debug-mutex mutex debugging support
libpmem libpmem support
xkbcommon xkbcommon support
+ libbpf eBPF program support
NOTE: The object files are built at the place where configure is launched
EOF
@@ -6084,6 +6088,19 @@ case "$slirp" in
;;
esac
+##########################################
+# Do we have libbpf
+if test "$libbpf" != "no" ; then
+ if $pkg_config libbpf; then
+ libbpf="yes"
+ libbpf_libs=$($pkg_config --libs libbpf)
+ else
+ if test "$libbpf" == "yes" ; then
+ feature_not_found "libbpf" "Install libbpf devel"
+ fi
+ libbpf="no"
+ fi
+fi
##########################################
# End of CC checks
@@ -6599,6 +6616,7 @@ echo "libpmem support $libpmem"
echo "libudev $libudev"
echo "default devices $default_devices"
echo "plugin support $plugins"
+echo "XDP offload support $libbpf"
if test "$supported_cpu" = "no"; then
echo
@@ -7457,6 +7475,11 @@ if test "$plugins" = "yes" ; then
fi
fi
+if test "$libbpf" = "yes" ; then
+ echo "CONFIG_LIBBPF=y" >> $config_host_mak
+ echo "LIBBPF_LIBS=$libbpf_libs" >> $config_host_mak
+fi
+
if test "$tcg_interpreter" = "yes"; then
QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/tci $QEMU_INCLUDES"
elif test "$ARCH" = "sparc64" ; then
--
2.20.1
next prev parent reply other threads:[~2019-11-26 10:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-26 10:09 [RFC 0/3] Qemu: virtio-net XDP offload Prashant Bhole
2019-11-26 10:09 ` Prashant Bhole [this message]
2019-11-26 10:09 ` [RFC 2/3] virtio-net: add support for offloading XDP program Prashant Bhole
2019-11-26 10:09 ` [RFC 3/3] virtio-net: add support for offloading an ebpf map Prashant Bhole
2019-11-26 10:33 ` [RFC 0/3] Qemu: virtio-net XDP offload no-reply
2019-11-27 1:27 ` Prashant Bhole
2019-11-26 10:36 ` no-reply
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=20191126100914.5150-2-prashantbhole.linux@gmail.com \
--to=prashantbhole.linux@gmail.com \
--cc=andriin@fb.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=hawk@kernel.org \
--cc=jakub.kicinski@netronome.com \
--cc=jasowang@redhat.com \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).