Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7354468rwr; Tue, 2 May 2023 13:24:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6WejIIVzH9ang2mpPpCG9B3xW+f88Ewo1wciH0pvXj0Cnkv/3BVebtaEn9t4TdOyoa0bMB X-Received: by 2002:a05:6a20:9d91:b0:d3:78ab:77c3 with SMTP id mu17-20020a056a209d9100b000d378ab77c3mr18517465pzb.48.1683059075501; Tue, 02 May 2023 13:24:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683059075; cv=none; d=google.com; s=arc-20160816; b=Aj/ukL7+0NhQFSYBIGMpQGmsj4HkI/rPoN5psW5/sfRSXFJGe6PXmZWtUpI8COFb17 bB6FI3hIs2UJTFij+S/lB0pnwcVpcifM8SIr5dlbbae2B7anvSe4yrObEMjytNTTI+5D a6WY0ZPNc1S45JSSwGswR8O7uNKX5/RK+MQNeeT6p7LCY3IptorrNBpODf83CBRC6Yz4 p+UCL8FxxSbh9jYhrZAZlVW+zzpTHSjobc4KXNF5u2TRypGpdoLT4i4fAGxCXCx7Y2x3 K+m151hdT3NbWKOsK6msguibUcEZRgBTGuUHeNybs3M0YtsthdXpBrRyRHz6PhjMlLKj 3s3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FDskB3SV/1RuJlj1cdT8hXMsx7jb467/4HrUADLnknM=; b=lH0Qw/TOfKjLp30nI9pWI83LTaZ412P+OqyBKnFoFwVpwUU6Mqn7tz4wLWQuFI6707 0A1o8Te/hDCRhvfe9JYYDCRCdbknNVS6MArPKZBYpm+/mmaYd74C+v0SgypP/nURRCRl 2xMwg6WIPqqObHf2cLvjMQVDww2yBX5v5gpPGgsiD9E+kyj8cnDpTfonLogjkMLbM6c5 wXupT/BCrkrI4NvpzJhgfseBttts6vq8LDv99pJ4S9nZub+gR38PcZVUDZjtJE03alM/ 6PXDt3jBrOJuEJ749L64BxK6phdc7ffu/oKWUxaaDQcn4uiWppvoSc2cfskxqWZhG+TC ZkJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=mGYEtCmd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l12-20020a65448c000000b005075581074bsi30895640pgq.446.2023.05.02.13.24.21; Tue, 02 May 2023 13:24:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=mGYEtCmd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229727AbjEBURC (ORCPT + 99 others); Tue, 2 May 2023 16:17:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjEBURA (ORCPT ); Tue, 2 May 2023 16:17:00 -0400 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230502193219.673637-1-shenwei.wang@nxp.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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