From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2C5F6C54EBC for ; Tue, 10 Jan 2023 17:26:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 9837940308; Tue, 10 Jan 2023 17:26:57 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 9837940308 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1673371617; bh=A268/MvLC3WA1ZIokYg1l96FzG4xofIHPZ90CTTQqL0=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=8TdcaooWaV0cM7P0SoMLILuFsuCGCSkSvtGkp1ia9TykSQkMSiWZbYbuvQPEJLY3Z qnYYfnkcxgG37dsnEEMpQ4dABh3Uv7FXBwcU0cJipSn6YLolQGipl2Urw3vOwTbSwF fE2pw0bP2T5QEv6GuNTbU5DOkbrDlvIdF9J+1pq2Eca+QWRzdZuOazLjSj1OSvNK0B RlRQJu700scIwACC9wSOj2sgNsil9nSZw9VCZ+X1eL+mmvftcMUl4w5h4PhPe0JsMm ICt4goVnAm1WvsXkcZ8fdvi3TjSqSXxLtyki8SuHrpeXFStzeIJA/ioX389wYjJ8Kc +NlCqhWJNdimQ== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JsAPsoJ9DdmF; Tue, 10 Jan 2023 17:26:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 2310140544; Tue, 10 Jan 2023 17:26:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 2310140544 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id A1B2B1BF28B for ; Tue, 10 Jan 2023 17:26:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 8888081E8E for ; Tue, 10 Jan 2023 17:26:54 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 8888081E8E X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W9YGuc7AVjWN for ; Tue, 10 Jan 2023 17:26:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 7D25981E8B Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by smtp1.osuosl.org (Postfix) with ESMTPS id 7D25981E8B for ; Tue, 10 Jan 2023 17:26:53 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 72B77B818EB; Tue, 10 Jan 2023 17:26:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CE3FC433EF; Tue, 10 Jan 2023 17:26:48 +0000 (UTC) Date: Tue, 10 Jan 2023 18:26:45 +0100 From: Lorenzo Bianconi To: Andrii Nakryiko Message-ID: References: <6cce9b15a57345402bb94366434a5ac5609583b8.1671462951.git.lorenzo@kernel.org> MIME-Version: 1.0 In-Reply-To: X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673371609; bh=qIMUHEEcxEFfEbsuapq6m8UyQ8u7bBrd1f5qfus81vM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dWyQOYB751j90pvk6Be/N7sAgq8S/NdKvGo/Pq2IDrJqjFRcd8WnRYiAeB2CbdIBX PITITR+KfDlhRYo5Nw1srNwDh74Pt76tjHudW8N7HIOqk/VPc0ZAT45XHOhshPmt8j dJnDfjxZMtytRAdM7/kfzrtTBzDZUd/Hhx+Ohg8/hW4StQBgh3uqYFG908DIEFDJSy 3+MHv9rINr7sNPbZtzjWZgw6IjGRy+L5rmq5qmdEPtXjVLoBrzkQhauov1Y3jRkTNd PQxX3XiUUF5rV2bJDbRzwLyYtV/S6IB7p2sTL85OTn4Qcvff22DYtsq9gw2oSON908 8Vrts9C9Ma5IQ== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=dWyQOYB7 Subject: Re: [Intel-wired-lan] [RFC bpf-next 6/8] libbpf: add API to get XDP/XSK supported features X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mst@redhat.com, vladimir.oltean@nxp.com, ast@kernel.org, edumazet@google.com, anthony.l.nguyen@intel.com, daniel@iogearbox.net, andrii@kernel.org, intel-wired-lan@lists.osuosl.org, simon.horman@corigine.com, kuba@kernel.org, pabeni@redhat.com, grygorii.strashko@ti.com, aelior@marvell.com, hawk@kernel.org, christophe.jaillet@wanadoo.fr, memxor@gmail.com, john@phrozen.org, bjorn@kernel.org, bpf@vger.kernel.org, magnus.karlsson@intel.com, leon@kernel.org, netdev@vger.kernel.org, toke@redhat.com, ecree.xilinx@gmail.com, alardam@gmail.com, gospo@broadcom.com, saeedm@nvidia.com, davem@davemloft.net, nbd@nbd.name Content-Type: multipart/mixed; boundary="===============1375928884433435590==" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" --===============1375928884433435590== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="aGzNKNmdiT3FYYot" Content-Disposition: inline --aGzNKNmdiT3FYYot Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > On Mon, Dec 19, 2022 at 7:42 AM Lorenzo Bianconi wro= te: > > > > From: Kumar Kartikeya Dwivedi > > > > Add functions to get XDP/XSK supported function of netdev over route > > netlink interface. These functions provide functionalities that are > > going to be used in upcoming change. > > > > The newly added bpf_xdp_query_features takes a fflags_cnt parameter, > > which denotes the number of elements in the output fflags array. This > > must be at least 1 and maybe greater than XDP_FEATURES_WORDS. The > > function only writes to words which is min of fflags_cnt and > > XDP_FEATURES_WORDS. > > > > Co-developed-by: Lorenzo Bianconi > > Signed-off-by: Lorenzo Bianconi > > Co-developed-by: Marek Majtyka > > Signed-off-by: Marek Majtyka > > Signed-off-by: Kumar Kartikeya Dwivedi > > --- > > tools/lib/bpf/libbpf.h | 1 + > > tools/lib/bpf/libbpf.map | 1 + > > tools/lib/bpf/netlink.c | 62 ++++++++++++++++++++++++++++++++++++++++ > > 3 files changed, 64 insertions(+) > > > > diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h > > index eee883f007f9..9d102eb5007e 100644 > > --- a/tools/lib/bpf/libbpf.h > > +++ b/tools/lib/bpf/libbpf.h > > @@ -967,6 +967,7 @@ LIBBPF_API int bpf_xdp_detach(int ifindex, __u32 fl= ags, > > const struct bpf_xdp_attach_opts *opts); > > LIBBPF_API int bpf_xdp_query(int ifindex, int flags, struct bpf_xdp_qu= ery_opts *opts); > > LIBBPF_API int bpf_xdp_query_id(int ifindex, int flags, __u32 *prog_id= ); > > +LIBBPF_API int bpf_xdp_query_features(int ifindex, __u32 *fflags, __u3= 2 *fflags_cnt); >=20 > no need to add new API, just extend bpf_xdp_query()? Hi Andrii, AFAIK libbpf supports just NETLINK_ROUTE protocol. In order to connect with= the genl family code shared by Jakub we need to add NETLINK_GENERIC protocol su= pport to libbf. Is it ok to introduce a libmnl or libnl dependency in libbpf or d= o you prefer to add open code to just what we need? I guess we should have a dedicated API to dump xdp features in this case si= nce all the other code relies on NETLINK_ROUTE protocol. What do you think? Regards, Lorenzo >=20 > > > > /* TC related API */ > > enum bpf_tc_attach_point { > > diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map > > index 71bf5691a689..9c2abb58fa4b 100644 > > --- a/tools/lib/bpf/libbpf.map > > +++ b/tools/lib/bpf/libbpf.map > > @@ -362,6 +362,7 @@ LIBBPF_1.0.0 { > > bpf_program__set_autoattach; > > btf__add_enum64; > > btf__add_enum64_value; > > + bpf_xdp_query_features; > > libbpf_bpf_attach_type_str; > > libbpf_bpf_link_type_str; > > libbpf_bpf_map_type_str; >=20 > [...] --aGzNKNmdiT3FYYot Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCY72f1QAKCRA6cBh0uS2t rGtIAQD9CU+tItECNI3dIRiliqYGAXnkOOl6g7JU3GkonqJsxAD9EbSrhAp9DY7o ++BFm5/bt/xOJUm02tX2yaQq43S72gQ= =/rJB -----END PGP SIGNATURE----- --aGzNKNmdiT3FYYot-- --===============1375928884433435590== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan --===============1375928884433435590==--