Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp685665rwr; Fri, 5 May 2023 03:36:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6bbhLCKIJwLLSLD4PfVPwLLp2zfRNQ13VdiDYs3PSDiUQDOQ4mmMBHyp0xWb+0u3svKEXb X-Received: by 2002:a05:6a00:1142:b0:63d:254a:3909 with SMTP id b2-20020a056a00114200b0063d254a3909mr1636820pfm.32.1683282986595; Fri, 05 May 2023 03:36:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683282986; cv=none; d=google.com; s=arc-20160816; b=t/sGHko8V/qNu0c5HMndl2baQiEvlkrlus7RX09P1jwgfftGEgfe3rndhPofHspJyE bUvgFzVlKYcu3sHGpVm5K0BIowK9XXhyb+dDJPkwp/sNH9FU9aNE5Jb1zVPioInNpuuV Hgl3PXrWGBzUU9BXAD4rYDmZj25JN0CJwErhvwWZ3ohh7F7xfkt1JU34VbasDOUuATEf VXejBK17iU1+F6hLRCcIqzReQgE26yCqmIhdMmFjfg9qTBNS63Jpkp9VomODWVTbnhNX RwlVeKviNGbDY2k6UbSR57i3wCN+o7zEYJ+YsnLwTvE14Sg8hfbGPcXRlMilGAJgJBCd OTRA== 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=4sNtuPjomp5arZ4NnPsKmj/MZToaQkOI6vigdefs2P0=; b=eBCx/QX07jibYTHfP8iC7SJyuct9k3m9z+PI+LA9/a7rKf5itriUJ99ahHFBTX84jy hk3/8/G8p1tyOvOsuq10pMheloWvWJxdXJr56cp32K2WngBDdE6rH9mJHgq8xoUvnITN xho+L2hWVkYr4o6MGYJApMaW1FJDTel0aQvgnLd8ViEv254iUBbZKl5rd9ks0ElfbT1l XJ1Fm0fcL/TjDrPDZvmZk2kOKr/yxUBDmWjKVmeTmP/uY4bx71kE+aJIJK+aCxZg3VOn IAvWLgl/Q9OWBuYWFq9bF2a3g15+csqTGNeBQExPuLYVSiXjWssoWQwt44kz7trLJkOW ChiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GCxFMEGa; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x184-20020a6386c1000000b0051367d909efsi1813691pgd.106.2023.05.05.03.36.11; Fri, 05 May 2023 03:36:26 -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=@kernel.org header.s=k20201202 header.b=GCxFMEGa; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231678AbjEEKXP (ORCPT + 99 others); Fri, 5 May 2023 06:23:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231200AbjEEKXL (ORCPT ); Fri, 5 May 2023 06:23:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9349B18902 for ; Fri, 5 May 2023 03:23:10 -0700 (PDT) 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 2B4A360C94 for ; Fri, 5 May 2023 10:23:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B315BC433EF; Fri, 5 May 2023 10:23:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683282189; bh=nWNitmoUADkfmgkehlM5eSbfxlPEEaLRPvnf7gZnV/c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GCxFMEGaPFYeeDiPMoXqoRCm7gALvdvTe93mKXt39+4zGIMTJj/7v3hcMdWCoonr/ HNn1HGTndg3RESLU4wuVGmv45/oVQT4JUWa/QM2H1uQLnaBXHRhmO5HbTpKro3bWQj kb2L+ReqkhA32Ih1ziedzjnn17fvhMngBvmXgV5306mwUKHz1tDe4js9uk2EbhVtz8 adS/AxBeyx1k/yNCfTLLwfF95xE02IIxfTfr0O4GSJSldEiKnrIka7E/J0ATMvtLQI BMeXmGHv/JITe+DMsWsD5JUFjbXSyDOHQlaLMiuak5Q9EvywcgAGH5DH8De9cb+HnQ 3o91WLK/Cvb+w== Date: Fri, 5 May 2023 13:23:04 +0300 From: Leon Romanovsky 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 v3 net 1/1] net: fec: correct the counting of XDP sent frames Message-ID: <20230505102304.GA525452@unreal> References: <20230504153517.816636-1-shenwei.wang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230504153517.816636-1-shenwei.wang@nxp.com> X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,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 Thu, May 04, 2023 at 10:35:17AM -0500, Shenwei Wang wrote: > In the current xdp_xmit implementation, if any single frame fails to > transmit due to insufficient buffer descriptors, the function nevertheless > reports success in sending all frames. This results in erroneously > indicating that frames were transmitted when in fact they were dropped. > > This patch fixes 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. > > Fixes: 6d6b39f180b8 ("net: fec: add initial XDP support") > Signed-off-by: Gagandeep Singh > Signed-off-by: Shenwei Wang > --- > v3: > - resend the v2 fix for "net" as the standalone patch. > > v2: > - only keep the bug fix part of codes according to Horatiu's comments. > - restructure the functions to avoid the forward declaration. > > drivers/net/ethernet/freescale/fec_main.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > Thanks, Reviewed-by: Leon Romanovsky