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 smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 DC7EAC00A5A for ; Thu, 19 Jan 2023 14:23:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 51F61400D9; Thu, 19 Jan 2023 14:23:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 51F61400D9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1674138221; bh=ABWTwdlPxRJAhPCMe0yjh/LZcEWrpXqJmnKrHRO29dI=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=CGVl+vk9tTylXYWxMzZP1pkH9mmtWPLC0qmchaED2w+LWrsDjx1kyi4fucm67YMj8 2kHCuJSSNpkzPjGeq72mk5rbY6/vgpprhYH9DMeB1X6jrakypFdCoaRE7/mX/MHJiu 0J8JlKdQgZtjCnTJtXYMBcnRBtp3gVXTM6jFfnRfA2hHTKDHZBP7HEavGMSFusrXvo TSd0RTjokCMrqW/J/NC0q42R64prmmkWj+VHsapAdgaTUoFwk8SGQ84bb0n9/fSyN8 zKuZQOHZASOYKGcX3oQ7V8b8Zm+2vyTzLCxsOni/a5vd9BgCaHKB6AnPF+yYJjXXEu DvYsTmCamiBxA== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ePboQgFOWpNY; Thu, 19 Jan 2023 14:23:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 45A9C404D1; Thu, 19 Jan 2023 14:23:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 45A9C404D1 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id BBDE91BF372 for ; Thu, 19 Jan 2023 14:23:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 243AB60FE7 for ; Thu, 19 Jan 2023 14:23:38 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 243AB60FE7 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QMrVX47M8Mzi for ; Thu, 19 Jan 2023 14:23:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org BE61260E27 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by smtp3.osuosl.org (Postfix) with ESMTPS id BE61260E27 for ; Thu, 19 Jan 2023 14:23:36 +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 dfw.source.kernel.org (Postfix) with ESMTPS id AE99C615C6; Thu, 19 Jan 2023 14:23:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91C19C433EF; Thu, 19 Jan 2023 14:23:34 +0000 (UTC) Date: Thu, 19 Jan 2023 15:23:31 +0100 From: Lorenzo Bianconi To: sdf@google.com Message-ID: References: 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=1674138215; bh=jF//NUpq1HN0b0Ns8y/1mrIp01dJ2M8KP6bnPkFL0Pw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QP5CbJkXPMLvndjLQvNjPZre9nwiEdaj8L8gv34aK3Otf9uzVr3hRZ07gRufUbIEY agchRoYYSlcIUq9G5scJxX0rzXcs/lFAWB3cp/Oj62rwhVMjo/HpOYmCEl2EwvUFB7 KKevnkP85UC19IYIzAsWLig0fWUz/ZTU4LW0ysYU28O0JTjUu9Lc0nezYpX3KAijfx a8NA9sFCnvv4kaFoFAD8qhrlaGfx4tuBdLwZB6UzDu2FDYfm2E/EMO0MNPwyuyvYO4 WVUwASBd+0RyvrOBxsX5H56Lovom6n7fsFtYcUrrzqORTaNrvdzXwZJfkDVl+lvklp 7fOk1h5EobDWQ== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=QP5CbJkX Subject: Re: [Intel-wired-lan] [RFC v2 bpf-next 2/7] drivers: net: turn on XDP 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, 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="===============4766052422205452276==" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" --===============4766052422205452276== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="DGAPQT9oFXfrtSAg" Content-Disposition: inline --DGAPQT9oFXfrtSAg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > On 01/14, Lorenzo Bianconi wrote: > > From: Marek Majtyka >=20 [...] >=20 > Maybe stupid question: why do we need WRITE_ONCE here? > And if we do need it, do we need READ_ONCE as well? >=20 > WRITE_ONCE(*xdp_features, READ_ONCE(*xdp_features) | flags); This part is from the Marek's original series. I will let him to comment on= it. >=20 > ? >=20 > Also, would it make sense to drop this __xdp_features_set_redirect_target > and just define the following: >=20 > static inline void > xdp_features_set_redirect_target(xdp_features_t *xdp_features, bool > support_sg) > { > xdp_features_t flags =3D NETDEV_XDP_ACT_NDO_XMIT; >=20 > if (support_sg) > flags |=3D NETDEV_XDP_ACT_NDO_XMIT_SG; > *xdp_features |=3D flags; /* or WRITE_ONCE */ > } >=20 > This should avoid having two different sets of functions. Or does it > look worse because of that 'naked' true/false argument in the call > sites? I did this way because we will mainly run it with support_sg set to false, but I do not have a strong opinion on it, I am fine both ways. I will fix i= t. Regards, Lorenzo >=20 >=20 > > +} > > + > > +static inline void > > +xdp_features_clear_redirect_target(xdp_features_t *xdp_features) > > +{ > > + WRITE_ONCE(*xdp_features, > > + *xdp_features & ~(NETDEV_XDP_ACT_NDO_XMIT | > > + NETDEV_XDP_ACT_NDO_XMIT_SG)); > > +} > > + > > +#else > > + > > +static inline void > > +__xdp_features_set_redirect_target(xdp_features_t *xdp_features, u32 > > flags) > > +{ > > +} > > + > > +static inline void > > +xdp_features_clear_redirect_target(xdp_features_t *xdp_features) > > +{ > > +} > > + > > +#endif > > + > > +static inline void > > +xdp_features_set_redirect_target(xdp_features_t *xdp_features) > > +{ > > + __xdp_features_set_redirect_target(xdp_features, > > + NETDEV_XDP_ACT_NDO_XMIT | > > + NETDEV_XDP_ACT_NDO_XMIT_SG); > > +} > > + > > #define DEV_MAP_BULK_SIZE XDP_BULK_QUEUE_SIZE >=20 > > #endif /* __LINUX_NET_XDP_H__ */ > > -- > > 2.39.0 >=20 --DGAPQT9oFXfrtSAg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCY8lSYwAKCRA6cBh0uS2t rJtrAPwK/+nlrw98yKOdg+WYuzD06o+yaCcuTx3jjb6lFn3v+wEA6kHNa8gGGDXU RHgliiOFhY71LPPYr2/wItwtHw9/3Ak= =s5kN -----END PGP SIGNATURE----- --DGAPQT9oFXfrtSAg-- --===============4766052422205452276== 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 --===============4766052422205452276==--