From patchwork Tue Jul 18 09:09:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 121904 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1620578vqt; Tue, 18 Jul 2023 02:45:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlE40MjXFk0+ZXEfb/tu95kKAln0ia9cgCc+JH9pJ8KFTMp9c+K0EYW3BqVpKAI4UZQ+atj2 X-Received: by 2002:a05:6a21:99a6:b0:125:4d74:cd6a with SMTP id ve38-20020a056a2199a600b001254d74cd6amr15199423pzb.3.1689673523260; Tue, 18 Jul 2023 02:45:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689673523; cv=pass; d=google.com; s=arc-20160816; b=e0xZvgQGaQA2WbVfmOnk8EE/zrgIIIkMjIaPIRBnmPtIuM3DIe9ynSYlvlLnabN4DC ci+SeJFe+rdBbTEIjFqPYRme3svqgzlKc06GyWLdveVA+/ZMoZiGq4yswsakOQEEyzHJ assFnOCA6AZ0e8krgqTcSwPnXgDbdgDeNAAUiRvsEkJqgefpjAEEQO7CInEoVhW7Bhbc sGERaMymwVBQsaLBaEpnxXUPLK+capAY9fwR1O/riMF2sFO2ahkTI7ktljaAvsxiGIQo X6kFnth+MnjcKuDG/B3puHPDCa+urwCSJGdAGwcuq4zqugxudlyWh29stN3krqPBklaK EXfw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=X4mjbKivz+LL02DbYultiLe/mQihV1fCGeOOdCUq7W8=; fh=fjWBy7/0+LMOsV5GFfetDmENPF8DM6xG02s2LAJ+ajw=; b=0iThiVT6qJwg6eEcNi0/oBpsuTl7wzVQHAi4iDWeq/5UMJsTBdYEQFr4wHMjHn5b2B ltZKWT/Th2um7U3S6Nqi4Lq3NLXUfp+gXLWXGcr1nLpEkAamtTUyK1m5Nf8ShjGJoTNO ZqlNv46GU3mpfHAH6KB+jtkOySz5c+Ok/2s2PaYGBTzKgY5uXSLqGyE9tVu/SEGi1pGb MeN7CGQNfAVjo7Gh1nRox5Jl7wbnqYa8sXGBcFTvHRlAENvgW6pwHDzy/JQPd0Euuhzs TaCj8qpvDQy/tP4CMWzrQOOFgL4b+di15NSohoFiXBigekgPH3unyEKmcu9aRDeOg5Pu ml3Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=dQOk9tmB; 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 j23-20020a635517000000b0055bc2561b6esi1313256pgb.673.2023.07.18.02.45.10; Tue, 18 Jul 2023 02:45:23 -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=dQOk9tmB; 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 S231629AbjGRJQW (ORCPT + 99 others); Tue, 18 Jul 2023 05:16:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231167AbjGRJQL (ORCPT ); Tue, 18 Jul 2023 05:16:11 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2048.outbound.protection.outlook.com [40.107.13.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E89F10C4; Tue, 18 Jul 2023 02:16:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P7w8d05Pf1A7pN7lopUOrI32IVbK5DELLcf4RWK7GZLkN4j14FH0KFNTim6nkhlk9JcyMsCdpmzqgoFujNdTmuaNlpxvbvpwvGQ5LY0EN9AW/o/3mk6pXNspm+Rp/c9e6SMkZNsI7DwpzHHmKdcyoFyC6ea5bqbAefG+41bNUI7u+nqJLW9s3Jd2h3oaPRnMXE34Q+g0Ev50F5mODp4fXvAc+ox9oJQlJM/FXssv2zAlEGxBgx8dA4/Yi/aquwUO+vO75DoXyHNX7zQr82eSSTYrL8wLsh7+9m2zwwCWhDtoU1eDZFZg5AQm1Xwa8Ga3Ri2pVS1UTVFyhJrlGeMI8g== 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=X4mjbKivz+LL02DbYultiLe/mQihV1fCGeOOdCUq7W8=; b=B1TPPPj7Lyw1TERYkwcTKgOeIvJ0feCcs34jLNaVjS6uU+F9xZvwFmQnFa+cXnzHL+8T5LSQKmgya7FwbyHlX5cXrVYEvlhdwCgQ8CPn4sAfepdb5KO4mYW93TnDhU46nCExVEmJiTouNh+3WLBNxkThPXGFONDODgddFizHzvn4Pt00F7XkhSU+tXWOsTgV2OB6JwUqvx+aTR/vi3YQsyl1kswZiPGAkFwv41vnc3wveD6H8rzWY5oPV+ChzIoUhwY0I/oLy5jL7NHcPeApzA4i0pOuf5+hVovJJAw4NDPvU9PE+kXx04AAG5Z5SWtk9JMwfMiFCELN9s1k981OVw== 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=X4mjbKivz+LL02DbYultiLe/mQihV1fCGeOOdCUq7W8=; b=dQOk9tmB4/DAwUMeOR/tHsnAkhpnpgkYkJ6Wn3yEPNZFvlABM5BDXcfU+FDmWyxylZ5ZX3QZYFELtsplBulqJ0fzpvrrBmZ7LZ8aXvw0xQdsAdxgOmv1Ljp1yKyxx4GQypy+KhOgnelD6+evsLcnZ//mRx0FvqTJZ/zzP3/1xhA= 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 AS8PR04MB7832.eurprd04.prod.outlook.com (2603:10a6:20b:2af::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.33; Tue, 18 Jul 2023 09:16:07 +0000 Received: from AM5PR04MB3139.eurprd04.prod.outlook.com ([fe80::2468:a15e:aa9b:7f8e]) by AM5PR04MB3139.eurprd04.prod.outlook.com ([fe80::2468:a15e:aa9b:7f8e%4]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023 09:16:07 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, xiaoning.wang@nxp.com, shenwei.wang@nxp.com, netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH net-next 1/3] net: fec: remove the remaining code of rx copybreak Date: Tue, 18 Jul 2023 17:09:26 +0800 Message-Id: <20230718090928.2654347-2-wei.fang@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230718090928.2654347-1-wei.fang@nxp.com> References: <20230718090928.2654347-1-wei.fang@nxp.com> X-ClientProxiedBy: SI2PR01CA0034.apcprd01.prod.exchangelabs.com (2603:1096:4:192::9) To AM5PR04MB3139.eurprd04.prod.outlook.com (2603:10a6:206:8::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM5PR04MB3139:EE_|AS8PR04MB7832:EE_ X-MS-Office365-Filtering-Correlation-Id: d716ef09-30e1-4050-a2bb-08db876f9e40 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o2zBp8sJ6oY6Zr5ywN+Y2a3M7YicGh3+NVBgbrpSeby5SqXpYSe9G+RNUFGfmyuqldkdCjmHvXgBfJNW6MEHuRMPCFI5P0uEgh99BTqtFI4xGQb1g5v6K/V7z/DgFdwi4aPyOLTT1gSexRwM6gfFrDBgoJSCCPd//LfamDRYPLfi6T+lWgt8N+iOupHyBrb7Lpka9148Thy8mYZdJfamvXsqXC4nCjv6sbk5O53P5h5bnNjZhZvpkWsJ7BQ/BtPZFn1JMGgbhaaFgo9a0kDsi6oj4Yi3oLs3L0n0z2GGoUrfBK0Qu3zdyw7k1B9QhM4YQfkhf2dk7ybp9vtekL0CC4dm3by8X1TagIgqfqaTCCP6bFjbB1GBfkflAFDzujiGvt/z5jgZRXYEv4amWU6JvuVpYyEAbvr3pI2q15HMZCbPO641k2QWni6SlB+XfpZZhQxEIt4B8zswlrCiMTEVP89TwLXmWHKs59FFsy0yrKbEY/bYAzD0a7wI/4Q82KFvGHW2K+h9N7NlCS8AkBa6KicV0pzhJiKLLqwQ234eT4c5DNY6AtFhou8mG07ag6/5VcYMVvyjJOZBWLfJSLEdB09XpJEV2dGbE0ShJNACqfJUF6TqeKc0LhVFQiqcjqVd 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)(136003)(366004)(346002)(376002)(396003)(39860400002)(451199021)(66556008)(83380400001)(2616005)(41300700001)(5660300002)(36756003)(86362001)(44832011)(8676002)(8936002)(38350700002)(38100700002)(6666004)(6512007)(316002)(52116002)(6486002)(66476007)(66946007)(4326008)(478600001)(2906002)(186003)(6506007)(1076003)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dnzKrugysw8uc21sYRA3ZQQCWN9z/npCbbW7lrLylSL4neE6iwUzidWqE1/LgeH3nKJDk5tcybul7easwVpra1JhQ1jsRuRFTPSYszr4yJTPS3jDXeoUAYIrTzgn2hgxbddOCNRGhbqCt3s6HEgwav8BnrdnXXbe29pQrpj+40+YUTkLS1jzAHAG9PKM29DGC48rV/Z9FfQs8MVBQkdllY31hrll4Df/MPY8GwOE+aLs5uxfHfoGID9I1+2Nd6t7vaesgGdxXlkP9jyUk2AIZQ6/pQtpi8ObKSffTK4Aw6tZEoTtPyY4a90+H9TuzNTnU//5NAh5y3ZtEfJp61kwiddw6SrcQDcIRxplTspeODnPCIPfuDxt0daE58SIV8ONkxc2YQioJqj7M2pmgSZJ+uTiX4XDpkK7+t7AH9w8AM9LnukUbSNtqHEI8uZ0eQm74SSDIiBF83nYndXW3FjHrKJO/SYtbET4iT7LvU+OF0diByhjSj58ZfhELK0B3uL8oKogcosjII3hBmqVmmQSYwxLUjG5amWjg+gCxm98mDksgkjtO8DJRac5tG5aC58ZIfTeMO9plsL9OscLdTe9dWJNiiMb0U1KvQXUZx1qYNt91/v4KWopWjFI9+o+YLbL3lG6xv+JOWAoymrbVHWnk79y9kDnBr6plNSVkb7LKOQNMYlGoVTq5DIh4d9rYza3o9152tlMkS1hsqWCR/txQVtibryi1cuvUcasT7LeWbWdioNgj4usnHGzaeqCyaFQ+qoEY07RCbkpguIyLJbobpDUMO+5/iAG/omr3LBoos4rsJBsSXlfCzDYGEogy91SzfZFrcR0NoK+gDYR5ovP/il6lhAvtfOsUaxfBFQCmC4YThtjVCBtFlInKNqfFdsw3HBJKxfqaV4kaEPUmryR7ku03bffHk7mi0Q7NTycFwIfDGJteK37MCJD85+Q+nLSdFnFGRzbTEZGkNVQBtgRG8VWVR/EHqxRNC4AuAjTHBGfr+KeUDmK3SXKgN34bLYM5hMLBHhPDi5990YEsykPeaKosTSVss+0Z/SLrzr/5kdkM+mL4C9sZTMLEl4RF621ILv4UG/UXvtPJKQ+0wtYZEKJjJ2n0+VH6SWFffPyYfwlO8Ufn91Y23buDDIg2j85Uwb5ZUwejkn0K5KFXT9vNLz2PB/o6B5Ms+hoyre/tc6T6iA7U54rQMXNf6SZ0dC9S1rFHKbSDyzCLnQyXQfgyOJYFGvTv1bo9U0egOoni3UiAKGqSngbPmKePu+fUZn8CWCrxr0g1BXoS/xdR85O8Z2+JlXoO0YGNk1kjAluidFAnMJdf6alJ14St3yohAN95U/v7hwSZVemv3ofcFaHj0xnNnk/F7BPU1o/ox/r2nOcbFxTyzhIUwzkI4ppzxGKEvjWpYlGmAC+tH88C30/SJUZCkUvEiJS4F5Loam/szSoiOCnxYCLS+JQ9WR2evxs8Rda4hTNwZYQK+fRCuFGLJu34GKmuWYsK9z7n+3tonAbqhvwCMjbsbRoLtN8Vkt7YGVuDTuSF6r3+GM/po/tkR+hcPOYKcO5nBvuR3tiA5xH4mZXTpi3sBDPMMzbLAyU X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d716ef09-30e1-4050-a2bb-08db876f9e40 X-MS-Exchange-CrossTenant-AuthSource: AM5PR04MB3139.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:16:07.1027 (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: oYyv6pnQIuA8V2vZuPSscP3X8VDZ84vWCyPmjKA6i67Giuyzsyaxv7pkuiJ4ywUqLG8Q/tKEHBNfGuqTU7rskA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7832 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_BLOCKED, 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771751104613262554 X-GMAIL-MSGID: 1771751104613262554 Since the commit 95698ff6177b ("net: fec: using page pool to manage RX buffers") has been applied, all the rx packets, no matter small packets or large packets are put directly into the kernel networking buffers. That is to say, the rx copybreak function has been removed since then, but the related code has not been completely cleaned up. So the purpose of this patch is to clean up the remaining related code of rx copybreak. Signed-off-by: Wei Fang --- drivers/net/ethernet/freescale/fec.h | 2 -- drivers/net/ethernet/freescale/fec_main.c | 43 ----------------------- 2 files changed, 45 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h index e4b5ae4884d9..90de14975837 100644 --- a/drivers/net/ethernet/freescale/fec.h +++ b/drivers/net/ethernet/freescale/fec.h @@ -680,8 +680,6 @@ struct fec_enet_private { struct ethtool_eee eee; unsigned int clk_ref_rate; - u32 rx_copybreak; - /* ptp clock period in ns*/ unsigned int ptp_inc; diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 1063552980bc..d33bf7979430 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -327,8 +327,6 @@ MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address"); #define FEC_WOL_FLAG_ENABLE (0x1 << 1) #define FEC_WOL_FLAG_SLEEP_ON (0x1 << 2) -#define COPYBREAK_DEFAULT 256 - /* Max number of allowed TCP segments for software TSO */ #define FEC_MAX_TSO_SEGS 100 #define FEC_MAX_SKB_DESCS (FEC_MAX_TSO_SEGS * 2 + MAX_SKB_FRAGS) @@ -3065,44 +3063,6 @@ static int fec_enet_set_coalesce(struct net_device *ndev, return 0; } -static int fec_enet_get_tunable(struct net_device *netdev, - const struct ethtool_tunable *tuna, - void *data) -{ - struct fec_enet_private *fep = netdev_priv(netdev); - int ret = 0; - - switch (tuna->id) { - case ETHTOOL_RX_COPYBREAK: - *(u32 *)data = fep->rx_copybreak; - break; - default: - ret = -EINVAL; - break; - } - - return ret; -} - -static int fec_enet_set_tunable(struct net_device *netdev, - const struct ethtool_tunable *tuna, - const void *data) -{ - struct fec_enet_private *fep = netdev_priv(netdev); - int ret = 0; - - switch (tuna->id) { - case ETHTOOL_RX_COPYBREAK: - fep->rx_copybreak = *(u32 *)data; - break; - default: - ret = -EINVAL; - break; - } - - return ret; -} - /* LPI Sleep Ts count base on tx clk (clk_ref). * The lpi sleep cnt value = X us / (cycle_ns). */ @@ -3240,8 +3200,6 @@ static const struct ethtool_ops fec_enet_ethtool_ops = { .get_sset_count = fec_enet_get_sset_count, #endif .get_ts_info = fec_enet_get_ts_info, - .get_tunable = fec_enet_get_tunable, - .set_tunable = fec_enet_set_tunable, .get_wol = fec_enet_get_wol, .set_wol = fec_enet_set_wol, .get_eee = fec_enet_get_eee, @@ -4525,7 +4483,6 @@ fec_probe(struct platform_device *pdev) if (fep->bufdesc_ex && fep->ptp_clock) netdev_info(ndev, "registered PHC device %d\n", fep->dev_id); - fep->rx_copybreak = COPYBREAK_DEFAULT; INIT_WORK(&fep->tx_timeout_work, fec_enet_timeout_work); pm_runtime_mark_last_busy(&pdev->dev);