From patchwork Tue Jul 9 08:24:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 142250 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 459A6455DF; Tue, 9 Jul 2024 10:24:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1367F43274; Tue, 9 Jul 2024 10:24:28 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2121.outbound.protection.outlook.com [40.107.237.121]) by mails.dpdk.org (Postfix) with ESMTP id 20D7D42F9B; Tue, 9 Jul 2024 10:24:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IQMnP8kIx+8yB+nnTwb5GIIavgbGs7QEA6lkzS8V8n4cCFSIa6kCWKTySJx0P61VQhKUvozhYrVZNj19KeHPoW2FSwazplWHV4Bx7WfxdBow9JZuP0cvE6pc5x+dOjb/xlSi+KUBrSy8/jwipwD6tTgcMb71YMdbHE7a1CU1XugXA2Y/szJeuUqrveW3vr/C/zTx4FTY/KXoKry6tAO6LMGTvtuLUBHnpicBWfIxvd+l9segSkVYilL2MMJ1sevr33uN/+2X/1fqP+cFsiedsnseai21zpmrrlQo0dRAm6ZpXSlNlARU70bYTPiWMjX+REqxnu9y1WpYWiWqB5pIpw== 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=gEJCS/CjDLMClcnr/HTthA2BY48coHHDjnpGgT8y8bE=; b=AScDHAV3RYoffAAOP+rLcbDOKNAW7cAZPcZghWn0SlOilXkACDO38l3bac4MidMBo67YSAnPg70Gv6XsdnIBD74ahYErHBJUrET/p2feQO2IGClSxx+YkDH3kt8FYbbonbumtT54xofylzCyoLB3/lw4akp7AFT7J8Emz4k7gRgOoblr8dnN1ffZiYGPgRrhiu5JU8iYu3Hc6re239Jlu4SPy+wahU0Q0CGr2zDvFbQWlZCXXnqsd6ikuLk3x/7PNt8Pgl2iEMKRqfcnd1tt9U3wczeJLsYjZS+6LHy5jyIjEjwJYHIS6BgMX9TmDF+cFLoWiBg0L/c39cHUanBSsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gEJCS/CjDLMClcnr/HTthA2BY48coHHDjnpGgT8y8bE=; b=m4tnVKtr/YzI7/N4s1I6DKgPaR/Tl0sMJ9mqB8uerhB75thMif4O21Pho+VblJOKGy17rqdljPSHVkPP8Cb6FD/RgkbGagEPofaYAysz4JoJVafWlLttZHb2tTDewiYU2noa7VCNCNhMWFzb/eCQh1KxNTYdC40Zv8PP9g3tDRs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH7PR13MB6194.namprd13.prod.outlook.com (2603:10b6:510:245::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36; Tue, 9 Jul 2024 08:24:24 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%4]) with mapi id 15.20.7741.033; Tue, 9 Jul 2024 08:24:23 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , stable@dpdk.org, Chaoyong He , Peng Zhang Subject: [PATCH v4 1/5] net/nfp: fix compile fail on 32-bit OS Date: Tue, 9 Jul 2024 16:24:01 +0800 Message-Id: <20240709082405.248641-2-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240709082405.248641-1-chaoyong.he@corigine.com> References: <20240709072921.246520-1-chaoyong.he@corigine.com> <20240709082405.248641-1-chaoyong.he@corigine.com> X-ClientProxiedBy: BYAPR05CA0064.namprd05.prod.outlook.com (2603:10b6:a03:74::41) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB6194:EE_ X-MS-Office365-Filtering-Correlation-Id: b80e3b58-304d-4d97-e8fe-08dc9ff089e7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: RuNblkgVDAV+FfsxWzrOkT4sXp8QOsO5woPKCCUTObFi6tBBjECbqF+a95IAwtfOKdasMhEDQcOnyFZo/hfRcsQksII9GqiTYHljg6Us5lF/ukZO68nqU5pKqjfxypq04SjYWprVqZpNSAzvVcdrdgdwcLCayBM9abM2fsVSiWVx3iGEuidr625F4uCYGzF+o0+H89DbQ5tFNfQFdMBB0NBfzut8oMZ4nL+PS2HaA1XGnks8/WF5CsJp+PZq7B/R3O5u7PpMx4Sd4+JIdUW5bsZwyJYFAIBu4soSsKsoXyE8XPcajGe4K9MSsEeyaFz3dwypjkHOiCMquUFr+HbVR3I75jqfCowjJuFtigUqXcFm/n7U4wgt1RYVf9NXa6gsFJxItTuqYKnFJ2jiWYAxIjnJ/gdMeIJHjYTmWeoLk1LpLxl+CnOj1QD6tokOpDw2EBXd3MmYhN8iVedNliryT9tYfJDaOKnK5JqNXB3+H7SPelRlbK87Qf85i1Uvpij2++M73bpgmwq5t/viJ9xDLSlqf1JpJt9iHnvyYsbl0vPkL4MV5yrvraBwhwPSFCNuIF96M777/XHtoArgMCISm1f8QNmKCFxappTeWUQL82/6IpPKZjxseUnTlfAe5UdAo9//JnjZABciQtug29SPk7yoRzHsRF441JXVSCSsUY73x/VWo5Rn4k5Yh+13OkFzFj/Sr8ja+k3JN7IVGAW93P2iOrkXIg5rP86edM4e8T5y5/oaECpDWn5iYcbxZoAEx2foZkQaQDVpR/+QtyTF+LgNDeX0YIe1/LpoCGQeIQT0tD4bm3ImcVEQwIF4Ofj0qAMhXWGeNwtCpfzhDywBLxxIODGhDqtU1aGOMOjNnuwFY+fcwPAenKYOJOb2ejmooRQ8qADhqR2HHgRLtGck5VtPVkjnehUHyTka7043HN3UVTf9G2Jx4PyAvclTZ+t4Ay423hm0qLVBB2NHH/BWYeKSM9evWvPaega6yhTr01Mi1OnUyJ/9/WimFY63XlpI50Ez9nCgDKHVzO8eBMPUsRSc4uXA+MWD/2Y2nZ2ESuN6IYVveAtLzuWPuTDnaZi8rsf+yCi/jaz5Q7O/zy4+/XqtcE0oTx9YCrjDgrr8vDbaOaaJ67mJTFKrHeafIIc8YY6FRh5nZccGXmyg5AaPxjLGVq1cG6+JpHlRaG6qKzsWapDLra5kUPTRpmRJfoc6N+0hseaL27b28gTgepQgR4THKLMnZPlSjRXRWG3aktcYlqMcMX1XFs9erTfxidJhm3vOag79vkZCO9DvNqyPYXtMv8NRF3hZkLnGQKjXyH0NlQee/i4Gec8kGwRKXgt2OTnyF+fQlWD/hpiEqS/AcbPoUrDuBPwvrEgdua8rqGSpGo5ExRs1iRgb4vm2ZkMICNFz3CFvg3rebjvdFfByPA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vzX6H7kZLbSHqpQAPeZkRu04wyu3DEVp9TvAgXYTw0uPz6tLsRM/4c3kNON59Qc8ZN6Kw03G1aDmAm7nUVN+T6N2f77wtFbyfW16GR5TOhYRHKtOa5hQ1KpuYOGRMISxfJDNG1SCvEIKmrxsSbA7NNGbfilaDOB0132OJ0FAPsjUOcgecZi9x4pllojBZl29EOTIc4iFPKqL8NzXL6xydJgAjTcfYd0epe99bCk5++t/CEYEsAxW8jk1q4T1HVDKMQ/LmSt5LpJw+NY4LU7j9kD9i2aGYnBWYjzo/1Apc5aahLc+k7JVlaIUWCJr8l8sPr/iP+5AF8H0AxSTfBWF8RLUqfRUeBoh7fv8CW/we3pqoSmDyucG/PjbgYh2P/NLajEEBG8XR6Iq9wTSai/Vu12ZRN0ExdMQnKVAl+lCSTnMq5bdeP4lMXQjKh+VXjcxtFbaXKzSHmGXCygFgJyIn3a8cQz2d0ihXzI+pRzn6lVHwYpkBuFuvOvv0er24WzsCVbBZzX8Mv1WXwF+JbodrM4DJ4EDbKKYSD0Fi3cdpJF5ytqscYvRmnMX2KQxyjIcDyVhGMJu+b4d0gl10bJkf2+tml3KwFVnGzLOmVPqsQ79T2rTfl6y+q++dRD3J8Igc8/O72w0VWlQXSK4p/+10gAnPqz4jIRUK0PcyJq2YqYbeKogQEtNAHE0mrQoodTTNKUM8BQviovSfQ2OQ0aFQNFLqmS9AKZei2t27GuJS/m7J+q7I9eKh/BoInopyH3gvtsZPK5OHV3HrKcjJNoECObxvCu3HDuqLZi+PAPKhO11qiVMJGOtgiE36Byx7LZsdeg833LxCrYf2ygZJrM1C9NNf4TfAvBjeUGNbhm70CecU/GrzrnKsXz6l93NXiOPVMSa8X3OCfuYPR+FMVmyAQSUFvMPBP2xEa5Y0Gboxx4TFaPYWf+wXbn5hQ++NigoUrgA2fdbCU8DsH4KksHHrK1ry4TH0z9KBXbkTvTzUknHydRuuq2zfYh8DEvDoC89QH2+udPAO/QMCXhMddQhQhEAmUgOVglNXa3rpTOIdEB1D5xWpyDcekeOCm950gMp7rRWzbrrRUcBCOsItCa964E2e84LhtbS0jlTKCCT3bUswO7LdDnk9qofshO4Yogi1Zb25iZlhuYwBIW4e055hG96ekSo034Ls4fveRDQQj0ij4hOipKGszvqDLqKa/eK4akxpq/xe/lakkSsfLqa0YuvssZdLaQiqaqZHxmQOtG0X1xrM2WpqEVhyEgARCD2n6Yz7BOYsxXbc752FO/83iKWZZdd+aNa13M62XOj7rFo06/nYJySjYvGIuZ08i0BxhFpGn4xDXxbEqNJYyKienGlUS6i3zBX/CPqTzJSl3tGb7rDeM5tRvEzYtub324X1GHMqGEQMuijCQEyy8BALW06/fY7nbCRTH1T0x8PTzuH9cIWiOMXPkSI1m0haNTxVv73AkSg5UQZmmqxqk0QW6UCjyVH/fQ5B4+gIz/0UUKbFNAZkoz4qEwM1a9PyaxXOs6jtg9oBQol3Qr4bmViPybMzLxKEbPKZr9IXfJktWmfBhYazP7bPccASdnY2nzXcsRUBXRnVyh3nDmOZZBrpA== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: b80e3b58-304d-4d97-e8fe-08dc9ff089e7 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2024 08:24:23.7712 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DqJ64QIzibb9eWGyDX281Q1UpIEawKUPxFTEIUfTLR6not4DL2MkNV9k9cUFV4yQehD7plLzNDBMLe1kYhrBEK4y+IP77MbH+zSHqMvoz0s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB6194 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Long Wu NFP PMD only support compile on 64-bit linux OS, add exit logic in other conditions. Fixes: 8741a9074536 ("net/nfp: disable for 32-bit meson builds") Cc: stable@dpdk.org Signed-off-by: Long Wu Reviewed-by: Chaoyong He Reviewed-by: Peng Zhang --- drivers/net/nfp/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/nfp/meson.build b/drivers/net/nfp/meson.build index d805644ec5..7216c8dff9 100644 --- a/drivers/net/nfp/meson.build +++ b/drivers/net/nfp/meson.build @@ -4,6 +4,7 @@ if not is_linux or not dpdk_conf.get('RTE_ARCH_64') build = false reason = 'only supported on 64-bit Linux' + subdir_done() endif sources = files( From patchwork Tue Jul 9 08:24:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 142251 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 47874455DF; Tue, 9 Jul 2024 10:24:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9558A4325E; Tue, 9 Jul 2024 10:24:29 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2121.outbound.protection.outlook.com [40.107.237.121]) by mails.dpdk.org (Postfix) with ESMTP id 6492543258 for ; Tue, 9 Jul 2024 10:24:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rGqgSAaO1XWrMCuxXjDoEknS8vHwv0a0xRjWSuiJZ14u0AKPEbHjlmEogWgi6/ta68b4mUEeFm20GBzivvjlblqVPrtVPjImKovc+cAOQm/e+9JJBepWthTJBJNhZoLC0iCIBtmtmQSPvpoVThpr5o5MVZt2g951CdFTNQma+AfxINDrijlzJ247lzKGiR8JN/lyWI0brwRUmSMuA3HBgopiymt/RfbypjQNfbGGrpSvP8mR5vIbKGNVIRZW/op0N8gkWm8xAtcCyyODwKjtaugSXLxICcntAnZ6H5IwaVNG0V0r4uRPraoOvl9eYDke5/X8PJD1998Pbld6CVdV6Q== 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=/YHnSUZEU46GqXL23kg1z70eGyV0lm5d0UZHOvyYa6k=; b=tNTv60060ob9rZWhbSIyHu+bmG1mrYWaRDDnGPZjIOXzvxHMLp7x8pkG9sp75Kk2TSYVupy1vVLFm1JZgbWK7ww0Ib3jhDrYlQ2T/lNKfrl7ql1DO7x9u7qbHC5S7GAF9MOTjan2/rBZXov0kd2J+uSm+zFElbHPTPN6OXYIRl9QIkNVocokWL0K8hMES/wvB+xHZndNai8NMPWGoqnUc0Zx8uzH79+qq26gdlkHkTNwhcWh72h6LqDvppx3gFBcE8bApXiubZBjI8CZsSUpH7nja+gh/GKvspqc7u6Evpw2OKJk67xZBtR8X4DYc+QG49uimDY888Rf/tYV80vTBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/YHnSUZEU46GqXL23kg1z70eGyV0lm5d0UZHOvyYa6k=; b=LpNZkFt+PA1LN/exxrLN0daBEILubHdX+PwW0NTDVjkm3J3CZCtN/ejZdmZrZPR0hd7PEoFfAgEZKSMDrY4DELdxduRQ0cClv5oEyqr6sWGqVqUDgE65ogb2fzHasob0hgoJH6T4ShkKNJxJn4PijxDzKEj848OAsscmPOIpzYU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH7PR13MB6194.namprd13.prod.outlook.com (2603:10b6:510:245::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36; Tue, 9 Jul 2024 08:24:25 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%4]) with mapi id 15.20.7741.033; Tue, 9 Jul 2024 08:24:25 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Chaoyong He Subject: [PATCH v4 2/5] net/nfp: export more interfaces of NFDk Date: Tue, 9 Jul 2024 16:24:02 +0800 Message-Id: <20240709082405.248641-3-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240709082405.248641-1-chaoyong.he@corigine.com> References: <20240709072921.246520-1-chaoyong.he@corigine.com> <20240709082405.248641-1-chaoyong.he@corigine.com> X-ClientProxiedBy: BYAPR05CA0064.namprd05.prod.outlook.com (2603:10b6:a03:74::41) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB6194:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b5d47d0-9092-400c-ff27-08dc9ff08aee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: 7k76mN2ohaz94uMz8ZiZBd++O7hn7vI9g595PmgUNQZlAEgkaiIeFn9hTg/m+t8+lnXb5gWWFu6trC7VaYKDEb+PmLRGi7xl48jYN/RsoVV1ocI5G1wOLQ3kjUE8e/8UcP4asHDOj3bQaaadBH14QDVZIVN9D6ClfeEk1Nx/PEOL0+4PBIC7NFvuBmOKT6Ycfx/F7jCRR6ffTCu0TuA5gtJiyNCbu/SAjezLmvRpzbjTdZfvwABjTsxd4ttWbvkv9W5ROvGJQlulC1N5GVU9z25GBknCfAqk1OXGSPZ5lqFpuxtiFFYMMjCfPkKBoq6XjNSNieXKK+tahY3kqdLDqYL+zlHqWDDln4/uNx1c4lQWQ3wCY2uPfOWaBKZvWpvxeRPXORdnKF1E2lvx46ik900ufLBQ8xVUc7L83sMiRSyMfk0Z1ghfcQimnCEOViGxGaCwjhxWcOQZVIyDId1Q2mv9alCHS0/wn212NDRuSsbbVap4wbULm5Q74a7rE/uOE42ALPXWqOqzx2oGElWNRQaQpw88gzy5hC5w8CvKzgfECvlo+zNB23aEDioFNkVOrCY41McL6UIJU/qiVFkhBrC/uhnatjyaGUfaVfoxx1Jwg4GEfyy0eEDXUNJRGu2LQtYsvukO171uBdQ9upAq5Vm14XK/3Fn+lbVw3+GGoW6vWQS4q3xkgX5/Gs6DVM+VHlZ0dXZKW/7oSgQOOY83AMGArGdx4GwNmdRoN3zU8ovnnTs8riDEcsVvU0qAf2LMVpR3qImpDu2CbfYSBqLNSP2AgK0BNI10m+sOD2IsmPLNSx6ZrtOeW3CQ0vvn01fWnW6Uc9yxMahXYWL6uXGnIEhqo/kroedf4n9QN4ffLlzrqaYiilLrmnZ+XnKqsjvfgJ50o5Shxh70QUQglZrvIT7qJMMf5EPsUwu6lDe/Q5KNtZO64Y8Wf/Z2NmzUsQPga2ajUDdmxSYKIzNwGw4d3lSzXAILSt9I+VyoXi6Zri4GSbHvxpQpue237Mi3WEdIf+2s6qNlrRZD2OTLW5fkxuNaY4znhDkGh8XPfesddHwwgMvADRuzJC8MVxA3tiOch8qJWFLsx7qhSvs1rwTS/JQ7o+HKC38YDd9Fmc45ZAgbmgvKzyd8Q9eeL5likLAtepwPofySf+Ga50e/0i3Lsp9wBVFCexY2Nj4a/7fPSXFgrGPaMaRpsCHmcpubkbHMRSyeEaI350FTFO4vuFpMxfQuKFCoVbMKLAAPq1UeclBlVbFV+ebv9/fhzFMGgO5cjjMbiBn0qEeE56n/JR6Lhug+ZSlsrNBbJX+2lXEUSYQdwY5v5wSMTPe/qAK6pYFShdd/UbRkfDoilX47REXra9XVMSygwBxWjH8CLxU2n5GIf2aZHVMv+5BVcN/tPP1btgK5tXP1gaUKnyjKw0/NSA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GAFd0hLx28VADJ5LHv96ZoKhL5CObCOGE6LfnldZ06k/DoqGUdo+DqnrVjkyEL57uiFhwgoMNQDYYorPSqdHA87bCC3tlg8yvIUOU/Qg1yYHKHYBLgQedD1PeJkzFScYzh56pXMGozyqLTw4YvHACPGw6nMSKCS4dk/tcZlZyaKOlr4Go7/4gWZviThTVFu4SrW6r2hZcZ0x59rRI5mBds84/Hv4uMGL9SUYmYHN9s1noGT8FSK9ppFaP5LapVUm+NQP6rLfc93Hl6q4L+3kYiMDsIG80HelKGCDtOoqVmzuTWlpgiHTWCAVMM7lpmiIY1omeZYV7LFsXVsFJ9bf5APndEXBSTqE2/hC/B8s/ZUNeerwQpaUbg7PrArJkCE3xdNHUNs9zai+FgNU48CWlWHvUNdKdciS2M+YWlWH1X9BYKneLxdLBQosARrjNhO9UsnlHxG29JIanulW0/k0BQeFb7GFHZLQsxYpcFsA4HgoW8SkLWmU0fvowV3/YdimV4QL8q7tpJ3CLMLPhyKWp7g5Ro9sAUGDxp86vz9zxftx3okFtPd/5izCiEWhA0ay6GudwqgCSuumN+4vtEdDq2tUR14gbBeEy/5W1zRHm3DIHPaeaKolqbAlOSeVBpMCJ2EcaZcbqajpt39q8xO++47iUt2qTP0W7WLQYCfAj71PlqiwgKQ72XsSolpGjZLfaYnm+sD0UZvbP5cMWF0HofMl2H2VEGY2RdFV/6/PxQsIIQfT4uabS164pO0QSntKegf/kTchiqPHj76++quYCX1rFgveVSpY7yZE3bjxcTxZxnck+rvJDoUFfzkjTsHFpmUCb/sxZU7ilf7QihFtqg+F1wwV3S19F2Jrhl8au8F8rHmiGtHqOw10yXpooqcON/zNeU14FxxK6fkDa51x/paR/QDLu8Sd7uDnS8eHL1lb/prSUWmW/lEpm0SrJgNsPPnTmKEQKIjjT3Wwq+FDOm07OI9QXJqWkGE+Q/PLAFqKTPTdZWRL71l5NzNvDljyarU89G5jtr4XamVGVQW/SyNVvgAo/jNiBk3L5D+CkuG/pA3ZptxOXKG7BHCO0ewn+cxE2wSvQKWk236USLTYycrl8ojbXJGBzhiEL+P7mJgr8guVoQc9H6MtfmOxSRGSgElk/XjSO95LuvI52Nc1QdFh3iFcV7bhQfJoragwgkhAz61p7arL2wM0z2lsz/6sjEaaF6Cnvk4iWOtmGtUcTMTechQBm9kaBFpccBvvg66CUbewbN6hZCHvEdZnwcwbESeafww5K1dx1khFyDRMv3G9NIOFdCixYXilzYqBXcvctHSwK2guhPs1moKeHc6kAbSU4fKS+iVzAs1zAB7oduukq6xJ7Clrvokd25wlfLgtnSYSl9w+fFgUIWmTlV77iqlEkZcBsJ73bLtVin8FF/diU/+rnT4QhWmVoPfMl6+fCUjjU8b1LgxfugQspLDSRlAiCTSl639oTxbsKwDRXzPwKYxfyM9KEnuE4Hd3FBQuTudzrJOTolfTxMlTRHYpsUoX/bZDQ06XjitkpBJjhUPPTUd2IhGw+xvgwVsDpaHN4kgrj2NpvLq1YKHPdYUOEF++41aNey5vm/CLu11oFQ== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b5d47d0-9092-400c-ff27-08dc9ff08aee X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2024 08:24:25.4975 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Iqh9Zuf1KxaKKi/dcjlewLAz+H0A0fCZss8yiTrfYVAmZHGPyvey82f77QGjuEFpAMYgfWEvn9ypBZ0usCbICCU/qutnCGMwL4r9ujLx9XY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB6194 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Long Wu NFP will support NFDk vector Tx function, so move some functions to header file for use by vector Tx function. Signed-off-by: Long Wu Reviewed-by: Chaoyong He --- drivers/net/nfp/nfdk/nfp_nfdk.h | 45 ++++++++++++++++++++++++++++++ drivers/net/nfp/nfdk/nfp_nfdk_dp.c | 43 +--------------------------- 2 files changed, 46 insertions(+), 42 deletions(-) diff --git a/drivers/net/nfp/nfdk/nfp_nfdk.h b/drivers/net/nfp/nfdk/nfp_nfdk.h index 2767fd51cd..89a98d13f3 100644 --- a/drivers/net/nfp/nfdk/nfp_nfdk.h +++ b/drivers/net/nfp/nfdk/nfp_nfdk.h @@ -6,7 +6,10 @@ #ifndef __NFP_NFDK_H__ #define __NFP_NFDK_H__ +#include + #include "../nfp_rxtx.h" +#include "nfp_net_common.h" #define NFDK_TX_DESC_PER_SIMPLE_PKT 2 @@ -161,6 +164,45 @@ nfp_net_nfdk_txq_full(struct nfp_net_txq *txq) return (nfp_net_nfdk_free_tx_desc(txq) < txq->tx_free_thresh); } +static inline uint16_t +nfp_net_nfdk_headlen_to_segs(uint16_t headlen) +{ + /* First descriptor fits less data, so adjust for that */ + return DIV_ROUND_UP(headlen + NFDK_TX_MAX_DATA_PER_DESC - NFDK_TX_MAX_DATA_PER_HEAD, + NFDK_TX_MAX_DATA_PER_DESC); +} + +/* Set TX CSUM offload flags in TX descriptor of nfdk */ +static inline uint64_t +nfp_net_nfdk_tx_cksum(struct nfp_net_txq *txq, + struct rte_mbuf *mb, + uint64_t flags) +{ + uint64_t ol_flags; + struct nfp_net_hw *hw = txq->hw; + + if ((hw->super.cap & NFP_NET_CFG_CTRL_TXCSUM) == 0) + return flags; + + ol_flags = mb->ol_flags; + + /* Set TCP csum offload if TSO enabled. */ + if ((ol_flags & RTE_MBUF_F_TX_TCP_SEG) != 0) + flags |= NFDK_DESC_TX_L4_CSUM; + + if ((ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) != 0) + flags |= NFDK_DESC_TX_ENCAP; + + /* IPv6 does not need checksum */ + if ((ol_flags & RTE_MBUF_F_TX_IP_CKSUM) != 0) + flags |= NFDK_DESC_TX_L3_CSUM; + + if ((ol_flags & RTE_MBUF_F_TX_L4_MASK) != 0) + flags |= NFDK_DESC_TX_L4_CSUM; + + return flags; +} + uint32_t nfp_flower_nfdk_pkt_add_metadata(struct rte_mbuf *mbuf, uint32_t port_id); uint16_t nfp_net_nfdk_xmit_pkts_common(void *tx_queue, @@ -177,5 +219,8 @@ int nfp_net_nfdk_tx_queue_setup(struct rte_eth_dev *dev, const struct rte_eth_txconf *tx_conf); int nfp_net_nfdk_tx_maybe_close_block(struct nfp_net_txq *txq, struct rte_mbuf *pkt); +int nfp_net_nfdk_set_meta_data(struct rte_mbuf *pkt, + struct nfp_net_txq *txq, + uint64_t *metadata); #endif /* __NFP_NFDK_H__ */ diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c index 8b8c191b82..173aabf0b9 100644 --- a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c +++ b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c @@ -6,7 +6,6 @@ #include "nfp_nfdk.h" #include -#include #include #include "../flower/nfp_flower.h" @@ -15,38 +14,6 @@ #define NFDK_TX_DESC_GATHER_MAX 17 -/* Set TX CSUM offload flags in TX descriptor of nfdk */ -static uint64_t -nfp_net_nfdk_tx_cksum(struct nfp_net_txq *txq, - struct rte_mbuf *mb, - uint64_t flags) -{ - uint64_t ol_flags; - struct nfp_net_hw *hw = txq->hw; - - if ((hw->super.ctrl & NFP_NET_CFG_CTRL_TXCSUM) == 0) - return flags; - - ol_flags = mb->ol_flags; - - /* Set L4 csum offload if TSO/UFO enabled. */ - if ((ol_flags & RTE_MBUF_F_TX_TCP_SEG) != 0 || - (ol_flags & RTE_MBUF_F_TX_UDP_SEG) != 0) - flags |= NFDK_DESC_TX_L4_CSUM; - - if ((ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) != 0) - flags |= NFDK_DESC_TX_ENCAP; - - /* IPv6 does not need checksum */ - if ((ol_flags & RTE_MBUF_F_TX_IP_CKSUM) != 0) - flags |= NFDK_DESC_TX_L3_CSUM; - - if ((ol_flags & RTE_MBUF_F_TX_L4_MASK) != 0) - flags |= NFDK_DESC_TX_L4_CSUM; - - return flags; -} - /* Set TX descriptor for TSO of nfdk */ static uint64_t nfp_net_nfdk_tx_tso(struct nfp_net_txq *txq, @@ -100,14 +67,6 @@ nfp_flower_nfdk_pkt_add_metadata(struct rte_mbuf *mbuf, return FLOWER_PKT_DATA_OFFSET; } -static inline uint16_t -nfp_net_nfdk_headlen_to_segs(uint16_t headlen) -{ - /* First descriptor fits less data, so adjust for that */ - return DIV_ROUND_UP(headlen + NFDK_TX_MAX_DATA_PER_DESC - NFDK_TX_MAX_DATA_PER_HEAD, - NFDK_TX_MAX_DATA_PER_DESC); -} - static inline void nfp_net_nfdk_tx_close_block(struct nfp_net_txq *txq, uint32_t nop_slots) @@ -170,7 +129,7 @@ nfp_net_nfdk_tx_maybe_close_block(struct nfp_net_txq *txq, return nop_slots; } -static int +int nfp_net_nfdk_set_meta_data(struct rte_mbuf *pkt, struct nfp_net_txq *txq, uint64_t *metadata) From patchwork Tue Jul 9 08:24:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 142252 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8F537455DF; Tue, 9 Jul 2024 10:24:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 04BE64329C; Tue, 9 Jul 2024 10:24:31 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2104.outbound.protection.outlook.com [40.107.237.104]) by mails.dpdk.org (Postfix) with ESMTP id 0F07943281 for ; Tue, 9 Jul 2024 10:24:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=U5VdE0L5K0OQlPAYuws2W7eASnl3GevNwLZ1VqRja8cLkEzZ13IfakIqQB3Yr3W1+V7fYG7KMbJvYX5066t3KsGihp4IbC+oK7a5g4w1hA7tvi9qzU9180GKsyDU4PtULcoIw//ZgHofK2JGTcIvfpkMmGAX+HXfl0kP1Xtr4Y05PCb3+Dg7SElsoho2wOwSvQs87rMaL0Pm4NCzhDMEoVzh+lZbhxac0MqmDrbGWjH3PB9jc5QSnXoL5r2QWgCylbMB+uxVbl2z4eXOywvo5/Wkgg+fgOwWruEK4LQrHo3zlhd32QELcSPFS8LKD0CfJKcAyKkd1gTiEr2rdNUJdw== 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=e0TL/kLR076LyJ3zmzevsib7AiACIt+FAyJ8jcIlX9A=; b=iJiVLGWjHF1KKcPRO/XLdfjYOAgZuOlL+6oC7ucZsaYQKCJiW1pTtwD1+Nl9iwsHrj1IBfskGdStG49mq462ZvK0s6PESbfxMGryhBBLsvcP6Fb/gItWZMHNxyTK7H/TsKCnd2mfDhvSRlfOPoBeXxkNlZ00jdmuHD9+yfXth+DuRUmlCypjnfe6Yx5eRPnRMYwX+jXQwfK5o2Cs3Cf2if8v+ijvurzOS+zcG/p6GwKzjYEiWc88l2i+2gNeOFq817ChM/098U7KS8Le2cEUP3GulOSjSwXONaBJM2eLdYAb17HcBCy9K+pNT2lYsE44jVd3ZHl3ohRIUOEjE3ruKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e0TL/kLR076LyJ3zmzevsib7AiACIt+FAyJ8jcIlX9A=; b=VQc/hV8xv3HXLDRIfT0Ri09ftrOqs4nJFNzOcr8YpZBw/V+zI2w5Y/yWn6w07BtZXi/oomn0jB5zZF+3ByqVF7XEZYEX9Y/Ffj07ICBxt5W1xbDwjbxqVnedNyZVfiPO0Ljgabk3wfdkMRopzcSc8fOPO4xovK7ZYJVXBQ2gipM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH7PR13MB6194.namprd13.prod.outlook.com (2603:10b6:510:245::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36; Tue, 9 Jul 2024 08:24:27 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%4]) with mapi id 15.20.7741.033; Tue, 9 Jul 2024 08:24:27 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Chaoyong He Subject: [PATCH v4 3/5] net/nfp: support AVX2 Tx function Date: Tue, 9 Jul 2024 16:24:03 +0800 Message-Id: <20240709082405.248641-4-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240709082405.248641-1-chaoyong.he@corigine.com> References: <20240709072921.246520-1-chaoyong.he@corigine.com> <20240709082405.248641-1-chaoyong.he@corigine.com> X-ClientProxiedBy: BYAPR05CA0064.namprd05.prod.outlook.com (2603:10b6:a03:74::41) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB6194:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f64be1d-b964-4b28-3b46-08dc9ff08bf7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: LwMd7ineb1UAfwjp9ynddD7cTFScQSM6SRQMnqPS1pVISEGqwjzC3FGypRFjs5Mw3n+5QrXohp1I/0EAr6Uw5nFgccLGRQ8Sql1j8jft5ssZNt/l01Cq3LFR19kxpSPsO5Ns1SU3jjxmd1QjxcrtuIU86IdkboVjvRP6ZUx5VzLTnMGS4i/iLrKtyAfTfScUBuOBqbxC5HlMKWyqxA/qLTbKyLb/ZbjoKHcfq62pmrZnpxAcSTMgBSrYENFWlBib6AAu0dmAlEU2xxAQHaLmw+BIwAif5Ttcfk3hO9rktEIINOJO0njCB11H/gtcwhWfRABjdBoTFrzbEVC6ApDuiL6Qm9nXEDV1N8mh9uUgWl+fhxhlYIJtE2Z39Fu8k4+Q/M/EqeGMBNB1SyWKLcsobvOugcmGglGBwzuo9NPwcBhCHrkUaJVurmNixT59UK7pQ0eYmcc510wtTI0Y2mT3DREAf8sQOGXTsaZYsmM0AT/H17DYb+U8ScFJ3AytqJWPPNzIjbAmTOpFHzQ3Y2t2Ds0p/zoU8AT0FyntX1LvmFURA8H4FOARAW0LtTzFSDM1RvqJR1iZhHTnUhj/YIWc80Q3FVJmTOKm8Wximn7Bp7km8dKfH7dsXHa81tdDgcHMdfOfnZqcN0PvanLM+KfHJfU4XZT/TGWvIj6bMCsx1n7b/OSlWOx94coQ4syBsylZ+q4TBwJaS/FyvjcaKUWfujebEG2sMFA6Ek2xXPyqIbWVRLghxHr8u9qkHMrAUKxiuP1vS20C5FK8qxCCfZ9ZW73/hgoMiZrSASmrm3fUjh9HNcvexL/fj73PaqpBDLlRyiHs1S4LEl04r359o41OlCG5FiWyQj87dDBWMH3qSRYmJIHC4nUiWbNVq1FU4rDlVZ/vpVwlbHHY+/KywNWe5pAL36akASporrjBXP8NKsxwAmRsJ3HZHhVy+hUgqUmXbQZ4+iO5Jr25mbG6PBpKceFGn/bX6ta3PKDTYMk6+k6JNaQlsJJ57CLg1xlotrF1SXYqBxpgKckUjWm8q0Leg3WrXjkYFYUlNpKFD71RKu2ci/IZy+OHVCMe7BLWa6TVn7U9eGnlWTU/lScAdrzpcWiyip1U4NTlSYL/Csd+nhhFO6dlIJ17tV4+A/aNSAmeaouqrMYgVJxBDmW30g9XwZlO/PZlv5tzPiaTnY/dBAMjSmkjbws6GAi20c2AijgzUhmJvcN09hVEg6t6ygSuQWlYTt6OknoDGyaM1rbP3EvG7GEO2OLrQYKic2/HHuFCp6o2IryGn39vcLL9Df58ZzG3sWsAlaUJdC0xdDcvVvtNruImlz/UlLUzzHQU+tYZB8bkAfGe743rkL4eS2EXJrqZd9WsZx5h+mlVwfqhkJJzxISZTRIGOsJqSqSSmHH1P0jYFFNJvQeXqDez+8SuVQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xQqfAlixm/0Hx7tYzFT4fOEPG3X17OFDqr4ohhLwrxy5yjc01qeMu/uHPJv5rjSLEy92u00E9kvSS6WFaAAmojRN1cr8FLmyru9TbdGm5APKeXk9smj2LrXHpRMKm9ZT9BZY1jxy3I4IAxIL6NPbfk6GENP0lhgo7jh62kDr8u6U11XtOGKMJFw01EKeJtGGkvMjZ3rr+G7o7JSHRoYc6rs/CalmtkSxWhHwtktHsINOipDp8617jsfFlzMnOZwkiuDjih8kG9+uTuugXPwZOQvKkn1oNKxEMBWst4N/Z+m/mZo7YrmGNewn+6zamduH/BGrbPGe7oG+w3OrVmscribhh/pKpLWBXG8+8Nl+h3WLatoHCwvJ5cRayFzUAR0vHUQCbL9Juj3xZFtGhh5u6GDIegr8cV+ChfU97Vkg/SlrDYPaggWGhjkZKWfD0bbviGlOxurxa0769AqjkXzEWKjQ7rEr7Bhx0zrzKkrCTwAp40mJtatqz93xJKdQDCBD60c129UbYh1amyBieG/KOT6FvbRIKnOr133hheiHxSrk084/l7Hc4y3cQkPRB3mcZVyVYKW1eKmq9kAVB9Qty1i0g9LuSInrLtnZc18ESJaeTkANQKWB/QdQpM/U+4XitEmxF+WjjZinI1G+5anHWZVMlplhPEgG44bwnvKbqqea/dXxIRjEJlgLSgD13ACwvJPtQU8jqJ7NDZjO5qE6MvCnOwyYN7ZDRwk+sli/+WfWKVi+6BNMf2t7j8pO+UC/77vwIrd8A3KyUqe02s06PmFesFh5fklQJ64CNrRBWEKeo+aZw6nUZE1jdY4qSrZpLPyhxjm+D/wrGtF8T412zVD9ffsbSY2GXeS6k9xufSv/RxiZJUXPGrKwU3PwWZbuslLFd+TvmQ836oHhzYobG/dQgQTI+JGuMIL/A9JhDc2r2OHf8ZxYAN6mTob4bMBoS5tm94UzxsDOXBhaKRPPNYmQ2+0sLqhlQFNXSCAXB8MNNLGxnLuuh8bihhK9fhoP8xduBOYu8vKVdeUCgqzPT5n3A7BcOBoi2W1pzaXPfTcQnHxH9VyOqu0H4IlHXUhE/C6Sk8XiALdh2cjBr9oNUCqXbSBfDioHj7YFGw0DlfNmXCr1OnsBb1f7EqGE6tLtMaGHI/hmk8zRhmVbQa7ORmhXyLAYr99STfUvRGc8tX/TclZ305ZGXz49YbFZBqlLUQZBi2gRPqT7nDTjkcyNMMkX5pY0tOK7RdVhGO6nT9Q2KqtRbMrYUElcjB9vBv1rtlgE31AUKfgvNUIzlDV1F2rryC6DPRt8kTQ4ZwpluwuwlHrtRUBsNh+kh9z363wEXNFrD13Ei+zntIwJfsqhTekYRCm9/jz8PyJNx4eYXzPYaFFwvsa7LiuNBmZzMfYN1kvmFj3NtYkqpRaiITBDL+YN4yazE3rYipvLFvEEr5PLDRoTanF9qIvU+b/4W/zDGsK+rQzED6NxY7Xyjvje6c6ebRobt2bYNcjVYiEwPdFaRZER9us5mOBWvryc+sDeI2Z492U6h/NoIzEDMXnAovMaIv0y/q5oLG7lqJFW0lSGGtXRaPAiWwiOzZTWJZ34X4D7NHN/8uI/bonabgwiqQ== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f64be1d-b964-4b28-3b46-08dc9ff08bf7 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2024 08:24:27.2257 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tPnCeZ3cGNHqXu6TNypZ4BdkYg2JVuBmopi3AFggKnbeXl53FUHmTN6Lt15lp/SWGk7v9FutF9BkJmsWjhQ95Oi9zfzwGgV+qzxlzXxsNDA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB6194 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Long Wu Use AVX2 instructions to accelerate Tx performance. The acceleration only works on X86 machine. Signed-off-by: Long Wu Reviewed-by: Chaoyong He --- drivers/net/nfp/meson.build | 20 + drivers/net/nfp/nfdk/nfp_nfdk.h | 1 + drivers/net/nfp/nfdk/nfp_nfdk_dp.c | 12 + drivers/net/nfp/nfdk/nfp_nfdk_vec.h | 36 ++ drivers/net/nfp/nfdk/nfp_nfdk_vec_avx2_dp.c | 432 ++++++++++++++++++++ drivers/net/nfp/nfdk/nfp_nfdk_vec_stub.c | 14 + drivers/net/nfp/nfp_ethdev.c | 3 +- drivers/net/nfp/nfp_ethdev_vf.c | 3 +- drivers/net/nfp/nfp_rxtx.h | 5 +- drivers/net/nfp/nfp_rxtx_vec.h | 13 + drivers/net/nfp/nfp_rxtx_vec_avx2.c | 21 + drivers/net/nfp/nfp_rxtx_vec_stub.c | 16 + 12 files changed, 573 insertions(+), 3 deletions(-) create mode 100644 drivers/net/nfp/nfdk/nfp_nfdk_vec.h create mode 100644 drivers/net/nfp/nfdk/nfp_nfdk_vec_avx2_dp.c create mode 100644 drivers/net/nfp/nfdk/nfp_nfdk_vec_stub.c create mode 100644 drivers/net/nfp/nfp_rxtx_vec.h create mode 100644 drivers/net/nfp/nfp_rxtx_vec_avx2.c create mode 100644 drivers/net/nfp/nfp_rxtx_vec_stub.c diff --git a/drivers/net/nfp/meson.build b/drivers/net/nfp/meson.build index 7216c8dff9..58a066c2e3 100644 --- a/drivers/net/nfp/meson.build +++ b/drivers/net/nfp/meson.build @@ -17,6 +17,7 @@ sources = files( 'flower/nfp_flower_service.c', 'nfd3/nfp_nfd3_dp.c', 'nfdk/nfp_nfdk_dp.c', + 'nfdk/nfp_nfdk_vec_stub.c', 'nfpcore/nfp_cppcore.c', 'nfpcore/nfp_crc.c', 'nfpcore/nfp_elf.c', @@ -44,7 +45,26 @@ sources = files( 'nfp_net_flow.c', 'nfp_net_meta.c', 'nfp_rxtx.c', + 'nfp_rxtx_vec_stub.c', 'nfp_service.c', ) +if arch_subdir == 'x86' + includes += include_directories('../../common/nfp') + + avx2_sources = files( + 'nfdk/nfp_nfdk_vec_avx2_dp.c', + 'nfp_rxtx_vec_avx2.c', + ) + + nfp_avx2_lib = static_library('nfp_avx2_lib', + avx2_sources, + dependencies: [static_rte_ethdev, static_rte_bus_pci], + include_directories: includes, + c_args: [cflags, '-mavx2'] + ) + + objs += nfp_avx2_lib.extract_all_objects(recursive: true) +endif + deps += ['hash', 'security', 'common_nfp'] diff --git a/drivers/net/nfp/nfdk/nfp_nfdk.h b/drivers/net/nfp/nfdk/nfp_nfdk.h index 89a98d13f3..29d862f6f0 100644 --- a/drivers/net/nfp/nfdk/nfp_nfdk.h +++ b/drivers/net/nfp/nfdk/nfp_nfdk.h @@ -222,5 +222,6 @@ int nfp_net_nfdk_tx_maybe_close_block(struct nfp_net_txq *txq, int nfp_net_nfdk_set_meta_data(struct rte_mbuf *pkt, struct nfp_net_txq *txq, uint64_t *metadata); +void nfp_net_nfdk_xmit_pkts_set(struct rte_eth_dev *eth_dev); #endif /* __NFP_NFDK_H__ */ diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c index 173aabf0b9..2cea5688b3 100644 --- a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c +++ b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c @@ -11,6 +11,8 @@ #include "../flower/nfp_flower.h" #include "../nfp_logs.h" #include "../nfp_net_meta.h" +#include "../nfp_rxtx_vec.h" +#include "nfp_nfdk_vec.h" #define NFDK_TX_DESC_GATHER_MAX 17 @@ -511,6 +513,7 @@ nfp_net_nfdk_tx_queue_setup(struct rte_eth_dev *dev, dev->data->tx_queues[queue_idx] = txq; txq->hw = hw; txq->hw_priv = dev->process_private; + txq->simple_always = true; /* * Telling the HW about the physical address of the TX ring and number @@ -521,3 +524,12 @@ nfp_net_nfdk_tx_queue_setup(struct rte_eth_dev *dev, return 0; } + +void +nfp_net_nfdk_xmit_pkts_set(struct rte_eth_dev *eth_dev) +{ + if (nfp_net_get_avx2_supported()) + eth_dev->tx_pkt_burst = nfp_net_nfdk_vec_avx2_xmit_pkts; + else + eth_dev->tx_pkt_burst = nfp_net_nfdk_xmit_pkts; +} diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_vec.h b/drivers/net/nfp/nfdk/nfp_nfdk_vec.h new file mode 100644 index 0000000000..14319d6cf6 --- /dev/null +++ b/drivers/net/nfp/nfdk/nfp_nfdk_vec.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2024 Corigine, Inc. + * All rights reserved. + */ + +#ifndef __NFP_NFDK_VEC_H__ +#define __NFP_NFDK_VEC_H__ + +#include + +#include + +#include "../nfp_net_common.h" +#include "nfp_nfdk.h" + +static inline bool +nfp_net_nfdk_is_simple_packet(struct rte_mbuf *pkt, + struct nfp_net_hw *hw) +{ + if (pkt->data_len > NFDK_TX_MAX_DATA_PER_HEAD) + return false; + + if ((hw->super.cap & NFP_NET_CFG_CTRL_LSO_ANY) == 0) + return true; + + if ((pkt->ol_flags & RTE_MBUF_F_TX_TCP_SEG) == 0) + return true; + + return false; +} + +uint16_t nfp_net_nfdk_vec_avx2_xmit_pkts(void *tx_queue, + struct rte_mbuf **tx_pkts, + uint16_t nb_pkts); + +#endif /* __NFP_NFDK_VEC_H__ */ diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_vec_avx2_dp.c b/drivers/net/nfp/nfdk/nfp_nfdk_vec_avx2_dp.c new file mode 100644 index 0000000000..6d1359fdb1 --- /dev/null +++ b/drivers/net/nfp/nfdk/nfp_nfdk_vec_avx2_dp.c @@ -0,0 +1,432 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2024 Corigine, Inc. + * All rights reserved. + */ + +#include +#include +#include + +#include "../nfp_logs.h" +#include "nfp_nfdk.h" +#include "nfp_nfdk_vec.h" + +/* + * One simple packet needs 2 descriptors so if send 4 packets driver will use + * 8 descriptors at once. + */ +#define NFDK_SIMPLE_BURST_DES_NUM 8 + +#define NFDK_SIMPLE_DES_TYPE (NFDK_DESC_TX_EOP | \ + (NFDK_DESC_TX_TYPE_HEAD & (NFDK_DESC_TX_TYPE_SIMPLE << 12))) + +static inline int +nfp_net_nfdk_vec_avx2_xmit_simple_set_des2(struct rte_mbuf *pkt, + struct nfp_net_txq *txq, + uint64_t *des_addr, + uint64_t *des_meta, + bool repr_flag) +{ + int ret; + __m128i dma_addr; + __m128i dma_hi; + __m128i data_off; + __m128i dlen_type; + uint64_t metadata; + + if (repr_flag) { + metadata = NFDK_DESC_TX_CHAIN_META; + } else { + ret = nfp_net_nfdk_set_meta_data(pkt, txq, &metadata); + if (unlikely(ret != 0)) + return ret; + } + + data_off = _mm_set_epi64x(0, pkt->data_off); + dma_addr = _mm_add_epi64(_mm_loadu_si128((__m128i *)&pkt->buf_addr), data_off); + dma_hi = _mm_srli_epi64(dma_addr, 32); + + dlen_type = _mm_set_epi64x(0, (pkt->data_len - 1) | NFDK_SIMPLE_DES_TYPE); + + *des_addr = _mm_extract_epi64(_mm_add_epi64(_mm_unpacklo_epi32(dma_hi, dma_addr), + _mm_slli_epi64(dlen_type, 16)), 0); + + *des_meta = nfp_net_nfdk_tx_cksum(txq, pkt, metadata); + + return 0; +} + +static inline int +nfp_net_nfdk_vec_avx2_xmit_simple_send1(struct nfp_net_txq *txq, + struct nfp_net_nfdk_tx_desc *txds, + struct rte_mbuf *pkt, + bool repr_flag) +{ + int ret; + __m128i des_data; + uint64_t des_addr; + uint64_t des_meta; + + ret = nfp_net_nfdk_vec_avx2_xmit_simple_set_des2(pkt, txq, &des_addr, + &des_meta, repr_flag); + if (unlikely(ret != 0)) + return ret; + + txq->wr_p = D_IDX(txq, txq->wr_p + NFDK_TX_DESC_PER_SIMPLE_PKT); + if ((txq->wr_p & (NFDK_TX_DESC_BLOCK_CNT - 1)) != 0) + txq->data_pending += pkt->data_len; + else + txq->data_pending = 0; + + des_data = _mm_set_epi64x(des_meta, des_addr); + + _mm_store_si128((void *)txds, des_data); + + return 0; +} + +static inline int +nfp_vec_avx2_nfdk_xmit_simple_send4(struct nfp_net_txq *txq, + struct nfp_net_nfdk_tx_desc *txds, + struct rte_mbuf **pkt, + bool repr_flag) +{ + int ret; + uint16_t i; + __m256i des_data0_1; + __m256i des_data2_3; + uint64_t des_addr[4]; + uint64_t des_meta[4]; + + for (i = 0; i < 4; i++) { + ret = nfp_net_nfdk_vec_avx2_xmit_simple_set_des2(pkt[i], txq, + &des_addr[i], &des_meta[i], repr_flag); + if (unlikely(ret != 0)) + return ret; + } + + for (i = 0; i < 4; i++) { + txq->wr_p = D_IDX(txq, txq->wr_p + NFDK_TX_DESC_PER_SIMPLE_PKT); + if ((txq->wr_p & (NFDK_TX_DESC_BLOCK_CNT - 1)) != 0) + txq->data_pending += pkt[i]->data_len; + else + txq->data_pending = 0; + } + + des_data0_1 = _mm256_set_epi64x(des_meta[1], des_addr[1], des_meta[0], des_addr[0]); + des_data2_3 = _mm256_set_epi64x(des_meta[3], des_addr[3], des_meta[2], des_addr[2]); + + _mm256_store_si256((void *)txds, des_data0_1); + _mm256_store_si256((void *)(txds + 4), des_data2_3); + + return 0; +} + +static inline void +nfp_net_nfdk_vec_avx2_xmit_mbuf_store4(struct rte_mbuf **mbuf, + struct rte_mbuf **tx_pkts) +{ + __m256i mbuf_room0_1; + __m256i mbuf_room2_3; + + mbuf_room0_1 = _mm256_set_epi64x(0, (uintptr_t)tx_pkts[1], 0, + (uintptr_t)tx_pkts[0]); + mbuf_room2_3 = _mm256_set_epi64x(0, (uintptr_t)tx_pkts[3], 0, + (uintptr_t)tx_pkts[2]); + + _mm256_store_si256((void *)mbuf, mbuf_room0_1); + _mm256_store_si256((void *)(mbuf + 4), mbuf_room2_3); +} + +static inline uint16_t +nfp_net_nfdk_vec_avx2_xmit_simple_pkts(struct nfp_net_txq *txq, + struct rte_mbuf **tx_pkts, + uint16_t nb_pkts, + uint16_t simple_close, + bool repr_flag) +{ + int ret; + uint16_t npkts = 0; + uint16_t need_txds; + uint16_t free_descs; + struct rte_mbuf **lmbuf; + struct nfp_net_nfdk_tx_desc *ktxds; + + PMD_TX_LOG(DEBUG, "Working for queue %hu at pos %u and %hu packets", + txq->qidx, txq->wr_p, nb_pkts); + + need_txds = nb_pkts << 1; + if (nfp_net_nfdk_free_tx_desc(txq) < need_txds || nfp_net_nfdk_txq_full(txq)) + nfp_net_tx_free_bufs(txq); + + free_descs = nfp_net_nfdk_free_tx_desc(txq); + if (unlikely(free_descs < NFDK_TX_DESC_PER_SIMPLE_PKT)) { + if (unlikely(simple_close > 0)) + goto xmit_end; + + return 0; + } + + PMD_TX_LOG(DEBUG, "Queue: %hu. Sending %hu packets", txq->qidx, nb_pkts); + + /* Sending packets */ + while (npkts < nb_pkts && free_descs >= NFDK_TX_DESC_PER_SIMPLE_PKT) { + ktxds = &txq->ktxds[txq->wr_p]; + lmbuf = &txq->txbufs[txq->wr_p].mbuf; + + /* + * If can not send burst, just send one. + * 1. Tx ring will come to the tail. + * 2. Do not need to send 4 packets. + * 3. If pointer address unaligned on 32-bit boundary. + * 4. If free descriptors are not enough. + */ + if ((txq->tx_count - txq->wr_p) < NFDK_SIMPLE_BURST_DES_NUM || + (nb_pkts - npkts) < 4 || + ((uintptr_t)ktxds & 0x1F) != 0 || + free_descs < NFDK_SIMPLE_BURST_DES_NUM) { + ret = nfp_net_nfdk_vec_avx2_xmit_simple_send1(txq, + ktxds, tx_pkts[npkts], repr_flag); + if (unlikely(ret != 0)) + goto xmit_end; + + rte_pktmbuf_free(*lmbuf); + + _mm_storel_epi64((void *)lmbuf, + _mm_loadu_si128((void *)&tx_pkts[npkts])); + npkts++; + free_descs -= NFDK_TX_DESC_PER_SIMPLE_PKT; + continue; + } + + ret = nfp_vec_avx2_nfdk_xmit_simple_send4(txq, ktxds, + &tx_pkts[npkts], repr_flag); + if (unlikely(ret != 0)) + goto xmit_end; + + rte_pktmbuf_free_bulk(lmbuf, NFDK_SIMPLE_BURST_DES_NUM); + + nfp_net_nfdk_vec_avx2_xmit_mbuf_store4(lmbuf, &tx_pkts[npkts]); + + npkts += 4; + free_descs -= NFDK_SIMPLE_BURST_DES_NUM; + } + +xmit_end: + /* Increment write pointers. Force memory write before we let HW know */ + rte_wmb(); + nfp_qcp_ptr_add(txq->qcp_q, NFP_QCP_WRITE_PTR, ((npkts << 1) + simple_close)); + + return npkts; +} + +static inline void +nfp_net_nfdk_vec_avx2_xmit_simple_close_block(struct nfp_net_txq *txq, + uint16_t *simple_close) +{ + uint16_t i; + uint16_t wr_p; + uint16_t nop_slots; + __m128i zero_128 = _mm_setzero_si128(); + __m256i zero_256 = _mm256_setzero_si256(); + + wr_p = txq->wr_p; + nop_slots = D_BLOCK_CPL(wr_p); + + for (i = nop_slots; i >= 4; i -= 4, wr_p += 4) { + _mm256_store_si256((void *)&txq->ktxds[wr_p], zero_256); + rte_pktmbuf_free_bulk(&txq->txbufs[wr_p].mbuf, 4); + _mm256_store_si256((void *)&txq->txbufs[wr_p], zero_256); + } + + for (; i >= 2; i -= 2, wr_p += 2) { + _mm_store_si128((void *)&txq->ktxds[wr_p], zero_128); + rte_pktmbuf_free_bulk(&txq->txbufs[wr_p].mbuf, 2); + _mm_store_si128((void *)&txq->txbufs[wr_p], zero_128); + } + + for (; i >= 1; i--, wr_p++) { + _mm_storel_epi64((void *)&txq->ktxds[wr_p], zero_128); + rte_pktmbuf_free(txq->txbufs[wr_p].mbuf); + _mm_storel_epi64((void *)&txq->txbufs[wr_p], zero_128); + } + + txq->data_pending = 0; + txq->wr_p = D_IDX(txq, txq->wr_p + nop_slots); + + (*simple_close) += nop_slots; +} + +static inline uint32_t +nfp_net_nfdk_vec_avx2_xmit_simple_prepare(struct nfp_net_txq *txq, + uint16_t *simple_close) +{ + uint16_t wr_p; + __m128i zero_128 = _mm_setzero_si128(); + + wr_p = txq->wr_p; + + _mm_storel_epi64((void *)&txq->ktxds[wr_p], zero_128); + rte_pktmbuf_free(txq->txbufs[wr_p].mbuf); + _mm_storel_epi64((void *)&txq->txbufs[wr_p], zero_128); + + txq->wr_p = D_IDX(txq, wr_p + 1); + (*simple_close)++; + + return txq->wr_p; +} + +static inline void +nfp_net_nfdk_vec_avx2_xmit_simple_check(struct nfp_net_txq *txq, + struct rte_mbuf *pkt, + bool *simple_flag, + bool *pending_flag, + uint16_t *data_pending, + uint32_t *wr_p, + uint16_t *simple_close) +{ + uint32_t data_pending_temp; + + /* Let the first descriptor index even before send simple packets */ + if (!(*simple_flag)) { + if ((*wr_p & 0x1) == 0x1) + *wr_p = nfp_net_nfdk_vec_avx2_xmit_simple_prepare(txq, simple_close); + + *simple_flag = true; + } + + /* Simple packets only need one close block operation */ + if (!(*pending_flag)) { + if ((*wr_p & (NFDK_TX_DESC_BLOCK_CNT - 1)) == 0) { + *pending_flag = true; + return; + } + + data_pending_temp = *data_pending + pkt->data_len; + if (data_pending_temp > NFDK_TX_MAX_DATA_PER_BLOCK) { + nfp_net_nfdk_vec_avx2_xmit_simple_close_block(txq, simple_close); + *pending_flag = true; + return; + } + + *data_pending = data_pending_temp; + + *wr_p += 2; + } +} + +static inline uint16_t +nfp_net_nfdk_vec_avx2_xmit_simple_count(struct nfp_net_txq *txq, + struct rte_mbuf **tx_pkts, + uint16_t head, + uint16_t nb_pkts, + uint16_t *simple_close) +{ + uint32_t wr_p; + uint16_t simple_idx; + struct rte_mbuf *pkt; + uint16_t data_pending; + bool simple_flag = false; + bool pending_flag = false; + uint16_t simple_count = 0; + + *simple_close = 0; + wr_p = txq->wr_p; + data_pending = txq->data_pending; + + for (simple_idx = head; simple_idx < nb_pkts; simple_idx++) { + pkt = tx_pkts[simple_idx]; + if (!nfp_net_nfdk_is_simple_packet(pkt, txq->hw)) + break; + + simple_count++; + if (!txq->simple_always) + nfp_net_nfdk_vec_avx2_xmit_simple_check(txq, pkt, &simple_flag, + &pending_flag, &data_pending, &wr_p, simple_close); + } + + return simple_count; +} + +static inline uint16_t +nfp_net_nfdk_vec_avx2_xmit_others_count(struct nfp_net_txq *txq, + struct rte_mbuf **tx_pkts, + uint16_t head, + uint16_t nb_pkts) +{ + uint16_t others_idx; + struct rte_mbuf *pkt; + uint16_t others_count = 0; + + for (others_idx = head; others_idx < nb_pkts; others_idx++) { + pkt = tx_pkts[others_idx]; + if (nfp_net_nfdk_is_simple_packet(pkt, txq->hw)) + break; + + others_count++; + } + + return others_count; +} + +static inline uint16_t +nfp_net_nfdk_vec_avx2_xmit_common(void *tx_queue, + struct rte_mbuf **tx_pkts, + uint16_t nb_pkts) +{ + uint16_t i; + uint16_t avail = 0; + uint16_t simple_close; + uint16_t simple_count; + uint16_t simple_avail; + uint16_t others_count; + uint16_t others_avail; + struct nfp_net_txq *txq = tx_queue; + + for (i = 0; i < nb_pkts; i++) { + simple_count = nfp_net_nfdk_vec_avx2_xmit_simple_count(txq, tx_pkts, i, + nb_pkts, &simple_close); + if (simple_count > 0) { + if (!txq->simple_always) + txq->simple_always = true; + + simple_avail = nfp_net_nfdk_vec_avx2_xmit_simple_pkts(txq, + tx_pkts + i, simple_count, simple_close, + false); + + avail += simple_avail; + if (simple_avail != simple_count) + break; + + i += simple_count; + } + + if (i == nb_pkts) + break; + + others_count = nfp_net_nfdk_vec_avx2_xmit_others_count(txq, tx_pkts, + i, nb_pkts); + + if (txq->simple_always) + txq->simple_always = false; + + others_avail = nfp_net_nfdk_xmit_pkts_common(tx_queue, + tx_pkts + i, others_count, false); + + avail += others_avail; + if (others_avail != others_count) + break; + + i += others_count; + } + + return avail; +} + +uint16_t +nfp_net_nfdk_vec_avx2_xmit_pkts(void *tx_queue, + struct rte_mbuf **tx_pkts, + uint16_t nb_pkts) +{ + return nfp_net_nfdk_vec_avx2_xmit_common(tx_queue, tx_pkts, nb_pkts); +} diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_vec_stub.c b/drivers/net/nfp/nfdk/nfp_nfdk_vec_stub.c new file mode 100644 index 0000000000..146ec21d51 --- /dev/null +++ b/drivers/net/nfp/nfdk/nfp_nfdk_vec_stub.c @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2024 Corigine, Inc. + * All rights reserved. + */ + +#include "nfp_nfdk_vec.h" + +uint16_t __rte_weak +nfp_net_nfdk_vec_avx2_xmit_pkts(__rte_unused void *tx_queue, + __rte_unused struct rte_mbuf **tx_pkts, + __rte_unused uint16_t nb_pkts) +{ + return 0; +} diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 8c0cacd3fc..a7b40af712 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -28,6 +28,7 @@ #include "nfp_ipsec.h" #include "nfp_logs.h" #include "nfp_net_flow.h" +#include "nfp_rxtx_vec.h" /* 64-bit per app capabilities */ #define NFP_NET_APP_CAP_SP_INDIFF RTE_BIT64(0) /* Indifferent to port speed */ @@ -964,7 +965,7 @@ nfp_net_ethdev_ops_mount(struct nfp_net_hw *hw, if (hw->ver.extend == NFP_NET_CFG_VERSION_DP_NFD3) eth_dev->tx_pkt_burst = nfp_net_nfd3_xmit_pkts; else - eth_dev->tx_pkt_burst = nfp_net_nfdk_xmit_pkts; + nfp_net_nfdk_xmit_pkts_set(eth_dev); eth_dev->dev_ops = &nfp_net_eth_dev_ops; eth_dev->rx_queue_count = nfp_net_rx_queue_count; diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c index e7c18fe90a..b955624ed6 100644 --- a/drivers/net/nfp/nfp_ethdev_vf.c +++ b/drivers/net/nfp/nfp_ethdev_vf.c @@ -14,6 +14,7 @@ #include "nfp_logs.h" #include "nfp_net_common.h" +#include "nfp_rxtx_vec.h" #define NFP_VF_DRIVER_NAME net_nfp_vf @@ -240,7 +241,7 @@ nfp_netvf_ethdev_ops_mount(struct nfp_net_hw *hw, if (hw->ver.extend == NFP_NET_CFG_VERSION_DP_NFD3) eth_dev->tx_pkt_burst = nfp_net_nfd3_xmit_pkts; else - eth_dev->tx_pkt_burst = nfp_net_nfdk_xmit_pkts; + nfp_net_nfdk_xmit_pkts_set(eth_dev); eth_dev->dev_ops = &nfp_netvf_eth_dev_ops; eth_dev->rx_queue_count = nfp_net_rx_queue_count; diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h index 9806384a63..3ddf717da0 100644 --- a/drivers/net/nfp/nfp_rxtx.h +++ b/drivers/net/nfp/nfp_rxtx.h @@ -69,9 +69,12 @@ struct __rte_aligned(64) nfp_net_txq { /** Used by NFDk only */ uint16_t data_pending; + /** Used by NFDk vector xmit only */ + bool simple_always; + /** * At this point 58 bytes have been used for all the fields in the - * TX critical path. We have room for 6 bytes and still all placed + * TX critical path. We have room for 5 bytes and still all placed * in a cache line. */ uint64_t dma; diff --git a/drivers/net/nfp/nfp_rxtx_vec.h b/drivers/net/nfp/nfp_rxtx_vec.h new file mode 100644 index 0000000000..c92660f963 --- /dev/null +++ b/drivers/net/nfp/nfp_rxtx_vec.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2024 Corigine, Inc. + * All rights reserved. + */ + +#ifndef __NFP_RXTX_VEC_AVX2_H__ +#define __NFP_RXTX_VEC_AVX2_H__ + +#include + +bool nfp_net_get_avx2_supported(void); + +#endif /* __NFP_RXTX_VEC_AVX2_H__ */ diff --git a/drivers/net/nfp/nfp_rxtx_vec_avx2.c b/drivers/net/nfp/nfp_rxtx_vec_avx2.c new file mode 100644 index 0000000000..50638e74ab --- /dev/null +++ b/drivers/net/nfp/nfp_rxtx_vec_avx2.c @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2024 Corigine, Inc. + * All rights reserved. + */ + +#include + +#include +#include + +#include "nfp_rxtx_vec.h" + +bool +nfp_net_get_avx2_supported(void) +{ + if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256 && + rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1) + return true; + + return false; +} diff --git a/drivers/net/nfp/nfp_rxtx_vec_stub.c b/drivers/net/nfp/nfp_rxtx_vec_stub.c new file mode 100644 index 0000000000..1bc55b67e0 --- /dev/null +++ b/drivers/net/nfp/nfp_rxtx_vec_stub.c @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2024 Corigine, Inc. + * All rights reserved. + */ + +#include + +#include + +#include "nfp_rxtx_vec.h" + +bool __rte_weak +nfp_net_get_avx2_supported(void) +{ + return false; +} From patchwork Tue Jul 9 08:24:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 142253 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B0584455DF; Tue, 9 Jul 2024 10:24:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC76F432B2; Tue, 9 Jul 2024 10:24:32 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2090.outbound.protection.outlook.com [40.107.237.90]) by mails.dpdk.org (Postfix) with ESMTP id A8F9443295 for ; Tue, 9 Jul 2024 10:24:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FT7d4KYGMRqon8qPlqr1bZv5Sn3G+h15aoZqG5m92WXZmPuI07nMwk9oyF1tP1oDR8zYZw249KwX+BY66H+Ro2LErOpvfvB74ZaT4p6ChJHhUopR4Dzm7C1NEFsvF+VF5PH55QbrhsGfEOMyCzyZhkQBZ1qTUnts63sTL5X5Vt6tNZmRmHfGeK4On4C4SNoVPYqufRYvzJHf2xfhIu8aG6Y5zxzkRBOX8QynWxWw+3bzKMDmP+IvTjv00WLBHyHu5hzvjAydig9V+vPiZrRYLLDExHDCOMFPeuiUkCuT7FtKN4ZGriMRHtcSN55CdBbDj2h3jy2NOtaC9oLNLMDxHw== 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=N6JCFJ1UfYjxx3p4MczPGXGg1TietJWwueWtE9jfUuI=; b=BSuMC7PZEt/e7L7zGQdDU9L2ToJFdVMXzUqM+ydgPWIruDzMqOtxR8NHBp8xhibBJ6/PPxzMUD58X7o+Lcpw44qYxrn3EdFw2AIKvKkNHzn6T8hKU6iYxAxnoO0yDHNVSSPXijCi8XDn1jUzL/ep5GVhTedu6UWwGTfeutmz5AA3vhUzM9aBlRhOcCswalT+J6JoGaKjL20aFTy4LeVeRw7DgJR4jkKZXSWGQUjef4pvmPgLsBPdz521vOKbX0llVSV4zOY/MJInZE3bJ+ydTAQ4LrgTqk2SZvMAo+THqawsjt+5MVq8jQ72RDCiqt1vv11xbTzFgEWIfegLBx8ClQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N6JCFJ1UfYjxx3p4MczPGXGg1TietJWwueWtE9jfUuI=; b=j8sNmz27btvlXgF5DZ8ZDzWcjq/Uuhe+TUT5GRFGPvhga4ls0lx9ejLlcOs/IcEzsw4r3+kX7DOEXckqycNv17n1desF9SQ+H9tJ4D6EGdrCmiEJLip9DROPZpL3WjEpFXBwvms0b8v6qQC9RZD5aUewgNJgGynydVcUKUYhqJ4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH7PR13MB6194.namprd13.prod.outlook.com (2603:10b6:510:245::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36; Tue, 9 Jul 2024 08:24:29 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%4]) with mapi id 15.20.7741.033; Tue, 9 Jul 2024 08:24:29 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Peng Zhang , Chaoyong He Subject: [PATCH v4 4/5] net/nfp: support AVX2 Rx function Date: Tue, 9 Jul 2024 16:24:04 +0800 Message-Id: <20240709082405.248641-5-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240709082405.248641-1-chaoyong.he@corigine.com> References: <20240709072921.246520-1-chaoyong.he@corigine.com> <20240709082405.248641-1-chaoyong.he@corigine.com> X-ClientProxiedBy: BYAPR05CA0064.namprd05.prod.outlook.com (2603:10b6:a03:74::41) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB6194:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f0014dc-0415-407e-35c6-08dc9ff08d1c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: HR6li5t/l+skKIBBoq3Q/2d81p5Bu35BG28CFa86PFvuXifArQoHjvjSYPzEDj+X8EhVJOUdz6XBhvSLZdrL0Dhq04xRJYUufNPqoTUyFaP9K1uYxODKeWhXgHpiuWJoSNH37hRlCNgSf9f+y9kh3FpS5A/GQRJiNcpGfOffOULaEafFohCoJfPGo0p9ZJl/AYzqnrHTeM8SNNK98eITjKUf7ZIGjobw7QI/q+Z25v+OBXsb91toIDFTUoqJwpQOQMPQZ+eyULiI+2RRamtdWE7WDlBXwhjTy2apdxgrKlHmnV4toVIp22Mq7Tec7ouHrVowlPOrc5pDqviUxvItQKPESxhAWGaWh954vyrH7yVhs9nXLpbD682CShsdYqzIWxT/LqiqJdg70wonOPanJSK5kCD63IHojD3MOV/PaV5uinijlSlNYqtGpyQDJbLNUW/ZrhNuo86AEmHBk+GxfMessnYYDTwgcQ0IkgfBKjxJ9J7OJkvomh/hi5reVMcIOd1yeDKxsf3KAo9KMr2UbDH0yJC7RlVDErrGiGn0Uqgy6kuvEOFpf+ASG7kJaR8+F5XU+XCGGz2IQUpeuh0NY2GeYmqmBTGCbxQNVzHOHlRFOpS7VIGZ+JuEEjgiajYFIsD3hGVKZLNrb2ZbtqKu1ZqoQSgI4g1ehZ84MTQR2Os61QameFUE1tiPU6oBClQC18b1zvqvMPrBQ74vOGZZlp/itdJNMVAJIKVfZcVCoaq78T1ViJ7P17i7oJXZkITU6U3pl1vQsJJa4NRpslwG3cSE6S/146AOhTtXKuN7uASCrWj9ZAbRJ//3Z/7+T0NP22JBfmdn0f9i6bxJZ7IydnoOe/Zg6LkX2gRZdqvWHBn5y5faz41lV1MRpehIjPwkF0DDvO5ozhUMPCtulaXmpSRcCV2VFDSgz7u5OQA01OlCd9BsUY51w8uJJBxFM3Z6FibQSR8dpuKyB6p3AaeI7xBnR0gyg4YQS/hhMftRV1+44gHFEVHXRoN0zh0RzL7LlJxM1q7gs14GKtcyd4ukcGBX2lFWRNIh9lhPK4/Ph13h4s/fOQc1JT97nXWar82T/4bEX8dDCIgyEEINWhw+mCfd4wsRirxKMliFRmF+pYElQJwrXtru0ZPZpbu2unc//Ylhc3Fhv/c7QdPHHaG8Mp/K3MhAhmar2JgayRfa6A7yPRwubc+LDK/uONKGAXXBO8zSVAHaGURqfExbcYO7Cs8DU1YkH6Kh10DW7mBOSC7RAcuUeGnPwd1C6idWhtCEh16EdpXtIsOK51usjq/P2Tdgr4J4Iv2RxsMoNrqpoFqWi7NgXx4VZ3gg0Er7FYvf8TI18JhsojXUxL4ciMlujHGltR2RELS3ROwcX/svMPlvN8UFFGQZ0Gy3iJg51z3zmxDk58wgswRnfm3dj12C+A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: d4YxjocNChx5KFJc23VoXW5Bndnyf5Q9y8/8RomPMOAT69QEpNMjCHQRFIA4HTRUjGSzx0VozkJnZNu/UhstKDTFJ3Zps3jQH+f4UJ/97gCyOZdLtycUs97csH33Z08d6ea8NCmWKFBIZZAQcoeilG+qZtXb9ltQlW7yJ+SEwPIj+5fquXZAOHzYDsn7JA/grM+hbbzt1Fjpfw7EVkdGrd3UBB5UWo9qC0xyAt4IKfx+TMo2jqR8YBMZyE+dDJNpMYP0bS8u+0MhXWLXfJljJPRvKIp0m/rAmpct2Wf6JFpmCmtC8veFuKXiXvfglULuIB0UT6RJbpUpDht145wNRNmLOkszIZ6bpV8IbY+RvQjd0U31E8JMm+RHGU6rPEgZbR6Gia4foRnbbjjOqO6u5nvzgldKzxSbR7RqLnSdWbdVC+tY/sYaVomo/Wv/px2MuOZFEXmO9jJXxE0shsjs/ByaZqj8YCbwlcTUPmyhWp9LiadT+7ut/ycJK/sdDIQmVh2ZbPWq86liDZyKWIYZUROVmRuiUthLaV9/BopKoaPkDt73it+NV/0MlcHH3PDSj0iuu5wU4t5hsVyAB66tVi5dRb1FEMddjUvMNfQgBODvPnHlLlaSEJVrrCIJONSF5Z34K1Uaw/i5vQvLGAwkrIOUfdiHWlg3vf/jDNx/Gp0N3eNIKTdMqiUFMiL/a2USyJs5Pj/ky04Wxwd5tmn4TgGtxv09O5cPjE17pLqi2CmmDew+mxEglZNH26tlCxA5CGHuPBEbWMwEwMlcG6csLdIHadP+VuSJgeraYjY5kUNHoin9Sj0ZvbVFJhow9JOPh8xp99tB9QdUEL+IUJ303S69GXdSOON4iIfgzk7VkeEKqnnDTTVuT9j69VFAFZMtfxTil/ZvASSeoDN+BiBMjDyzka4A/dKgU+dZXC8zBIAll5ZXoPeH1S52YZetLb2uUsANJAxwjlqD/Ctj1P/9Y0NwE7gs/i354fXUBt6Msq8QPfd8AqP6fev8mAtzfXPFX5MQ1DCi0L1dHsi894rxdlgu5jMiIPC8STRKkbOcJrBXfYU1X/cL50jIK3AsilsA1x9u45/939j5dFvaTheAWAca/EK+7e/ncgZFRMznsDKFiMaVMUb7EfitXAkdtBnFzHdZPZmNU8sDKB77ZEL88FiF4YHZQms0P5fNrWKHzjxsQZX4R/2+hzw3WdWdOSoP+267VOZEcG+OW4koKoravYBoZDm4rUFDKb+t8v6KYzHuvui3rKUJPTDOsu76FwVpwPWMQtDVyE5vFTVBCvyhIFxD730lTgE3QLwhAWBXpZY/seXyBQedAGBSGLdGVmIN1wRhotJyd5K8TNeIrIPgkqN4xH24QjYmL2XpjPgYGy/Pc0AXYALl8B6C009zNOE51r/LMKZo3QAis+4u1VPHO8UfuN0yo78netLE4YdkzLN892003AboIaohpEQ9GVQG64iRD0BG/x9W0iVhjhdIWy4ik9XzH9r0/dnKhOfohuqy4umqA0Tbh6ttfAWTotvF8Ahizkrr8oQIZlLLIADdHnX92IwckeKbrIyns2LsM62EvaBee/PniKrB9YUe2MKVZzu966+Vr56Ax5aHklfU4w== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f0014dc-0415-407e-35c6-08dc9ff08d1c X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2024 08:24:29.1234 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: juSJhAKwX1fscuE3gocpHwBJKzNDvxJPC6i6t67f4FJTxeQCQJsG8NbaSaGyAnBnZdxLm47QRHkXlAMBzSVGnLp96Wr6jZLVIQrf1b+8Lec= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB6194 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Long Wu Use AVX2 instructions to accelerate Rx performance. The acceleration only works on X86 machine. Signed-off-by: Peng Zhang Signed-off-by: Long Wu Reviewed-by: Chaoyong He --- drivers/net/nfp/nfp_ethdev.c | 2 +- drivers/net/nfp/nfp_ethdev_vf.c | 2 +- drivers/net/nfp/nfp_net_meta.c | 1 + drivers/net/nfp/nfp_rxtx.c | 10 ++ drivers/net/nfp/nfp_rxtx.h | 1 + drivers/net/nfp/nfp_rxtx_vec.h | 4 + drivers/net/nfp/nfp_rxtx_vec_avx2.c | 252 ++++++++++++++++++++++++++++ drivers/net/nfp/nfp_rxtx_vec_stub.c | 9 + 8 files changed, 279 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index a7b40af712..bd35df2dc9 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -969,7 +969,7 @@ nfp_net_ethdev_ops_mount(struct nfp_net_hw *hw, eth_dev->dev_ops = &nfp_net_eth_dev_ops; eth_dev->rx_queue_count = nfp_net_rx_queue_count; - eth_dev->rx_pkt_burst = &nfp_net_recv_pkts; + nfp_net_recv_pkts_set(eth_dev); } static int diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c index b955624ed6..cdf5da3af7 100644 --- a/drivers/net/nfp/nfp_ethdev_vf.c +++ b/drivers/net/nfp/nfp_ethdev_vf.c @@ -245,7 +245,7 @@ nfp_netvf_ethdev_ops_mount(struct nfp_net_hw *hw, eth_dev->dev_ops = &nfp_netvf_eth_dev_ops; eth_dev->rx_queue_count = nfp_net_rx_queue_count; - eth_dev->rx_pkt_burst = &nfp_net_recv_pkts; + nfp_net_recv_pkts_set(eth_dev); } static int diff --git a/drivers/net/nfp/nfp_net_meta.c b/drivers/net/nfp/nfp_net_meta.c index b31ef56f17..07c6758d33 100644 --- a/drivers/net/nfp/nfp_net_meta.c +++ b/drivers/net/nfp/nfp_net_meta.c @@ -80,6 +80,7 @@ nfp_net_meta_parse_single(uint8_t *meta_base, rte_be32_t meta_header, struct nfp_net_meta_parsed *meta) { + meta->flags = 0; meta->flags |= (1 << NFP_NET_META_HASH); meta->hash_type = rte_be_to_cpu_32(meta_header); meta->hash = rte_be_to_cpu_32(*(rte_be32_t *)(meta_base + 4)); diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c index 1db79ad1cd..4fc3374987 100644 --- a/drivers/net/nfp/nfp_rxtx.c +++ b/drivers/net/nfp/nfp_rxtx.c @@ -17,6 +17,7 @@ #include "nfp_ipsec.h" #include "nfp_logs.h" #include "nfp_net_meta.h" +#include "nfp_rxtx_vec.h" /* * The bit format and map of nfp packet type for rxd.offload_info in Rx descriptor. @@ -867,3 +868,12 @@ nfp_net_tx_queue_info_get(struct rte_eth_dev *dev, info->conf.offloads = dev_info.tx_offload_capa & dev->data->dev_conf.txmode.offloads; } + +void +nfp_net_recv_pkts_set(struct rte_eth_dev *eth_dev) +{ + if (nfp_net_get_avx2_supported()) + eth_dev->rx_pkt_burst = nfp_net_vec_avx2_recv_pkts; + else + eth_dev->rx_pkt_burst = nfp_net_recv_pkts; +} diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h index 3ddf717da0..fff8371991 100644 --- a/drivers/net/nfp/nfp_rxtx.h +++ b/drivers/net/nfp/nfp_rxtx.h @@ -244,5 +244,6 @@ void nfp_net_rx_queue_info_get(struct rte_eth_dev *dev, void nfp_net_tx_queue_info_get(struct rte_eth_dev *dev, uint16_t queue_id, struct rte_eth_txq_info *qinfo); +void nfp_net_recv_pkts_set(struct rte_eth_dev *eth_dev); #endif /* __NFP_RXTX_H__ */ diff --git a/drivers/net/nfp/nfp_rxtx_vec.h b/drivers/net/nfp/nfp_rxtx_vec.h index c92660f963..8720662744 100644 --- a/drivers/net/nfp/nfp_rxtx_vec.h +++ b/drivers/net/nfp/nfp_rxtx_vec.h @@ -10,4 +10,8 @@ bool nfp_net_get_avx2_supported(void); +uint16_t nfp_net_vec_avx2_recv_pkts(void *rx_queue, + struct rte_mbuf **rx_pkts, + uint16_t nb_pkts); + #endif /* __NFP_RXTX_VEC_AVX2_H__ */ diff --git a/drivers/net/nfp/nfp_rxtx_vec_avx2.c b/drivers/net/nfp/nfp_rxtx_vec_avx2.c index 50638e74ab..7c18213624 100644 --- a/drivers/net/nfp/nfp_rxtx_vec_avx2.c +++ b/drivers/net/nfp/nfp_rxtx_vec_avx2.c @@ -5,9 +5,14 @@ #include +#include +#include #include #include +#include "nfp_logs.h" +#include "nfp_net_common.h" +#include "nfp_net_meta.h" #include "nfp_rxtx_vec.h" bool @@ -19,3 +24,250 @@ nfp_net_get_avx2_supported(void) return false; } + +static inline void +nfp_vec_avx2_recv_set_des1(struct nfp_net_rxq *rxq, + struct nfp_net_rx_desc *rxds, + struct rte_mbuf *rxb) +{ + __m128i dma; + __m128i dma_hi; + __m128i vaddr0; + __m128i hdr_room = _mm_set_epi64x(0, RTE_PKTMBUF_HEADROOM); + + dma = _mm_add_epi64(_mm_loadu_si128((__m128i *)&rxb->buf_addr), hdr_room); + dma_hi = _mm_srli_epi64(dma, 32); + vaddr0 = _mm_unpacklo_epi32(dma_hi, dma); + + _mm_storel_epi64((void *)rxds, vaddr0); + + rxq->rd_p = (rxq->rd_p + 1) & (rxq->rx_count - 1); +} + +static inline void +nfp_vec_avx2_recv_set_des4(struct nfp_net_rxq *rxq, + struct nfp_net_rx_desc *rxds, + struct rte_mbuf **rxb) +{ + __m128i dma; + __m128i dma_hi; + __m128i vaddr0; + __m128i vaddr1; + __m128i vaddr2; + __m128i vaddr3; + __m128i vaddr0_1; + __m128i vaddr2_3; + __m256i vaddr0_3; + __m128i hdr_room = _mm_set_epi64x(0, RTE_PKTMBUF_HEADROOM); + + dma = _mm_add_epi64(_mm_loadu_si128((__m128i *)&rxb[0]->buf_addr), hdr_room); + dma_hi = _mm_srli_epi64(dma, 32); + vaddr0 = _mm_unpacklo_epi32(dma_hi, dma); + + dma = _mm_add_epi64(_mm_loadu_si128((__m128i *)&rxb[1]->buf_addr), hdr_room); + dma_hi = _mm_srli_epi64(dma, 32); + vaddr1 = _mm_unpacklo_epi32(dma_hi, dma); + + dma = _mm_add_epi64(_mm_loadu_si128((__m128i *)&rxb[2]->buf_addr), hdr_room); + dma_hi = _mm_srli_epi64(dma, 32); + vaddr2 = _mm_unpacklo_epi32(dma_hi, dma); + + dma = _mm_add_epi64(_mm_loadu_si128((__m128i *)&rxb[3]->buf_addr), hdr_room); + dma_hi = _mm_srli_epi64(dma, 32); + vaddr3 = _mm_unpacklo_epi32(dma_hi, dma); + + vaddr0_1 = _mm_unpacklo_epi64(vaddr0, vaddr1); + vaddr2_3 = _mm_unpacklo_epi64(vaddr2, vaddr3); + + vaddr0_3 = _mm256_inserti128_si256(_mm256_castsi128_si256(vaddr0_1), + vaddr2_3, 1); + + _mm256_store_si256((void *)rxds, vaddr0_3); + + rxq->rd_p = (rxq->rd_p + 4) & (rxq->rx_count - 1); +} + +static inline void +nfp_vec_avx2_recv_set_rxpkt1(struct nfp_net_rxq *rxq, + struct nfp_net_rx_desc *rxds, + struct rte_mbuf *rx_pkt) +{ + struct nfp_net_hw *hw = rxq->hw; + struct nfp_net_meta_parsed meta; + + rx_pkt->data_len = rxds->rxd.data_len - NFP_DESC_META_LEN(rxds); + /* Size of the whole packet. We just support 1 segment */ + rx_pkt->pkt_len = rxds->rxd.data_len - NFP_DESC_META_LEN(rxds); + + /* Filling the received mbuf with packet info */ + if (hw->rx_offset) + rx_pkt->data_off = RTE_PKTMBUF_HEADROOM + hw->rx_offset; + else + rx_pkt->data_off = RTE_PKTMBUF_HEADROOM + NFP_DESC_META_LEN(rxds); + + rx_pkt->port = rxq->port_id; + rx_pkt->nb_segs = 1; + rx_pkt->next = NULL; + + nfp_net_meta_parse(rxds, rxq, hw, rx_pkt, &meta); + + /* Checking the checksum flag */ + nfp_net_rx_cksum(rxq, rxds, rx_pkt); +} + +static inline void +nfp_vec_avx2_recv1(struct nfp_net_rxq *rxq, + struct nfp_net_rx_desc *rxds, + struct rte_mbuf *rxb, + struct rte_mbuf *rx_pkt) +{ + nfp_vec_avx2_recv_set_rxpkt1(rxq, rxds, rx_pkt); + + nfp_vec_avx2_recv_set_des1(rxq, rxds, rxb); +} + +static inline void +nfp_vec_avx2_recv4(struct nfp_net_rxq *rxq, + struct nfp_net_rx_desc *rxds, + struct rte_mbuf **rxb, + struct rte_mbuf **rx_pkts) +{ + nfp_vec_avx2_recv_set_rxpkt1(rxq, rxds, rx_pkts[0]); + nfp_vec_avx2_recv_set_rxpkt1(rxq, rxds + 1, rx_pkts[1]); + nfp_vec_avx2_recv_set_rxpkt1(rxq, rxds + 2, rx_pkts[2]); + nfp_vec_avx2_recv_set_rxpkt1(rxq, rxds + 3, rx_pkts[3]); + + nfp_vec_avx2_recv_set_des4(rxq, rxds, rxb); +} + +static inline bool +nfp_vec_avx2_recv_check_packets4(struct nfp_net_rx_desc *rxds) +{ + __m256i data = _mm256_loadu_si256((void *)rxds); + + if ((_mm256_extract_epi8(data, 3) & PCIE_DESC_RX_DD) == 0 || + (_mm256_extract_epi8(data, 11) & PCIE_DESC_RX_DD) == 0 || + (_mm256_extract_epi8(data, 19) & PCIE_DESC_RX_DD) == 0 || + (_mm256_extract_epi8(data, 27) & PCIE_DESC_RX_DD) == 0) + return false; + + return true; +} + +uint16_t +nfp_net_vec_avx2_recv_pkts(void *rx_queue, + struct rte_mbuf **rx_pkts, + uint16_t nb_pkts) +{ + uint16_t avail; + uint16_t nb_hold; + bool burst_receive; + struct rte_mbuf **rxb; + struct nfp_net_rx_desc *rxds; + struct nfp_net_rxq *rxq = rx_queue; + + if (unlikely(rxq == NULL)) { + PMD_RX_LOG(ERR, "RX Bad queue"); + return 0; + } + + avail = 0; + nb_hold = 0; + burst_receive = true; + while (avail < nb_pkts) { + rxds = &rxq->rxds[rxq->rd_p]; + rxb = &rxq->rxbufs[rxq->rd_p].mbuf; + + if ((_mm_extract_epi8(_mm_loadu_si128((void *)(rxds)), 3) + & PCIE_DESC_RX_DD) == 0) + goto recv_end; + + rte_prefetch0(rxq->rxbufs[rxq->rd_p].mbuf); + + if ((rxq->rd_p & 0x3) == 0) { + rte_prefetch0(&rxq->rxds[rxq->rd_p]); + rte_prefetch0(&rxq->rxbufs[rxq->rd_p]); + rte_prefetch0(rxq->rxbufs[rxq->rd_p + 1].mbuf); + rte_prefetch0(rxq->rxbufs[rxq->rd_p + 2].mbuf); + rte_prefetch0(rxq->rxbufs[rxq->rd_p + 3].mbuf); + } + + if ((rxq->rd_p & 0x7) == 0) { + rte_prefetch0(rxq->rxbufs[rxq->rd_p + 4].mbuf); + rte_prefetch0(rxq->rxbufs[rxq->rd_p + 5].mbuf); + rte_prefetch0(rxq->rxbufs[rxq->rd_p + 6].mbuf); + rte_prefetch0(rxq->rxbufs[rxq->rd_p + 7].mbuf); + } + + /* + * If can not receive burst, just receive one. + * 1. Rx ring will coming to the tail. + * 2. Do not need to receive 4 packets. + * 3. If pointer address unaligned on 32-bit boundary. + * 4. Rx ring does not have 4 packets or alloc 4 mbufs failed. + */ + if ((rxq->rx_count - rxq->rd_p) < 4 || + (nb_pkts - avail) < 4 || + ((uintptr_t)rxds & 0x1F) != 0 || + !burst_receive) { + _mm_storel_epi64((void *)&rx_pkts[avail], + _mm_loadu_si128((void *)rxb)); + + /* Allocate a new mbuf into the software ring. */ + if (rte_pktmbuf_alloc_bulk(rxq->mem_pool, rxb, 1) < 0) { + PMD_RX_LOG(DEBUG, "RX mbuf alloc failed port_id=%u queue_id=%hu", + rxq->port_id, rxq->qidx); + nfp_net_mbuf_alloc_failed(rxq); + goto recv_end; + } + + nfp_vec_avx2_recv1(rxq, rxds, *rxb, rx_pkts[avail]); + + avail++; + nb_hold++; + continue; + } + + burst_receive = nfp_vec_avx2_recv_check_packets4(rxds); + if (!burst_receive) + continue; + + _mm256_storeu_si256((void *)&rx_pkts[avail], + _mm256_loadu_si256((void *)rxb)); + + /* Allocate 4 new mbufs into the software ring. */ + if (rte_pktmbuf_alloc_bulk(rxq->mem_pool, rxb, 4) < 0) { + burst_receive = false; + continue; + } + + nfp_vec_avx2_recv4(rxq, rxds, rxb, &rx_pkts[avail]); + + avail += 4; + nb_hold += 4; + } + +recv_end: + if (nb_hold == 0) + return nb_hold; + + PMD_RX_LOG(DEBUG, "RX port_id=%u queue_id=%u, %d packets received", + rxq->port_id, (unsigned int)rxq->qidx, nb_hold); + + nb_hold += rxq->nb_rx_hold; + + /* + * FL descriptors needs to be written before incrementing the + * FL queue WR pointer + */ + rte_wmb(); + if (nb_hold > rxq->rx_free_thresh) { + PMD_RX_LOG(DEBUG, "port=%hu queue=%hu nb_hold=%hu avail=%hu", + rxq->port_id, rxq->qidx, nb_hold, avail); + nfp_qcp_ptr_add(rxq->qcp_fl, NFP_QCP_WRITE_PTR, nb_hold); + nb_hold = 0; + } + rxq->nb_rx_hold = nb_hold; + + return avail; +} diff --git a/drivers/net/nfp/nfp_rxtx_vec_stub.c b/drivers/net/nfp/nfp_rxtx_vec_stub.c index 1bc55b67e0..c480f61ef0 100644 --- a/drivers/net/nfp/nfp_rxtx_vec_stub.c +++ b/drivers/net/nfp/nfp_rxtx_vec_stub.c @@ -6,6 +6,7 @@ #include #include +#include #include "nfp_rxtx_vec.h" @@ -14,3 +15,11 @@ nfp_net_get_avx2_supported(void) { return false; } + +uint16_t __rte_weak +nfp_net_vec_avx2_recv_pkts(__rte_unused void *rx_queue, + __rte_unused struct rte_mbuf **rx_pkts, + __rte_unused uint16_t nb_pkts) +{ + return 0; +} From patchwork Tue Jul 9 08:24:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 142254 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id ADDAA455DF; Tue, 9 Jul 2024 10:25:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 22D01432C2; Tue, 9 Jul 2024 10:24:34 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2134.outbound.protection.outlook.com [40.107.237.134]) by mails.dpdk.org (Postfix) with ESMTP id 25F344328F for ; Tue, 9 Jul 2024 10:24:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cwfveUKPSOkDP1eDstFRiNJ3PHk8gtQVl34tZgBUeMGVFN/3o1/AlZdau1jAfAfC9IkpHB8GPqabiIf62acOD9AK+MsP9Trb/UyJO2eqGg2u9szXUZS3wTCtR3qzF1vEB0QU3WLspXf4KTgIqWLFlUcaqDtfgcySf4RsqeuDXFxv9qeipdT4bg0mCiHzuUA2+ArYABbhk34iLw4GwRitlvXmRLYx2hMyym9D3l1FLj/Z+2VMIEthxyb+AzAvafDrAQI7O0yB+WP2/huDOUXIK6cp1BcrGls9j9ZI1g6SENxuKbx3hcH52AKGtg+Ll/fu73znW1vj4e+acUv2I/tzJg== 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=p64hUxkicniOAYwq8iKQMxOI6MhjeHh5BudBbr/9XQA=; b=tNTgufuO4VZBcKp8mR74V0RUO3fV38qVmklT9Mr/PBuj9aI9kg1ma5cmmrabbyuivJ9dQwMtzX5hM13w2Vi954YuTvHPj+3HUA7bUGQg+4Wdfk9CKqztxodntA5O3TXnZ9CdwHzVGoGLZRYDCy16S+QW016nFcY9YC4V7MyOXS4XgvJYsatWk2r3Nj/yX0/30xvsqJBSOQRCxxpb6V4euM5WISWkK00Q8KgKBZySIWAutBwByt/beW35eySjAY3wz/uZxqzae1x8GXlvVUecz0MuUGurI+fDh2CrahRpmpmvT/QvefHYs7o2NsOdcoQNNbco0SnpwWlW9bZL6QenbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p64hUxkicniOAYwq8iKQMxOI6MhjeHh5BudBbr/9XQA=; b=jidOxPloGGJ1V144RENJ7sRw0ibafF0Ylg54hN5im4wFe0sCeS4F21hAIiDqBHdaSv19KYzYIy1Z70NO+fNh9p/Stcwlx9TdJpLkXPYxslOBNKB9xGOdDIlyghR44jH9T9XQJZ7f4Yq4UO9EACp5WGNki7kx9ckNTzswlWdKA2k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by PH7PR13MB6194.namprd13.prod.outlook.com (2603:10b6:510:245::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36; Tue, 9 Jul 2024 08:24:30 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%4]) with mapi id 15.20.7741.033; Tue, 9 Jul 2024 08:24:30 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Chaoyong He Subject: [PATCH v4 5/5] net/nfp: vector Rx function supports parsing ptype Date: Tue, 9 Jul 2024 16:24:05 +0800 Message-Id: <20240709082405.248641-6-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240709082405.248641-1-chaoyong.he@corigine.com> References: <20240709072921.246520-1-chaoyong.he@corigine.com> <20240709082405.248641-1-chaoyong.he@corigine.com> X-ClientProxiedBy: BYAPR05CA0064.namprd05.prod.outlook.com (2603:10b6:a03:74::41) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB6194:EE_ X-MS-Office365-Filtering-Correlation-Id: df402b08-66b7-471c-a294-08dc9ff08e1f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: DLozjnTb29AkFRMiYqvt+9ptZqNtZJUSdUCjTlw+VB+Vovnw/j3sk5KfJd7yzcgbOZ2I/qv4k2Jwl5w2OXYR7ApUcrf3hKR9gPirZ5zD6Z55cAMcuAoMIF9w2es0rxz8C5GaEfYiYUkEn9D8BLXto3RvS4baDNwhfg/W64u/cVoW+7lZETb5UnSvnEQ2F+qy1ci1qL0Ap0lLsA1/XtsXtl76FfiOE+9dls8gxu+BGQUCDOy23iUMbid4OTT/rNwA0dKyn1sMsL24MR/uRu+kaiseN+1QMYmOo9DP7x3gjF1H5JvYuahqFAl/2sZbjnmWPGXPS6M3hRFwi/bB9ViatXk+w2G+mG7HHyoM9szHLRradrs2/sTnd3D4Uxw/Ju3/bETg6IDp8r+ERgzqzAOiqz9A1iJnaoFd5IXZkky6Gm2j6MKSY6HnYOuZBi+vobPjLYxIzR5gB3Gdr3AX73cSX42qzNLvdzjpupBQPxW61bIKjZ6xmBRbOCpul/nhxQ6QY/UnoB+brdOfdnSlYYve0zIGFuo2Ro9FOQvjCy0ny1fn7J5GglGux8sf2KzvqIA7z+Rz3vquphDJpJ5ZW4G5iQTlrP2nwSxRoRcGji+bpgfNQRVpJdZd2AeakeXU8hHVrR06e/Vi87W42m4P9EwP8DeRhTR3Qk3bDZFVR7lEW/KDMYzy7qus/WzckjUQnEsIRJLdt/Ahoarg7F7PZSb7PZUPaigzcq+PJAx2C5OhyDFMPPQG/xnyzG2DrEClw4uYPyaEN+l+cf5cblMt4CHYPeMhcgZ5ZphORHSYQ0q/i6UbRtCfkPazbBi6nfXS+9F2i6WUEMijJrnhPelrbEDTff8vrz8SPGV2sFch6JpSnU3og51MeWx0u5ld88eUAiYSU3p/CI9HZhXinhBWi61LDIgDaO0I7BK5TSLy2TCDJKfhB6mz1z/giCQH0YgxqqL8IVxN7AahkqProg2TuhjystgjBQOp1NIfQSVL0i+P2fWqGOS6byrR3h1Agpg4CXSNluL9IRerjIaCcGclbRilTe0HMa3AmJ8S9DE9L/EX6IW9vovferJ83mczG4vEPxDsDQ15vUBeQK0oTcpcP9vkOdHM9x9aXGRcaY1ZfInoydcoZpOgG0PSvXxi3jlOHEdFUQEZbRz8TnylDIdTs78CDomdxlx2Dh/DT9gC1LEPl0nk9RgCcvLlWJG+XNWHcwxJ1QixxPV1b05kuiE/xDAT/C/GPJZz6a8bcroP1gdjeDfnatBnvHC3w5uEWgzwYc4SOmc9NWrJQ4FwcrtP+yevHLF4DHeheMYRFdbMHI+6srobBqMjPbbtyuVHhobjzceKKDyJfCrjV8N4QvXCDN7BzIWvBZfvZb006T2RF3CqPCvB5cje5ry13EQhh1FqhocfupaOLLXci8qf07xs8omLxA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5F1qpvAXSmDyjWUjWM9iU9z8sZHX3LOjC5+eHQWduzP+wkMulebdKzjoLY50e7A+3T94XIwoni4gmDHIOgiRVfO7c7dlEFcfnAt+FLrGENdguJM7oVtH81KDIZgem7QlY6YYHlDOuBtgojMngKzIAJMkk04YuF47X5L0bJRWii317ph0Q30WlUhog+UqLaRg5BR+nKIA0C3+oUo3kh4GzH3Hpr/jcfJbGk6lO1YDadKZ9c4AYsVYm2gjmOu35U2TbfpFPpcYi5hN0hPCFpOlwpsSa/IVktIj2QPCdEEdAp68w9F0GNvuuytXvmvtWWhSdwrA4uG40FytuCXRcB/IdVcvJetX8IBfHtAFpUktzxxjvu/2DLMKCd7t50RXZy1/u0FXnTTFS6ITIvH0XHSQQxDDeU0xXGTmLlYIMVWqvEHekm/DxRkF3mFZBZXSpu89LOLZ31KV2d2MqpwjmPu8PeJCKZgCEIsTuajp6UL8h/En0ZaUv/THaPPoPNxLwZjhhDiplLQnw7CyZ+FmLlHQWbV2VPh7AqowrAjShEFJPOzeHwRkKFDaWQVHDgE8ykYfDWUlQX9HTE9LP+dyICeXyATuj9JiHbbk3AiMK5XYkAdhpHTMJLjlypIT8AusGQC3n53MUWepbeD1wT/D/cEGjY3SBsL7WGb8gPy4tASolmgR1wHAzDkTmLyvkz98SAxaYtECsKxrqoVuqAxnjkSKKhhS2yve6ZR50T24lQ0NcD4qp2/t9xeHPJVxsPL3vqLDsHyQspdDqjfTKhegueuQ3+slJKa3MThX3Tu3fot0dIgsqnfldUcvjkl+1XUdoi44el43GKUkCjEAPg5UWJKw329Rl3QvpEsRt3n3pyXVuwy92VGEkyJCwCLgHt59vddee7qdy8UtECkzIfQJzf8vPVwiWS2tj837qcZV/hwXKbO7XrAjydk4bMUAXEncbt2V7xcorZvCJUsALT02QH59lZSTK3XTWznYRUJh3xnvZVxOuLYYaJorrBYOukAiD5rY9xY7I0nqxOuTv6VWjpJ1a2CjLhsZK+BwXT8wSu/2boSBPfU82sVobYgqsmJiflAuUSoPzMKJk01DYOUKJy5pByq9roLUBNya+e05VcC595mwzUatHPG9g4dAH7QkHfHcuoP+CFhLeWaZilI05Mq+ThbuLTmQfrLjfoEJ3jQcf272S00u7Im0ui2IJgE5KLaPan0spbslDiwF/dq03y0Jbbnr4z9Dwtaigy8jZiCq2EvCr7DmA1Eb9lX8/whoeo5kPeN1Ze1TB00KQUngsf92syrmNmXE+7M6/VTRi9YiA3uBZuhyC614BAFo2FLZZ0YZL8xmBoh6xfRbdEM/865BRfFdSCnY9jxNsIbR+n3Q7kAIjMPbs9BCKVtvspELYUkZe+4A+CR9xAlU7M7o3jA8GMkC9WhZ+Cirud2oqaBLl7zuDs4rZb6xBdomcLVNR4hl4OUTrWTtqhMAvFe7CnngnxsHzWZBjBTRf8fhExmlIrQeTYRUfOpmI2HK+CpVb0f6KE8Cs9JZFpXGjSv2k+XsMTTeiT8AeNMb1Ni8ISdoqhZ+6lDC0b69i132AI64EStDoiulanWDmjU6xS1wX/G0Xw== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: df402b08-66b7-471c-a294-08dc9ff08e1f X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2024 08:24:30.8362 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: npjUJ5pO9fxZ760+yeD91Dlkn+S5gKvelYKsWvxEfmZEkOTTEQtAeJlDgrzk5a5P3DCMAuAt8j0ggCPrtrdy2xzswbAzwpfbz2iX0OOP35Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB6194 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Long Wu Vector AVX2 Rx function supports parsing packet type and set it to mbuf. Signed-off-by: Long Wu Reviewed-by: Chaoyong He --- drivers/net/nfp/nfp_net_common.c | 2 +- drivers/net/nfp/nfp_rxtx.c | 2 +- drivers/net/nfp/nfp_rxtx.h | 3 +++ drivers/net/nfp/nfp_rxtx_vec_avx2.c | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfp/nfp_net_common.c b/drivers/net/nfp/nfp_net_common.c index 08693d5fba..3d916cd147 100644 --- a/drivers/net/nfp/nfp_net_common.c +++ b/drivers/net/nfp/nfp_net_common.c @@ -1455,7 +1455,7 @@ nfp_net_supported_ptypes_get(struct rte_eth_dev *dev, size_t *no_of_elements) RTE_PTYPE_INNER_L4_SCTP, }; - if (dev->rx_pkt_burst != nfp_net_recv_pkts) + if (dev->rx_pkt_burst == NULL) return NULL; net_hw = dev->data->dev_private; diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c index 4fc3374987..da41a0e663 100644 --- a/drivers/net/nfp/nfp_rxtx.c +++ b/drivers/net/nfp/nfp_rxtx.c @@ -350,7 +350,7 @@ nfp_net_set_ptype(const struct nfp_ptype_parsed *nfp_ptype, * @param mb * Mbuf to set the packet type. */ -static void +void nfp_net_parse_ptype(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxds, struct rte_mbuf *mb) diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h index fff8371991..c717d97003 100644 --- a/drivers/net/nfp/nfp_rxtx.h +++ b/drivers/net/nfp/nfp_rxtx.h @@ -245,5 +245,8 @@ void nfp_net_tx_queue_info_get(struct rte_eth_dev *dev, uint16_t queue_id, struct rte_eth_txq_info *qinfo); void nfp_net_recv_pkts_set(struct rte_eth_dev *eth_dev); +void nfp_net_parse_ptype(struct nfp_net_rxq *rxq, + struct nfp_net_rx_desc *rxds, + struct rte_mbuf *mb); #endif /* __NFP_RXTX_H__ */ diff --git a/drivers/net/nfp/nfp_rxtx_vec_avx2.c b/drivers/net/nfp/nfp_rxtx_vec_avx2.c index 7c18213624..508ec7faa5 100644 --- a/drivers/net/nfp/nfp_rxtx_vec_avx2.c +++ b/drivers/net/nfp/nfp_rxtx_vec_avx2.c @@ -111,6 +111,8 @@ nfp_vec_avx2_recv_set_rxpkt1(struct nfp_net_rxq *rxq, nfp_net_meta_parse(rxds, rxq, hw, rx_pkt, &meta); + nfp_net_parse_ptype(rxq, rxds, rx_pkt); + /* Checking the checksum flag */ nfp_net_rx_cksum(rxq, rxds, rx_pkt); }