From patchwork Tue Nov 19 08:23:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13879508 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2040.outbound.protection.outlook.com [40.107.105.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD1E71C07F9 for ; Tue, 19 Nov 2024 08:40:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732005604; cv=fail; b=CdFOJe4VnBs/71IjBfkCYZ1nZJbJoCDmnqkvwVde9OJ4Qmmj/kduH14MdcFMOdIBJEkFODf8Z/DXDJMrUvS5iLxfs/bb4UIvhQ7DBJJ3ijVv1ugcCHG1tdW7sFZS0WW4BwYEixw3FWuX6GzJQ4lRAauMCNwmWop9IcbpN12dzqk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732005604; c=relaxed/simple; bh=Kve0H5+o37kDdj12/XZbbiAVDS9NZyL01nZ2uyO52Hk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=dkiUGXkSpQcGA8+I49yRAARUwpQRYh6o1ioUSnRxOR9fAgUwNJ1Pgv4SohWyXlMJGkceAWWJ3COMHpnbBapRBb3K00QZJYnQxfbiDH99awnEqSUBTAR8YEtnQyRuUf3BRIKvlMkTWHFaUskS3aSda1/KkRQePM5dOIo4aDStVOY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=ETwhfEtp; arc=fail smtp.client-ip=40.107.105.40 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="ETwhfEtp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iWC7WeXmswOUe6AVklTjcsN9J6UbCyzTZlTxzO6Fy4Xk3E1j0axeRowTZQWWTBwvrxJ3rE5y2k7l9BQAimcCeZ3lqXwzn5mmCwi3AHOpq1lnU1vqjBXKnM/8rj0X/iYpxGxC54Vnd2NaqcxN9zdY1lMLffQvl1oCcqMQYs8Aaf9RFmwuCGylgK3+YOsIEdQ0d7rpye14PO2WZLu6nN2joWGn1iuG5vfsGdmr7eiYXJkyYRIB+JsvYLzyYMaghJ9590p7plJ3gcbRQh5ILwth/ZZ+GQKQsv0tifpPQVwoTkw2COzEqPq/wJbQcjwfbX3mZ4EiIl+wO/L1BM2dL1hIUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=uWi/3hfJJLhdUExR37GH35NJkVcvWklV8n+CoIbZYbE=; b=QPUjZjX8Mw4KTSvn1jtw6uFuV4EFHJuDnKnBfR8Naf2IjQ0rSh2WxAaT5RHS5XDFVeATWPtqWtYpTApBfHU/ZdOblcncoZ/hNRYRbD+JutkiqILR6XoCasgaBnN6fpFQoaxsvDJ2SZeAGBjPS9+rxVvqV4yaTD/pYrMS3ozTcZzCzDLqbjlE9n5N2h0XkbfDxvhZiSPmKjBUl7ZZtTvryu1DeHadgOTfSRqtkfFSRRPVF94dRAwsNBCPiOeFfwufSxeZSAWxO+ClAFxh4ckpufg711fqYFeyKPbYGp6/PrmfBvhQLsL46PhzOSgqDzFMS5sZDJqqnKwM4zhBlzEYvA== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uWi/3hfJJLhdUExR37GH35NJkVcvWklV8n+CoIbZYbE=; b=ETwhfEtp7o4GaARz8ur+o4maT2jTGkuZ754nzphPdTe+/ZYuNb7J5aoOa71VemrIr9K/140/yShVY0teM8lYRcKY3ci17H0zcuLSLgOmrMFUIRxN5dwdGxjff5k/cW77psAQbI8r7Q+d6d0pa9CASPOidOEEKjXwuaJHSmctT3jPuIb5Az2Uv7Ffa43DQDbaNrbu10/v92CVxY/ABpcRCt9WHyqJkf1KZh6D7dZxEWAGGINwer3O5And7unPQaE33nfdyFDbBQr87kCD73PI34To+5UH00AcNUmsxLwgvoKWd4Sw6chXn7HEKV5xmSYyLZljNy8VcZCyp6+teOn89g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by VI2PR04MB10266.eurprd04.prod.outlook.com (2603:10a6:800:22b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23; Tue, 19 Nov 2024 08:39:59 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%7]) with mapi id 15.20.8158.023; Tue, 19 Nov 2024 08:39:58 +0000 From: Wei Fang To: claudiu.manoil@nxp.com, vladimir.oltean@nxp.com, xiaoning.wang@nxp.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, frank.li@nxp.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH v6 net-next 5/5] net: enetc: add UDP segmentation offload support Date: Tue, 19 Nov 2024 16:23:44 +0800 Message-Id: <20241119082344.2022830-6-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241119082344.2022830-1-wei.fang@nxp.com> References: <20241119082344.2022830-1-wei.fang@nxp.com> X-ClientProxiedBy: SI2P153CA0019.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::10) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|VI2PR04MB10266:EE_ X-MS-Office365-Filtering-Correlation-Id: 6539f024-7d6e-4dbd-cbd6-08dd0875c054 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|376014|366016|38350700014; X-Microsoft-Antispam-Message-Info: 9ndT0OOpIa9fYBnGjwqQd1eFvYYaVHCDhgxpopQrM3gw70ZH1BRBjniF8MpGurzLb8+BSwB5psVltNChDew+0nmQjmDdURFwLH74QLQaKOIdpK3yaIuk09o5PuD9J31RuDQUIWoNmvHvp6CN8zg+k4lhAEpekk/sFZdwwoVnIwnSk8G2Inuu8upkymqF9vKSYqtpJaP0KctC5RIPVLSubjNnMhVIpdmNxeV3sS37+f/RfK4HnqsH9zdsUoOCtA64fmsn9TofQWFzhr9/vpur7qRz3HMa5lZ2ll5+EzJFoRrlZTvv8v80p87Ht2Y3qfhsOPPoFWKhOcogWmVcKEoAk7+ImRUbaRYe+DzHyFSL9S614Eoc7hp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PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(52116014)(376014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: twsroAGYTMD85alJzc7pxILrmAq4XMdKFlS5dYlMrjTLnoQ+xoT+1rqsz9bK0u7ikgjeuIwjrcif5m+CQjA1LGcJIlIjPlu5hnIcUQnd2W8Y+QjQHJ/6WVMmFyFyjyVrFS4sInbLjcPl6nhdYL2JQdm5hwylgF99qLCK6wJRjlmG/6sciVUNCQjPW8/EpE1YAs6i0zFQduVrpZjouDweY9s5k3sd3eoWT3uxd4H4jNqBbuMUJcbP+RRH4aNBorTm1Xfqd3nBS3LtarB91r1hRT1VXXe1uhv5WAcRLYDcOb0jrn7kTkP4oPJ5DrRt2cBVmdUT54scENHYT3OOFJiSwYPdHJfH9sbChh2gKlkSbNQZDl4ISFXLiBAx8U6N46k3BMvVunSF+XBxrtGjih5y8a8ppi6hmY6gnW7RGo4EWXLD4AXAiPKS8+Q4FimeXbfkkV4/FpVgYHMkrud5c53ckIFZ3yt7BKUS3wFdpG8Fup8L16daG2+Ho7tIOSQYOoEHcswxM8gy5tQiruJNKNwY96ooKgXWqbjx8xh+ubYvoJ6PBNbkrFz2SabWVOoP5/vi0PscOY7pgxgEDwYwSqp/BSvRnBusn3qpq+cg2VB27W9WDJHY+wD7igJXatMr6Qs4PLbtqqriJTwBf1EMmRnm7Jjy39/PnDHlqsGPTH5rBnu58V1z2wANw7YJYejFf7L89r4WZudHnlts4IvrNORqXTAUlRPJekcBvTOGrVgwjmfJQDW6nxPTwC0nna/eDqkF1Wi4brW8c9KWV7vlMqe5WRg6pqvtScWvhOUWZSOwCSDylwjlknb2rtvoQnnLncpSk+Jx5ls/N7RuLnliOYLzSEUpAazROVjWreja9DDX4/7bw4750zLzEy4PAYRlMtaiE/u+8M0eexS08MDaVTQRbM+4nX3gRzfYQ1vG9Gz0FGdpe5D8ajvlAAbNnxxe7K8G23MYWLFVR9ki+vsLJhPhNJZeZ/rnmOy5vr12hjCnxgrG7kxUxC8FjHLOizTBp741fw2KCWppqQR8F+ESqTxRnXGKDwFTS0526R8URLY7wHCHBUh9ERumVXzSgRMyLAhl7NtLhWVcmy7uFug8SSxlTJMrDi41A8acecb6A4/ZW4j/T59//KbO8y/CShSbpwM/a2alnasfElxGHGjsNnGXG+9yB0QHUb9blOitT3kn4vuBJqU12ZMBwPASJepKUG3+vKPxsp/yr9CTyZwjsjZyFXj+anvcW1FJY9TbF5vnyVn2gSDSxHMlf81UlfKftd2ZJqgy+2cpz2TS751FfU7v9WgzcihX9qYI2jbBl0AQH8xUXVhF4vbJMPN7PnNOK0nax8QdzzUqCLrtO8G+INsmxqECtvNiwLtM0sMHyBFDiYWsZHt6wHNO4fxpS86xRU2wteP2nz4Sy5tsQi16e70tQWbXzEhZh4GIj6qYLRFUu3+T0tSbAznxOxmg/wKZkyuPOomka4wUIMTJ+jp1SgCVSPCq1fvOr+bzI+MhwP1ydZrIbQkfgSHMG0YblixcxUtSWWO7UP7IYi0LF8AQPOJhWwy58odcITPSzgzAyB4YQ9C/IfsPuTpuUa3pAdHqIzvf X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6539f024-7d6e-4dbd-cbd6-08dd0875c054 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 08:39:58.9282 (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: zHL8V2r+qf8z3g0eoZ87+Ji9hoh/h4pMkNlPT7iytW4YW5kCMDtgDF/to2eUR3jR6oJE/mDdUoWRw5P+RwYxSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR04MB10266 Set NETIF_F_GSO_UDP_L4 bit of hw_features and features because i.MX95 enetc and LS1028A driver implements UDP segmentation. - i.MX95 ENETC supports UDP segmentation via LSO. - LS1028A ENETC supports UDP segmentation since the commit 3d5b459ba0e3 ("net: tso: add UDP segmentation support"). Signed-off-by: Wei Fang Reviewed-by: Frank Li --- v2: rephrase the commit message v3: no changes v4: fix typo in commit message v5: no changes v6: no changes --- drivers/net/ethernet/freescale/enetc/enetc_pf_common.c | 6 ++++-- drivers/net/ethernet/freescale/enetc/enetc_vf.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c index 82a67356abe4..76fc3c6fdec1 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_pf_common.c @@ -110,11 +110,13 @@ void enetc_pf_netdev_setup(struct enetc_si *si, struct net_device *ndev, ndev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_LOOPBACK | - NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6; + NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6 | + NETIF_F_GSO_UDP_L4; ndev->features = NETIF_F_HIGHDMA | NETIF_F_SG | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX | - NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6; + NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6 | + NETIF_F_GSO_UDP_L4; ndev->vlan_features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6; diff --git a/drivers/net/ethernet/freescale/enetc/enetc_vf.c b/drivers/net/ethernet/freescale/enetc/enetc_vf.c index 052833acd220..ba71c04994c4 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_vf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_vf.c @@ -138,11 +138,13 @@ static void enetc_vf_netdev_setup(struct enetc_si *si, struct net_device *ndev, ndev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX | - NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6; + NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6 | + NETIF_F_GSO_UDP_L4; ndev->features = NETIF_F_HIGHDMA | NETIF_F_SG | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX | - NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6; + NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6 | + NETIF_F_GSO_UDP_L4; ndev->vlan_features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6;