Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5422453rwr; Tue, 9 May 2023 00:54:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7pkOUL5entPrffkUKfaX/06pfjqHmfTHJyp55fNxHh5dYpddCNjxtJbv7Nr1mORHuhJE7I X-Received: by 2002:a05:6a00:198a:b0:643:791b:892d with SMTP id d10-20020a056a00198a00b00643791b892dmr16610139pfl.18.1683618891176; Tue, 09 May 2023 00:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683618891; cv=none; d=google.com; s=arc-20160816; b=drQq+p1dLhNtEbbpTdXEMX7B50LqRhq7xwcc1WZXi5YAcxa+dxPJ0EFm9gNP50os4Y LnBptNDFLt+MolpsJh/eIYXODSbwsKBhKVuYmdwIGElQtc030OyqXPQMUuP24KTnQooc WSod5k/A13lb5HF2NOuDfynW58D+SClIxq0VjLaI2USFHqGgzEmP9vaJh31WoGDq5jHw +R4qvmrpkbzuGIylp4XMV2pM/9QsNZdBjd0ivWvhh+fRmwy3JfroRt2oQMPrnBBstGlp D7gEYR65Vlp4+azRFTUjkXK41NoTdgTFHnESnTF5Mibnu5QFdqwmV12UvXKHHss2RuSy juOA== 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=olo9pzuXKBIYg1N0LNE0fO7hBCZeD2EZtnDy7G0AKTw=; b=yasMmmVwQ79PNTWHTu8dIh+0EfyrkS9HiKrHrEpYB6igkagiLEpF/ArKCxRucPeLZ4 xZ+bY4cYLFB9Wh05wNboIumIbVkhmH9DUU5cRJpX2B8HWwEUA35/lC1t5WamJrBJX1Fz dHnnYArsQFoVor3vdX7kSpobtNByTAR6m8AZp0bFfodgCDq9On0yGHLPTlhFoOIQRobd 37VZeHeepz6CNRGyyp8SyLtGuIN7csBxdJdpHvuR5g6JCEbKt5HMKIV1VAo3hHb9G+lQ ueX6EfNDV5eZIBZoYQ118mT4XvP5+aQ0NeZYDNx/HzSyGk7rcpJgO7yu3gkUYBrJ34vP iOvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V5LB7U1w; 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 v202-20020a6361d3000000b0052c6e736acbsi975712pgb.333.2023.05.09.00.54.32; Tue, 09 May 2023 00:54:51 -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=V5LB7U1w; 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 S234355AbjEIHpL (ORCPT + 99 others); Tue, 9 May 2023 03:45:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234304AbjEIHpJ (ORCPT ); Tue, 9 May 2023 03:45:09 -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 22A817DA3 for ; Tue, 9 May 2023 00:45:08 -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 A70C861E99 for ; Tue, 9 May 2023 07:45:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B502C433EF; Tue, 9 May 2023 07:45:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683618306; bh=hQf9pNjF7zwQYcyl32iKf1KLzffA/L5NTPvBZwMUTgQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V5LB7U1w8G4yNHH3tkFYJG0rDXq46KYsBP33UJPdV3muH7IJ0NBQ+GLscVF4mH3Fl l/UG0wo3OZFH1I1zVYup3sEMAaSEytVom8vPwn+MQdBrkcJzyrfxPq3AHzWBnwexvJ qmsMzYkIRIdc1bs00SywKw5YmU1oRhyMMFAbHZGJ5QsWExGoolS97YzimyCLwMhDKJ YLHtjtHuVm7YMkq7e3o836Cbwi2EABhQivy3SAfag6PeYF/ZHy2uk+fLoKS+d5AbGL h6Q9m+bZST3sf8Oj27QIrlw0VDTx4pHpm+DEU9EQct67JkatYU+MwuSvDCPh0NABnz ss+U6ERs6r7Mg== Date: Tue, 9 May 2023 10:45:02 +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 v4 1/1] net: fec: correct the counting of XDP sent frames Message-ID: <20230509074502.GB38143@unreal> References: <20230508142931.980196-1-shenwei.wang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230508142931.980196-1-shenwei.wang@nxp.com> X-Spam-Status: No, score=-4.4 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 Mon, May 08, 2023 at 09:29:31AM -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 > --- > v4: > - the tx frame shouldn't be returned when error occurs. > - changed the function return values by using the standard errno. > > 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 | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) <...> > - for (i = 0; i < num_frames; i++) > - fec_enet_txq_xmit_frame(fep, txq, frames[i]); > + for (i = 0; i < num_frames; i++) { > + if (fec_enet_txq_xmit_frame(fep, txq, frames[i]) != 0) > + break; > + sent_frames++; > + } net-next has commit 6312c685ae0 ("net: fec: correct the counting of XDP sent frames") which has exactly these lines. Plus the patch is missing target tree in its subject line. For example: [PATCH net-next] ... Thanks