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 34CEBC05027 for ; Tue, 14 Feb 2023 16:49:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id D181340116; Tue, 14 Feb 2023 16:49:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D181340116 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1676393386; bh=2YfcsuEiNov+Yr+fH51uAhXD5YbiAK6b4l1jJaRSnOU=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=eJ0yyOUMZt5924F08eV4nkPNvsRqpt3pkQl09c1iv4gM5DTxC3ND4HU3G3eIohIAp rIy755Yd3FKSuCkxeLc5W1/8FUOTuZSq06yhGa/o2WdBBM8AOM6o0c6srZowoG6ixe RzfNM/NlUq0m8m8vgQElo2bQY9szYrPCuSQtPAqfSSIMbKov4lGaKo3gPPosNR9sMW vcXAPWwR/aEqn836lt9kv2QXWDzA3vF55BcT/+Ga3wS51T4UOBh99F+Y+XxqYEbFVV GUsucMFq/b5Ur3bVd5SymvG/ez38/EXJX4ftTxqzja4Hae4RFLZzvT3CmqP/bPouUq nikRdoTiuOkkA== 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 CEBDFvSwfZ8I; Tue, 14 Feb 2023 16:49:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id C58CA4053C; Tue, 14 Feb 2023 16:49:45 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org C58CA4053C Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id A750D1BF57F for ; Tue, 14 Feb 2023 16:49:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 7EF7081410 for ; Tue, 14 Feb 2023 16:49:44 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 7EF7081410 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 v32znFQBHBKQ for ; Tue, 14 Feb 2023 16:49:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 42BA98140A Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by smtp1.osuosl.org (Postfix) with ESMTPS id 42BA98140A for ; Tue, 14 Feb 2023 16:49:42 +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 896F0B81E33; Tue, 14 Feb 2023 16:49:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9A34C433EF; Tue, 14 Feb 2023 16:49:38 +0000 (UTC) Date: Tue, 14 Feb 2023 17:49:35 +0100 From: Lorenzo Bianconi To: Maciej Fijalkowski Message-ID: References: <8a4781511ab6e3cd280e944eef69158954f1a15f.1676385351.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=1676393379; bh=W6B/m734m/kjyz8yYIdkGxVDEUrxtpcevEyOfjHm0fI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mp7Ml6EwpyWc6g/LrmUibcSqt3a54lHoxaY8SquxXrAuN8KNvk5Ci4gnHscJNs3gV MiZ04nahIfDS2wSaSNSsLR3F/PGxJMclfCxoWDOS7hwl7dbNJt7oyW4DqBHtoTrLFX qjW5A92KXb3oTK3rMNBmt+ULEx9/LOjQ6D3xcdTnQUqZcL9eb4mYetvlxr3cqc8DGD a9vpf0c/lolSsSquF1vl8tjdrU7i6tIapqXasA+CqeEVK4sT1NzCDE+nWrAkIBi+wM eRgaTb/ybR5N78ZpAW+q7Dxa9EFSPowSKXgWlnksfqyL7PiE1wfRsN1ndd+3T5QG2W UNa7p5TpmrFiQ== 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=mp7Ml6Ew Subject: Re: [Intel-wired-lan] [PATCH v2 net-next] ice: update xdp_features with xdp multi-buff 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: netdev@vger.kernel.org, jesse.brandeburg@intel.com, edumazet@google.com, anthony.l.nguyen@intel.com, kuba@kernel.org, intel-wired-lan@lists.osuosl.org, pabeni@redhat.com, davem@davemloft.net Content-Type: multipart/mixed; boundary="===============6236109862735742228==" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" --===============6236109862735742228== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="hgOXsxVkxdzX+dA9" Content-Disposition: inline --hgOXsxVkxdzX+dA9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > On Tue, Feb 14, 2023 at 03:39:27PM +0100, Lorenzo Bianconi wrote: > > Now ice driver supports xdp multi-buffer so add it to xdp_features. > > Check vsi type before setting xdp_features flag. > >=20 > > Signed-off-by: Lorenzo Bianconi > > --- > > Changes since v1: > > - rebase on top of net-next > > - check vsi type before setting xdp_features flag > > --- > > drivers/net/ethernet/intel/ice/ice_main.c | 18 ++++++++++++------ > > 1 file changed, 12 insertions(+), 6 deletions(-) > >=20 > > diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/et= hernet/intel/ice/ice_main.c > > index 0712c1055aea..4994a0e5a668 100644 > > --- a/drivers/net/ethernet/intel/ice/ice_main.c > > +++ b/drivers/net/ethernet/intel/ice/ice_main.c > > @@ -2912,7 +2912,7 @@ ice_xdp_setup_prog(struct ice_vsi *vsi, struct bp= f_prog *prog, > > if (xdp_ring_err) > > NL_SET_ERR_MSG_MOD(extack, "Setting up XDP Tx resources failed"); > > } > > - xdp_features_set_redirect_target(vsi->netdev, false); > > + xdp_features_set_redirect_target(vsi->netdev, true); > > /* reallocate Rx queues that are used for zero-copy */ > > xdp_ring_err =3D ice_realloc_zc_buf(vsi, true); > > if (xdp_ring_err) > > @@ -3333,10 +3333,11 @@ static void ice_napi_add(struct ice_vsi *vsi) > > =20 > > /** > > * ice_set_ops - set netdev and ethtools ops for the given netdev > > - * @netdev: netdev instance > > + * @vsi: the VSI associated with the new netdev > > */ > > -static void ice_set_ops(struct net_device *netdev) > > +static void ice_set_ops(struct ice_vsi *vsi) > > { > > + struct net_device *netdev =3D vsi->netdev; > > struct ice_pf *pf =3D ice_netdev_to_pf(netdev); > > =20 > > if (ice_is_safe_mode(pf)) { > > @@ -3348,6 +3349,13 @@ static void ice_set_ops(struct net_device *netde= v) > > netdev->netdev_ops =3D &ice_netdev_ops; > > netdev->udp_tunnel_nic_info =3D &pf->hw.udp_tunnel_nic; > > ice_set_ethtool_ops(netdev); > > + > > + if (vsi->type !=3D ICE_VSI_PF) > > + return; > > + > > + netdev->xdp_features =3D NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRE= CT | > > + NETDEV_XDP_ACT_XSK_ZEROCOPY | > > + NETDEV_XDP_ACT_RX_SG; >=20 > FWIW we do support frags in ndo_xdp_xmit() now so > NETDEV_XDP_ACT_NDO_XMIT_SG should be set. yep, I have enabled them in ice_xdp_setup_prog() setting support_sg to true= in xdp_features_set_redirect_target(). Regards, Lorenzo >=20 > > } > > =20 > > /** > > @@ -4568,9 +4576,7 @@ static int ice_cfg_netdev(struct ice_vsi *vsi) > > np->vsi =3D vsi; > > =20 > > ice_set_netdev_features(netdev); > > - netdev->xdp_features =3D NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRE= CT | > > - NETDEV_XDP_ACT_XSK_ZEROCOPY; > > - ice_set_ops(netdev); > > + ice_set_ops(vsi); > > =20 > > if (vsi->type =3D=3D ICE_VSI_PF) { > > SET_NETDEV_DEV(netdev, ice_pf_to_dev(vsi->back)); > > --=20 > > 2.39.1 > >=20 > > _______________________________________________ > > Intel-wired-lan mailing list > > Intel-wired-lan@osuosl.org > > https://lists.osuosl.org/mailman/listinfo/intel-wired-lan --hgOXsxVkxdzX+dA9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCY+u7nwAKCRA6cBh0uS2t rMTHAP93bN/jYu+AAvLkcKUqmaTdtSl/6TN2MOxTBN19p78SYgD9HY7Qo51GylZ/ LCDj5x3hEReTGwgZU/XPaOEdkgLXsQg= =1ukL -----END PGP SIGNATURE----- --hgOXsxVkxdzX+dA9-- --===============6236109862735742228== 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 --===============6236109862735742228==--