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 ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223]) (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 7A776C77B78 for ; Tue, 2 May 2023 20:30:35 +0000 (UTC) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 02B1A1C20984 for ; Tue, 2 May 2023 20:30:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3FEC3A926 for ; Tue, 2 May 2023 20:30:34 +0000 (UTC) Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D74F79470 for ; Tue, 2 May 2023 20:17:00 +0000 (UTC) Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4033D26A5; Tue, 2 May 2023 13:16:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=FDskB3SV/1RuJlj1cdT8hXMsx7jb467/4HrUADLnknM=; b=mGYEtCmdXiz6QCc/5oxHgVC3RM Kpx1yYbXvd1YUg0TlpUUdObnjmhjHMYQOJkkjAgiVxAH4othcawnd8ivkQekhA94Pwnj0OEVwBcdo vZP262xvfLlXY1JyURsMz+js4nsMz/wYuv42419dIM7ldaac4dyzYBhDxfIoO2bXuIxM=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1ptwPv-00BlIx-Qa; Tue, 02 May 2023 22:16:07 +0200 Date: Tue, 2 May 2023 22:16:07 +0200 From: Andrew Lunn To: Shenwei Wang Cc: Wei Fang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Clark Wang , NXP Linux Team , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Alexander Lobakin , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Gagandeep Singh Subject: Re: [PATCH 1/1] net: fec: enable the XDP_TX support Message-ID: <6032c1be-4080-4103-b196-c3a44bd5df6b@lunn.ch> References: <20230502193219.673637-1-shenwei.wang@nxp.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230502193219.673637-1-shenwei.wang@nxp.com> On Tue, May 02, 2023 at 02:32:19PM -0500, Shenwei Wang wrote: > Enable the XDP_TX path and correct the return value of the xmit function. > > If any individual frame cannot transmit due to lack of BD entries, the > function would still return success for sending all frames. This results > in prematurely indicating frames were sent when they were actually dropped. > > The patch resolves the issue by ensureing the return value properly > indicates the actual number of frames successfully transmitted, rather than > potentially reporting success for all frames when some could not transmit. Hi Shenwei The patch subject is wrong. This do not enable the XDP_TX support, it fixes the XDP_TX support. Please also take a read of the netdev FAQ. You your put the tree in the patch subject. > > Fixes: 6d6b39f180b8 ("net: fec: add initial XDP support") > Signed-off-by: Gagandeep Singh > Signed-off-by: Shenwei Wang > --- > drivers/net/ethernet/freescale/fec_main.c | 27 ++++++++++++++++------- > 1 file changed, 19 insertions(+), 8 deletions(-) > > diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c > index 160c1b3525f5..dfc1bcc9a8db 100644 > --- a/drivers/net/ethernet/freescale/fec_main.c > +++ b/drivers/net/ethernet/freescale/fec_main.c > @@ -75,6 +75,10 @@ > > static void set_multicast_list(struct net_device *ndev); > static void fec_enet_itr_coal_set(struct net_device *ndev); > +static int fec_enet_xdp_xmit(struct net_device *dev, > + int num_frames, > + struct xdp_frame **frames, > + u32 flags); For a minimal fix for net, this is O.K. But once net-next has opened, please submit a patch which moves the code around to avoid the forward declaration. Andrew