Message ID | 20230519020113.1670786-1-wei.fang@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp930481vqo; Thu, 18 May 2023 19:15:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4PYg1QFu2o893O7QzF5Ty/rwl5+59WxRQjTNPp5TkP0p8P3hALd1QweP4oCCbm2+JiX0oO X-Received: by 2002:a17:90a:6641:b0:24d:dcbb:6307 with SMTP id f1-20020a17090a664100b0024ddcbb6307mr1233777pjm.6.1684462524460; Thu, 18 May 2023 19:15:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684462524; cv=pass; d=google.com; s=arc-20160816; b=ho+J7//wkuVyMnBlrN+/8mEabCczxkRsyjGUVIHGRr5ByFNqCmDMphFhk/vvpZifmT ALBjkaUyLgYVygi+BDxtUsm0Dmv+YdFScoXcAfQeT1Pz5imbZ8XeUDRStmcTk9/nCFE/ kwA18pKdee1l22HMWwG+r5m1xhhE5+n3L/LDumpTzlvI1wj/X1wanh2mM1dbhvLk2ecD hBaAiXQGM0FnTxG/Jry0teKiwLe2HAfqqH7+0WpZzDoYbjziKNdKamls52p75Pb4urHe EV6vZaqC/9y9MUYT8+BkARREOekpKSmPoHRMKFxEVvADxUdKhKVfJMooD8t52mmAqyA3 O3hQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=pI7RMzzQIfplPS8sT705zsU+WpFrFiAugm+rGZViQNE=; b=NcyYCWkMHIujft07c0OmwmZoyItRt3gLxs6lZcXSY2Fz43vUE2xgyf+aHpk7D7aquQ Fmy+rflNhdVzoXaBNGlXMImh7eqrJWAULxH/ubE+b+eeFeh12EwtLF9bz353Lthjl3ts KTj6h1E5Q4c9mkMlDShOMIrK671GXxrjVCFub+TeknKsUQ+tXqdNMt6/rSE4Ok2mXfhS kkdcFi+SaBnjOnjWmvGFVp9d2m/cWoFVlII0QEscytsFyPRNsXu02R7mBFeHfoT7+d7G qHC2rXx8Eld+5CIQbuhVubBlzDJT/FKXq1ECuKm6LHhwSb4eB3YEwTtrzYBhYWGWcbRY iIFg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="fT4VAST/"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u189-20020a6385c6000000b005303bc552ccsi2822823pgd.318.2023.05.18.19.15.12; Thu, 18 May 2023 19:15:24 -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=@nxp.com header.s=selector2 header.b="fT4VAST/"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229971AbjESCFt (ORCPT <rfc822;cscallsign@gmail.com> + 99 others); Thu, 18 May 2023 22:05:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbjESCFr (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 18 May 2023 22:05:47 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2053.outbound.protection.outlook.com [40.107.22.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F08DA194; Thu, 18 May 2023 19:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g2V9ciIbDLLW2/NvHDI/YBQQm098HEEHj2L+O/G2sIAPC3A/Poh32R9ZxtoC5zWmkrJv8J0Bp/+fHmsVklHqC1lSLYZWLzfRDTmF8KYSFuRJvm44QIJnzJl0Qk4s4XOwkwMMwO5I271S3IC0JpBaVqes1voqQekQA0g+YFzD9f7LGpko/rPEFfVZs9pAmhB5UN30Abl2mtFp3OOU4nnRYZf+/lMVRRH3H+LP/5kGrTrhbFasva5nomdVRzLFUW27TYWq0XeFKmSPtuTyBOgGvKkSDYCXxaujoH9OWJwSdDWxp4GRAA/+2ekT2RebiGXhJNKxKqvJxzkRCefrAHcYwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pI7RMzzQIfplPS8sT705zsU+WpFrFiAugm+rGZViQNE=; b=LjhA5GKq+Y77fxaPbjbBExOjQ+xjE1qZrtlSDnEhnki8ak3P2f0d8LFS8qu0Ga+gr+B728Z3EtysVf/6ePCdgy885IfH5JxEL0V0Xi1MIm4Ih46hEYG26hQidrKRtHi529O0ezXul67qjUfLOnqlWwRg3RXG4i1I5IJxBPUk0XAnUVhr1RblBKG2s+19GBuTihkaim9/neB6bOi5kPXlf2cRRbvIDmntAYsowZ8JDywdYarYuomG8STfyGQp33L0T/7wpTszV2JDIiC+PVn4myXbTXkPh3wrJWxbxopvn5QXXXveFHhAJu0SNleErRNIjZnSX9d/mIdptPqqXYhfQA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pI7RMzzQIfplPS8sT705zsU+WpFrFiAugm+rGZViQNE=; b=fT4VAST/OYgzv40XymrZANFOWwpVxOSI2vd/hw4tjyJZSzSV4MB6UcVlsilQJcy1j6CzQbIJ1CNA4MHR3+SAcrhGTSxJs3nBxZwioSCuXQeww7MniP8csh0u6zDOqjZZZZfdjE4LZpR9nHNnwlsIAx5DwGs751sVRM2Vs93oN4M= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM5PR04MB3139.eurprd04.prod.outlook.com (2603:10a6:206:8::20) by PA4PR04MB7664.eurprd04.prod.outlook.com (2603:10a6:102:f1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Fri, 19 May 2023 02:05:43 +0000 Received: from AM5PR04MB3139.eurprd04.prod.outlook.com ([fe80::682b:185:581f:7ea2]) by AM5PR04MB3139.eurprd04.prod.outlook.com ([fe80::682b:185:581f:7ea2%4]) with mapi id 15.20.6411.021; Fri, 19 May 2023 02:05:43 +0000 From: wei.fang@nxp.com To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, Frank.Li@freescale.com, shenwei.wang@nxp.com, xiaoning.wang@nxp.com, simon.horman@corigine.com, netdev@vger.kernel.org Cc: linux-imx@nxp.com, linux-kernel@vger.kernel.org Subject: [PATCH V2 net-next] net: fec: remove useless fec_enet_reset_skb() Date: Fri, 19 May 2023 10:01:13 +0800 Message-Id: <20230519020113.1670786-1-wei.fang@nxp.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0138.apcprd02.prod.outlook.com (2603:1096:4:188::12) To AM5PR04MB3139.eurprd04.prod.outlook.com (2603:10a6:206:8::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM5PR04MB3139:EE_|PA4PR04MB7664:EE_ X-MS-Office365-Filtering-Correlation-Id: 436f0903-81c3-4545-a277-08db580d8d17 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y1jQPMCHDXjYVUAlN8REyN5xcdO1pYW74x8jgc1NHm50k0cKYX+WCHDuvagRww5EsMx/kC6/N0krkf0Hre3B4m3bjXeAdlK3qHtsaWMFZ4nhPhjUl7XrURjHDFduRDeT/4TdUiB2cPto4NGlDfZN6Zmhkw0fxv6J9lgtjXDPM/SEtVLNTpJlAaG7WJe6mF4K4TEpjq6JKjY4dQa9NNwgo/Y6eJousQBtcX/Nq5WVRpldFXWKgkpLzstVyo1o5JVjaFymv+GIKxfGRLP5rIVblcar8djrBoVg/M6j1CPx/O1zwnmUh/HlVg0B3U6hkAAOPH0JglaFX0tOn6wq3L7RkWo90MIdqxrvyS7mSkSvW47PCAgpjYhcIPRocVyiZ5mlipeV2ucjOZkNlybIiWigwGgZvo6LmNmrpTflcbumDKeJrCiNxtyF7u2d99d1EsrvhzlfzFgi3DbL5eXticvK9/asPqfl/8BLIdN4PfB/ayLHXIz2F0/xyBYDC9gARHAA3FeVdf3R5K+YFifv4U4/CNpP50mg7RiAo6Bq7yOGQBxHqWAnAKikUdnRgeVYxhoSPKGDNzORCegcv/ZDKpE56UR7u6keUxJzWoH0T3oscD3bTfcYNVDlhdRyvdVefKn8 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM5PR04MB3139.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(39860400002)(136003)(376002)(366004)(451199021)(66946007)(2906002)(5660300002)(83380400001)(8936002)(8676002)(66556008)(6666004)(52116002)(41300700001)(66476007)(4326008)(478600001)(36756003)(316002)(6486002)(186003)(26005)(9686003)(6512007)(6506007)(2616005)(86362001)(38100700002)(38350700002)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dSap+fJMtCgpNxD8hE+juN03rtD7ycF2ZAZm+hHzRKlUSXSQainS40a7u7Y+yEL4ZkPzk4NuyWgEpFIOvYADWIiOD0WlbdpC4TqVAXS0MQvAQtIaA7PRhA/RMVnvNRriIpPuCaSTmnSmil0OQruba3c3Ycg4LwRVhuKzuguu/ackuT0Rt0hOCq8t6a+1PQpdmA/YyrWS3w1YP8wZPWG5/v/SnN1A4xLDo2nOOBMbjAxI/X2GePg9yDcKlyyqdE9a4qDDGasxiPcbAv9+NNVsUPVimyz3dmLm7pZXZM7rTBI03IocT5XFDWa7Ug+7qlXP5Y/hgEq2GTq5LHmHnfoss6OiOzsK2gWDNE21fWHwyFYGQDEa8jhfge+QgCxP1Yl5r2lYgOajyi53Hmhpw9rxPlwg4jSI1WCyk8/C2cmzfUdL8rND6c0xZ3I4//hymBHru3mIuxM9aCyTqaYSketxCbpZnC+h1jYXnW5f9dXTvK1R2tHbbHnpoag6TpBc9MCCRnCxDdEbvLUuZbK94ZukqNaCv59ufEoE0xTas+f7ZxOldKXvt4dRWY0bjROcbJhZKJGWdMZ7JeMDfu1fDlprgNYtuirRIxhsTNN83WEjMyj4DpMjqrrqjH+QVUGamAi7YmI00+ZVPC1Su4Lc+LsGfFI8DaPQuCsnawjZmxerh7kI8JPVPYyHY866QJSt34F3RnMpN5Rt+iFhZ8q2lsczgAPSHFmu37wZi2WnyoXA5qE2QCS0gMPJ5y5nBqz//ZxxFxDrbbu2cMW6v0/gGU59h9bbHDac1nosvVYlAK3nwlJnjBJe6CUkAPycz8S5zqyXBEtlBujTF43rn5v7+o5Gc41gGBdpvMPbJ9v1BrGrfxW1YxyItRyKJhoJ6kR4bY3kQK23ih6AOTuXsLIb+kxswFYtqABipBWoLbSoBmrD9mAf6f4ja9Pgo61NA5fQ/GpoAbIkWdJQvoW693ziOmlcS3wMrFnAMgwwciJy2BOPrVqYHYN+5YQUf9t0vE8N/wKDBURlfAT927M/x5KHPVIXRdN2K8QcRkgG8YvFkMlJmsJLXzsvMQlcifFb7WofMM5RdPsGyKJg0PR7XnT31I9TopEmtO4sQ4H8c5u6zhmBFGYjHgs19qQ9HtPaZHHfw+h2zbSkWsimcULyZeQJpkncao3e2MKISDF74xsjYGHb8CQuLfVx50+7JNtaVgbmb/U+m29A10oFeafglQiHVyQb8TIako9Xi4asqj6rdNvOZbtb93pbTB5RZFDKq8GyOCW3gyoefTk+Ua1Ta9s+df2pPaT3dvtbt/lZtrgvj5RrX1nqcc6A5u5yI/Rtq3eZnAl3tTHa86Ld0l7CQ/B3f+prXMvXDNow65AfbZySHM9BYprdnlQRrWhXNFhQ/31uLppiHpjZpTEPa1Role8Ebz7/UUkLmNWCxNJlWcjLtq7kMHKi/6SYXNRmX88mNIBr3MTgojkjjoUM78M9/fdARh56n5eNlPPq54e+LTBn87iD5vMqXVs8tY/J7hI1vemC8LmXjz44XBqHK9FOmLqfCPqSO4zaZiEFsCWP2Te424G2Kktr5uApXFTLjatdRShrgG1K X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 436f0903-81c3-4545-a277-08db580d8d17 X-MS-Exchange-CrossTenant-AuthSource: AM5PR04MB3139.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 02:05:42.9760 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: boUYd3vxQz2l44OPmumXdEJ/a1+l9hf5UXPNkDTPnQogLI3ka9uh++3sZHJrsm74AfbnlRJGRkmW8Ekkc3vmQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7664 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766237539076197494?= X-GMAIL-MSGID: =?utf-8?q?1766286976455758581?= |
Series |
[V2,net-next] net: fec: remove useless fec_enet_reset_skb()
|
|
Commit Message
Wei Fang
May 19, 2023, 2:01 a.m. UTC
From: Wei Fang <wei.fang@nxp.com> This patch is a cleanup for fec driver. The fec_enet_reset_skb() is used to free skb buffers for tx queues and is only invoked in fec_restart(). However, fec_enet_bd_init() also resets skb buffers and is invoked in fec_restart() too. So fec_enet_reset_skb() is redundant and useless. Signed-off-by: Wei Fang <wei.fang@nxp.com> --- V2 change: According to Simon Horman's suggestion, it's just a cleanup and without user-visible problem, so change the target tree from net to net-next. --- drivers/net/ethernet/freescale/fec_main.c | 21 --------------------- 1 file changed, 21 deletions(-)
Comments
On Fri, May 19, 2023 at 10:01:13AM +0800, wei.fang@nxp.com wrote: > From: Wei Fang <wei.fang@nxp.com> > > This patch is a cleanup for fec driver. The fec_enet_reset_skb() > is used to free skb buffers for tx queues and is only invoked in > fec_restart(). However, fec_enet_bd_init() also resets skb buffers > and is invoked in fec_restart() too. So fec_enet_reset_skb() is > redundant and useless. > > Signed-off-by: Wei Fang <wei.fang@nxp.com> > --- > V2 change: > According to Simon Horman's suggestion, it's just a cleanup and without > user-visible problem, so change the target tree from net to net-next. Thanks Wei Fang, looks good. Reviewed-by: Simon Horman <simon.horman@corigine.com>
Hello: This patch was applied to netdev/net-next.git (main) by David S. Miller <davem@davemloft.net>: On Fri, 19 May 2023 10:01:13 +0800 you wrote: > From: Wei Fang <wei.fang@nxp.com> > > This patch is a cleanup for fec driver. The fec_enet_reset_skb() > is used to free skb buffers for tx queues and is only invoked in > fec_restart(). However, fec_enet_bd_init() also resets skb buffers > and is invoked in fec_restart() too. So fec_enet_reset_skb() is > redundant and useless. > > [...] Here is the summary with links: - [V2,net-next] net: fec: remove useless fec_enet_reset_skb() https://git.kernel.org/netdev/net-next/c/2ae9c66b0455 You are awesome, thank you!
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 10cb5ad2d758..e1975a3c7234 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1011,24 +1011,6 @@ static void fec_enet_enable_ring(struct net_device *ndev) } } -static void fec_enet_reset_skb(struct net_device *ndev) -{ - struct fec_enet_private *fep = netdev_priv(ndev); - struct fec_enet_priv_tx_q *txq; - int i, j; - - for (i = 0; i < fep->num_tx_queues; i++) { - txq = fep->tx_queue[i]; - - for (j = 0; j < txq->bd.ring_size; j++) { - if (txq->tx_skbuff[j]) { - dev_kfree_skb_any(txq->tx_skbuff[j]); - txq->tx_skbuff[j] = NULL; - } - } - } -} - /* * This function is called to start or restart the FEC during a link * change, transmit timeout, or to reconfigure the FEC. The network @@ -1071,9 +1053,6 @@ fec_restart(struct net_device *ndev) fec_enet_enable_ring(ndev); - /* Reset tx SKB buffers. */ - fec_enet_reset_skb(ndev); - /* Enable MII mode */ if (fep->full_duplex == DUPLEX_FULL) { /* FD enable */