Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8418424rwr; Thu, 11 May 2023 00:34:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4j6CHurohEO/SsBgXqpx4F/VQq2vB5AjRGMKUeSYKfOnoOG2C+YihK66gnlXELgqxNm34F X-Received: by 2002:a05:6a20:3d01:b0:100:e0b5:aae4 with SMTP id y1-20020a056a203d0100b00100e0b5aae4mr14526881pzi.36.1683790444621; Thu, 11 May 2023 00:34:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683790444; cv=none; d=google.com; s=arc-20160816; b=INHavaIy5Rp+FBLWlvoUEjprz97bgHIuo3BLqZYa03ubiLsMX4wW739huslzej1z5y OoQmqecbVkOXyLWINOVhedCexjiVigqME75r/aqiX3YvxQhnKmVYHDLTqfS7VQ50d05b t4qPBBvLTW18tTyg1/M7UZCd8ik6DblLsswvtrnbTM2wpczNt11cmYVesCS5RIlUqFus gfmTO7O/F6agWKHwgIBdzUsCWtOk8zPWH1TIjX2HNqJT6+3wNTzXLQrXstQNqP8cUx99 rOhGsMDn5U8LuD6pMdLb9dgE0hwI9CFcNpOfxz5ZMdTthnmIc28M7+2QTnUayEhGH+kp NxYg== 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=m3wkvqFVOSOchUX90mxdfrPs3pxBupX0EFCZlSxL2pg=; b=eHdYkuyjVYMXFLXLrNr94D3O9KZvLlVgs4Lb345fh/f7WSKc1bjalaBijz2Nb/hbvK lHvo0uJYbDrjo3WXQz3xb3e6Cck/sySiIF35QCzdQ7kjqLgqLE/5akLfxZ/7gAS0YNny /wkq4AXLwRHS3E6zBeVNUdqKANRCt0WF1sZo3cs6E4YHy5168JEKdDHVN+dLIwHGe2aN SB76VEtoOeTXFEG1iQiy8hSu8USyHTJULp1jzQXOpl61o8q4PsTFw5ZzO+HFCjRUYmAB ajHw1Ju8USym63JvrNXQS8bnaeXClFuGWLNKk3Q0/7Y4fz7by5f8XnphJrK4G7NfPhoy VxJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=s9023dD7; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k69-20020a638448000000b004fb98290dbdsi6384353pgd.50.2023.05.11.00.33.50; Thu, 11 May 2023 00:34:04 -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=@microchip.com header.s=mchp header.b=s9023dD7; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229482AbjEKHZP (ORCPT + 99 others); Thu, 11 May 2023 03:25:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237690AbjEKHZI (ORCPT ); Thu, 11 May 2023 03:25:08 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 382566A52; Thu, 11 May 2023 00:24:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1683789895; x=1715325895; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=K1mgrZfFCls8u5NmU8XyZVTtBs5ziCVIjjKenDOXFvU=; b=s9023dD7z+df7yxHAX7mk9XQCrSfVifSO3ecYBEmWgvVDEhugD0RErsw kLTfypimc738n3tNYpH8uvlTR50n0KqjlH5k1VYBS9V5HOvdvqMiU60bN fhmHJ0adCbA6BZc2B7K1vDMRpiwShIuBWhCTZUqBEyHrAOWpY4iwm07uz MdQNEo/0LosQrfPdkLS6XCwR+d6xYNASDRagFy25f+MMcyZs8ToHjH/ny 4NPPrsEcgpc03k+7GQCztEKdoCe3/eiahg93+SlClgZuXazv7sWUuIMDy peg87tztdjhIx8cBAelxmG89l37k0SM3ZQEOIlBOlHMQlyOIZOFHi/dit A==; X-IronPort-AV: E=Sophos;i="5.99,266,1677567600"; d="scan'208";a="213383976" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 11 May 2023 00:24:54 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 11 May 2023 00:24:53 -0700 Received: from localhost (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Thu, 11 May 2023 00:24:52 -0700 Date: Thu, 11 May 2023 09:24:52 +0200 From: Horatiu Vultur 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 , , , Subject: Re: [PATCH v2 net 1/1] net: fec: using the standard return codes when xdp xmit errors Message-ID: <20230511072452.umskoyoscsxgmcoo@soft-dev3-1> References: <20230510200523.1352951-1-shenwei.wang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <20230510200523.1352951-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, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,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 The 05/10/2023 15:05, Shenwei Wang wrote: > > This patch standardizes the inconsistent return values for unsuccessful > XDP transmits by using standardized error codes (-EBUSY or -ENOMEM). Shouldn't this patch target net-next instead of net? As Simon suggested here [1], or maybe is just me who misunderstood that part. Also it is nice to CC people who comment at your previous patches in all the next versions. Just a small thing, if there is only 1 patch in the series, you don't need to add 1/1 in the subject. [1] https://lore.kernel.org/netdev/20230509193845.1090040-1-shenwei.wang@nxp.com/T/#m4b6b21c75512391496294fc78db2fbdf687f1381 > > Fixes: 26312c685ae0 ("net: fec: correct the counting of XDP sent frames") > Signed-off-by: Shenwei Wang > --- > v2: > - focusing on code clean up per Simon's feedback. > > drivers/net/ethernet/freescale/fec_main.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c > index 42ec6ca3bf03..6a021fe24dfe 100644 > --- a/drivers/net/ethernet/freescale/fec_main.c > +++ b/drivers/net/ethernet/freescale/fec_main.c > @@ -3798,8 +3798,7 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep, > entries_free = fec_enet_get_free_txdesc_num(txq); > if (entries_free < MAX_SKB_FRAGS + 1) { > netdev_err(fep->netdev, "NOT enough BD for SG!\n"); > - xdp_return_frame(frame); > - return NETDEV_TX_BUSY; > + return -EBUSY; > } > > /* Fill in a Tx ring entry */ > @@ -3813,7 +3812,7 @@ static int fec_enet_txq_xmit_frame(struct fec_enet_private *fep, > dma_addr = dma_map_single(&fep->pdev->dev, frame->data, > frame->len, DMA_TO_DEVICE); > if (dma_mapping_error(&fep->pdev->dev, dma_addr)) > - return FEC_ENET_XDP_CONSUMED; > + return -ENOMEM; > > status |= (BD_ENET_TX_INTR | BD_ENET_TX_LAST); > if (fep->bufdesc_ex) > @@ -3869,7 +3868,7 @@ static int fec_enet_xdp_xmit(struct net_device *dev, > __netif_tx_lock(nq, cpu); > > for (i = 0; i < num_frames; i++) { > - if (fec_enet_txq_xmit_frame(fep, txq, frames[i]) != 0) > + if (fec_enet_txq_xmit_frame(fep, txq, frames[i]) < 0) > break; > sent_frames++; > } > -- > 2.34.1 > > -- /Horatiu