From nobody Sun Feb 8 05:09:00 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1574763473; cv=none; d=zohomail.com; s=zohoarc; b=Z00vhRCJXKFmC8KQ1RtYgNNIWn+xRLu+SapOnkm0hG0wbRIXmyQpE8qpHjSXEmk9EaiRr3CyHR2vhBh5/o1mMdRnmEBwnh73WEmQaV5tWaqa3SdM0dcCMq9/0BNb5aUOIKEPAxsdCPuZcUYRuqX39CxWlCuzqP4vqIPlEkJWGHA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574763473; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ecShvr+Zq6STOGx1l0iQ8cCvKv5lb6vZ/WjknM9nD6E=; b=QwMgBreni3zeCFQ0ikTUQtZMwQ1XwBA+MpctEuK+t8MjnHCz6ggm94M6zSHgvFeVVRu/P65ysB7GFl4sqj7M0qsiqujbTepMZ9HUcd1VCuNSuYEiTrgHrelfpNae4Rqusr79Jzd8o1Z6wKxG3kh3koUX3BBbOh77FxnMNRPVqzU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574763473982439.93345744583985; Tue, 26 Nov 2019 02:17:53 -0800 (PST) Received: from localhost ([::1]:52200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZXuq-0007pK-Bl for importer@patchew.org; Tue, 26 Nov 2019 05:17:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57439) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZXsF-0005fI-0P for qemu-devel@nongnu.org; Tue, 26 Nov 2019 05:15:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iZXnS-0003hD-A7 for qemu-devel@nongnu.org; Tue, 26 Nov 2019 05:10:15 -0500 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:44708) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iZXnS-0003h1-4R for qemu-devel@nongnu.org; Tue, 26 Nov 2019 05:10:14 -0500 Received: by mail-pf1-x444.google.com with SMTP id d199so4300163pfd.11 for ; Tue, 26 Nov 2019 02:10:14 -0800 (PST) Received: from localhost.localdomain ([222.151.198.97]) by smtp.gmail.com with ESMTPSA id h9sm12059065pgk.84.2019.11.26.02.10.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 02:10:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ecShvr+Zq6STOGx1l0iQ8cCvKv5lb6vZ/WjknM9nD6E=; b=d+YYczk4lJH43WHRgPgABeQW5AYRNcl7DJRbNi1c4p2WWFqkvolmM2XsQ44czI+mWp aVmIt6CW9B+7OpTNN+ps0zReed0nBfjwq9pklcNZKWKoIW7k1EQMTOHSi4d0/BCnYQee jinDCFwA6wNeZ4cBOG9cHPVSHcKoTCX0NlPdmJVevRHmMaf97cZDvXxtiWam3BPVOLr9 RFEZ0ncycDTNPn5Urku5wMT1KOZ8+LKL42IakRmapDH1VNSLE/H9DD99CM6pQ9LMRigI y0T8KiZRlGegkVpLl3zTTtrATMEXAozU32i+jHRlYa3drVFQX+N2oBh6kWr44Z3T2zcB SEaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ecShvr+Zq6STOGx1l0iQ8cCvKv5lb6vZ/WjknM9nD6E=; b=TFf6pK10DpKosKiGxAK8zr2zUVHP+uX5CVQrG7VdJMIvZOtNEp2cZ5eZuHUGCTqyrl p49kFtuYE3vw/pJoS1QNPA1FkGYIRart+L3fzxXzDgy/OLSHwYDM/QQzV0QIaAvEdLY6 1C2eymSssoJYv6AUwv6NXOi6VtiDz4t5QRA0tGsK4rKTmoPFWhaLCRnQFu71OrqXjRZD 13RHvTvVrfKFU65rmmmnGdrA4BeJTAS3uAb0oovo8AG4GkIBT1Yad3XAFsrGErcrxok1 sjehMOnMlok1nwZl9rhEPkv1K1giinvEj6I5vqyUToyUicYjKtWaSKr9Al4mEtJNIjx8 yYdg== X-Gm-Message-State: APjAAAVLZkEz3vWM+4fiu+AeDTA/GckHdJ6Wo3yJ/B/Or6nMuO0WTNca ePA8/XREUZyKZzTUbAnRCLk= X-Google-Smtp-Source: APXvYqxLnUahtpS2ezzELlW12TWhqW19OSB0jtp9PSXtwd5yFTcnaRJ86M926/WsXnNPNpvBgZKE9Q== X-Received: by 2002:a63:e4a:: with SMTP id 10mr35864959pgo.121.1574763013362; Tue, 26 Nov 2019 02:10:13 -0800 (PST) From: Prashant Bhole To: "Michael S . Tsirkin" , Jason Wang , qemu-devel@nongnu.org Subject: [RFC 1/3] configure: add libbpf support Date: Tue, 26 Nov 2019 19:09:12 +0900 Message-Id: <20191126100914.5150-2-prashantbhole.linux@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191126100914.5150-1-prashantbhole.linux@gmail.com> References: <20191126100914.5150-1-prashantbhole.linux@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::444 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Song Liu , Jakub Kicinski , Jesper Dangaard Brouer , Daniel Borkmann , netdev@vger.kernel.org, John Fastabend , Alexei Starovoitov , Martin KaFai Lau , Prashant Bhole , kvm@vger.kernel.org, Yonghong Song , Andrii Nakryiko , "David S . Miller" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 --- 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=3D"no" libpmem=3D"" default_devices=3D"yes" plugins=3D"no" +libbpf=3D"no" =20 supported_cpu=3D"no" supported_os=3D"no" @@ -1539,6 +1540,8 @@ for opt do ;; --disable-plugins) plugins=3D"no" ;; + --enable-libbpf) libbpf=3D"yes" + ;; *) echo "ERROR: unknown option $opt" echo "Try '$0 --help' for more information" @@ -1825,6 +1828,7 @@ disabled with --disable-FEATURE, default is enabled i= f available: debug-mutex mutex debugging support libpmem libpmem support xkbcommon xkbcommon support + libbpf eBPF program support =20 NOTE: The object files are built at the place where configure is launched EOF @@ -6084,6 +6088,19 @@ case "$slirp" in ;; esac =20 +########################################## +# Do we have libbpf +if test "$libbpf" !=3D "no" ; then + if $pkg_config libbpf; then + libbpf=3D"yes" + libbpf_libs=3D$($pkg_config --libs libbpf) + else + if test "$libbpf" =3D=3D "yes" ; then + feature_not_found "libbpf" "Install libbpf devel" + fi + libbpf=3D"no" + fi +fi =20 ########################################## # 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" =20 if test "$supported_cpu" =3D "no"; then echo @@ -7457,6 +7475,11 @@ if test "$plugins" =3D "yes" ; then fi fi =20 +if test "$libbpf" =3D "yes" ; then + echo "CONFIG_LIBBPF=3Dy" >> $config_host_mak + echo "LIBBPF_LIBS=3D$libbpf_libs" >> $config_host_mak +fi + if test "$tcg_interpreter" =3D "yes"; then QEMU_INCLUDES=3D"-iquote \$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" elif test "$ARCH" =3D "sparc64" ; then --=20 2.20.1