From patchwork Wed Jul 17 03:24:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 142452 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 F0ADE4562D; Wed, 17 Jul 2024 05:25:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9FF8740A7D; Wed, 17 Jul 2024 05:25:20 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2097.outbound.protection.outlook.com [40.107.92.97]) by mails.dpdk.org (Postfix) with ESMTP id 5A3EE40299 for ; Wed, 17 Jul 2024 05:25:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GIBig/UbSKVph21R5cscQ/ip13lShNe/+L7KGuophKGcm9TF4P9TlpcunbnV1MHzqO2SAquDv8cOl1SbqgNXUMn6e6JlTwm0bGwRI91SI/gbON4P/EFIcKNVpi6sD39I/ouN1pE6ttI6s4F5lVKCDMzfl7C/VuIAdlPAjJgGmqyz19TvgBM6ZQfn+X5vsvQxxUYm0yvE17XI2RHQDQLXLtdLHSLm4ByCJLYi3W5T7d62Uii81vtKDwkxQ/o2M4awL5XCCh1ZGQ7+jUk79MHuJeOwpLRZ1P0NdRkf6cm2rDYnu02X+T2tVvesjquqI/EbCcn+qErur6wQbEfTmcW6pw== 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=xwmoBiBhoLn3clLx29rthTk6bNdRd4+5hQIRuWLoI4s=; b=B/5vXeT8P8e4FizBIrZQYhEZwRuLQzTwmq370idkoPHXJ6R/Bw5ac1ZaERmlgMy1qrLuElIZ9oVY8ep3uBoEb72v9fp4eoaA3CrHMDjjDlkMP80g+pxLfEB8/CyRhCVw/PwLbu0n8Wt7+6Eac2O16sMxet7IW+poNXBpjnHmNoQ3lrZ4Cp18t2ICxhRMscH/3xrpZwpwFDoOb9DAIjPySwVMJCDGq7vegMsCmWKWmvJ+blbH7/FXAzHZOYO074TBEJaT5AG0c8ENxTd0c/PpWy1MzjOhMTUZ38bxSCxw/yd5s5OE4xBQJqSHG1L7wDNz5I2aoDKsUQSHXtHGMqQX1g== 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=xwmoBiBhoLn3clLx29rthTk6bNdRd4+5hQIRuWLoI4s=; b=vlh4xqNkVvTDM//jiubNIDHvckOsGKhBlOyya3wrEBSSRGgSiELBUQ4WHNehvWZhAVXqgzUPKJ8VMzM9ZhMMPnsEXpVgrF+enTxUzKaZIuGauD4+YJ0/+wpFAja522jzBxPBlk5WMOd48g1l2Axfo1UmGw5BxSKs+9ALxiuspKI= 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 CO1PR13MB4917.namprd13.prod.outlook.com (2603:10b6:303:f8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Wed, 17 Jul 2024 03:25:16 +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.7762.027; Wed, 17 Jul 2024 03:25:16 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , Long Wu , Peng Zhang Subject: [PATCH 1/2] net/nfp: fix copy and paste error Date: Wed, 17 Jul 2024 11:24:44 +0800 Message-Id: <20240717032445.442348-2-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240717032445.442348-1-chaoyong.he@corigine.com> References: <20240717032445.442348-1-chaoyong.he@corigine.com> X-ClientProxiedBy: SG2PR03CA0127.apcprd03.prod.outlook.com (2603:1096:4:91::31) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CO1PR13MB4917:EE_ X-MS-Office365-Filtering-Correlation-Id: dddb745d-ee62-4ee1-f7fd-08dca6101397 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: jDpLaojkoId4KW2FSRHzNWQm3JUgsPTP3tpYJOjRFRa0oIcitq/pe6uYRlhXAGk1bkszgEI0PW1wf3/K5Hqo3r9KvYCVPVnJuuFV4F4hwSOBB8UOftnX+XLW2wsniIsfIW3ZN0Lwgre0wUaALbN0Z64T6pOrCTp6a7QUWvcchrBGC6/DfzDalMJYLoeMEU9SqUTWQ3NPnEEylAREB0K/6kkXl54zRCudYG3Y5B5ddWEoUnzVIYE1IfUWphAC9IF2eNycq520z6ww92ZquqcSIkXB0BGBogFj30rVNOBWp0M5tGDjIlSJ2iFYRLMbF37yds9LKOSwJ1E+MqNSLBHXNT8DIMIcd/CyV1aEmUbzRf330dld4mHSVWi5IQIeQAj62ZMuTrlUJlv08IRaM7KyO76eibqR25qK3qlUt6jsLuTFDZi9zHANAwaudN8O4eNiseztECQvg6pVIenJ14WGpbDdOYFrvONFf0Ht2K8Tjltbo9E3/zg3xw/nxoF3FXw0m1X02yorn67dcUBFAfZIEm7Ej6GF21vtXlYIO6TKsqvkg1PIVdSey8bTGSGpulTiM+aOR+1WmW8RZ8ABrCCFPrOMS7IF6gw9qg0MyiNgryFK5X4h0C+bqpmNRXBWsV8qLUUiWJzt8XhdplxwF52XZWKcavKyPNDZzbw00vmc9hDqlTOv85fDe5eQX4+21Zx1zq2KdX7b40CEwiymquRdK11f6A3o41DjDXR6+FEfUoSWplqgPIewk9W1ib2duwRXmP6THtFztGe7C89Q7seQvRGzTsrOj/5uCK1zftdDYg9dHDGPKD655kQozE1oC5pp6evcZSLjy6IqsT4C1vylchwyq0Kn12SMatw3z57ms6RrMngfH21vDbnMR+vUZzQLvcTeW+XU05aH88v5f54axrrcW2Bihox56GoKGidJSey2WZFHs3QnzdTAYAfczzaZUCofoKmzYKwv5qMMdsEMtwelHwlbYfZnZbvyjNzKtN0TlJ5YjlFiRPLhieDeBORPW8zHQ7Xy0/ye8Tb8H5QvU2anQABozh53wnRvWT8gDLNIXxnGvh96Hw2GBe+dC1j65eiUVNftcp6gs8HtG8w5aB0imOEB5yElvHOk4jDV58oyu2KwQ1OWFY/TFOL2Enj+/tTyJH2D4X/y+fTa+MTFnfKdEUCME1e7e0eD4MhIKH6IEZ9g8+QTVV0WUHvcMbwniDmUZKxv3d3DOElwgj8jMvvb5VDILkmtKJB0fBGOp0cE+6GHUk1+WkdDydoa50d1l9hw1A67hsvXfbKnc4c8DqwDQQJQVQlgJ2XUxjesmPpCfzbiKaSWNLKUnpXlZbdjGyyIuWBJWv5avrN+9qUIZqaynZWv54KtsAW05iPWKVLML7gdZs4rjDqqgV69W8f+w1tBsOzNDgX/6Te63CstrA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eLLQu91BtDk1AShFgWHxShUHNOeg8fAEv3sjDvDhd79kEmHgni1yi6FGtG7orqcVcfXF90q+hluOtr6G8i+g0rY3tkLift+gzS2NdClb7L+xYl9qx3WqGsbccPWgVtMj0uK5UcdZt2QCiuNQI+Zv1vNaWmVrX+90pLs/QXPdqmUaem1xtCMoFS1LQRLWOye4qZxgnoiDy+JrVN0yH6NGuqQD371KAIbJqk3OiX/qXrUERRtO2e6ZDaG3zRH4bBapIPoyELNvccaLJuiga64ZZhwj1h7Nkk453G9XL0sJ2jDV6XeYHW8CUYmmB9imF8l0JSWvRIgLb5ie0BayNSHqlEfZYv5ghs5Dm8PaeqalWMO/oxdQegD5l6h1+LT/A5rU3f6bvmrKnxYBJaUjJBZ78hwhmF21Q11k1rUge4Ht2JTvCUsznwK6PiFJ6eDqs+Dd82GbSRW9PyjAbF+U/mYVDRRpC/UZTdfhAIAvuMbhgioXsbRwV431DqH3FaTqlJ+r0fvULiLbvtyVddP5l6xKPFxJwyvCrx7g296x47WZ9dNPmRgzCFjoix0GpsUyTdHLpfKb5rk0rE7xCR4hNC4hXCy8CJcVPcc4vcU6HpdTE0OKzalhmPTdokZwaRXB5RxEyfIDcwtr5GFQG4yObi3GMLiXip0UWXljFWNGr7lwovlMbZhzAYCRSnAm40XsxBTu6E4Q9UxN20Hrz8AvzoMa5DHipkQ62TuCrj75MTp2ZZyHXbhOi/SltRylRB4PGV4VlFqC5AQZDXz1hTGyq4kSn/78TudLmD7cHq0kI6kODbrUz7P4H6fBCV7JvtbbiftnIppF37M+aATA67lHWrYua0+Vx9H9ZR4QZ5WuKNNWimeHq3WID5Wj78G7wwMUylJJfgwl8CcTZTI9Ggcy/iMcaFykjcFHk4HpeBnSAQ45rfCO6VgQ7AH/J7WdJTVrJg4h0Ni/7ooGSo+WRJiwxniuQK4K/T3ewpSQWbxO4zPMuJVV5z/ENtoRN90BIoIcN50673vGm3nlD++53j32WUBAu06Dh53cEuDV6DhkbC9fmJIFx+vHwIfb81LSa1cp7ixvW1hJpN8nxXHfn6K0lVLpLnRffwD1bk5QaSwfk5WbvrRjTUG7t8t4f+DxgLqzMLeM+dZUbkcjj30fu2GsHpSf01aMG7n3A+oP/uGk88kqmTwFqKqUh8jtJFao/YArY6GdnHqm2Mzo10s4DTaIM2KuS6zGE3elNw2+tGczI3Fl9gb25BsUT949Q7/7U2FRhPq3WAwHJv+apPxMo3+eMdftKdkXgUdgNxy1i3Ns0Wj6ABsDQAb3WdNtP1EtvaqYPBX0NlyMqKIjZPvX9q/cFztq5Nm86UbyFwo08MKhdR9EeFYe3STK4N+a1Zsrc1N7aG0HonMuWu3WbgDqooD16oN6hVavSim73pA20LoD0bJHBF24RbldMWIwg991ubp2bP0alie9tGOujUbL3cJWcE+2Uh105fFUrUdT4hhBGPJbUnAUqafloZEBqvuSF9CNbXzJMXev5xA25AtnnPfACCFjd8Fo059Y29MmpUXH31xWlqgnPBf2I322dqcLNJaMGObH0HvpKQi3XTqQlHrKuzcwkw== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: dddb745d-ee62-4ee1-f7fd-08dca6101397 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2024 03:25:16.1459 (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: 8u/x8uejEx10rhy8F/1aJYCXZ9vvBNgdqPf+QWkz0JWetqA2vUX+mHm7ryfQLZIvUsHlP6Kzq+dA79E29t999f1lKkxIkTulJCQH2DLTTmM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR13MB4917 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 CI found copy and paste error occurs. Coverity issue: 439967 Fixes: 830057d1dba9 ("net/nfp: refactor flow action compile function") Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang --- drivers/net/nfp/flower/nfp_flower_flow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower_flow.c b/drivers/net/nfp/flower/nfp_flower_flow.c index cf2b919e7e..0078455658 100644 --- a/drivers/net/nfp/flower/nfp_flower_flow.c +++ b/drivers/net/nfp/flower/nfp_flower_flow.c @@ -4458,7 +4458,7 @@ nfp_flow_action_compile_ttl(struct nfp_action_compile_param *param) } } else { nfp_flow_action_set_hl(param->position, param->action, - param->flag->ttl_tos_flag); + param->flag->tc_hl_flag); if (!param->flag->tc_hl_flag) { param->position += sizeof(struct nfp_fl_act_set_ipv6_tc_hl_fl); param->flag->tc_hl_flag = true; @@ -4485,7 +4485,7 @@ static int nfp_flow_action_compile_ipv6_dscp(struct nfp_action_compile_param *param) { nfp_flow_action_set_tc(param->position, param->action, - param->flag->ttl_tos_flag); + param->flag->tc_hl_flag); if (!param->flag->tc_hl_flag) { param->position += sizeof(struct nfp_fl_act_set_ipv6_tc_hl_fl); param->flag->tc_hl_flag = true; From patchwork Wed Jul 17 03:24:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 142453 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 4DDD54562D; Wed, 17 Jul 2024 05:25:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 90FF340B9C; Wed, 17 Jul 2024 05:25:23 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2138.outbound.protection.outlook.com [40.107.96.138]) by mails.dpdk.org (Postfix) with ESMTP id BD5F840BA2 for ; Wed, 17 Jul 2024 05:25:22 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ru74vmbfMRAgp0uSlNkb8c/7BMJKLhBXG27SK+6cIuU72TXnsXYYmF0ctuiemnRa0SUAHnqF3ZkvjwIXFfv/ZHu0pDN+Qa7jF5jIhpsnggs8nHW8DXlwgBApTXxDmZMoqpYfwJ8iWcepN3U7uvF0uY9ZNrbh7b2WogDwv+wKV21IpNxdy3Ro//27hf4Xj7rFT4b3DAN+GdVv/co1xLAhk3XDKtyHBOg5yBRa8UHRJTSami1SgaPVnrsAte3tdYwPOiJ8LQLtmCQvmSzxQStb60q2DuUtCOSqAiV0kvKGF5otFAaf33+S7Gh4r2jYUcXXs7nO/KgYd/GRkEgAscBsng== 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=0uE+Z8OmnbY39U4kHM8cLHhfVYKrfdlI6G2svtp4vw8=; b=sKTJ/QZs0Iv9+CPtDbB1tFU+uJl5xwRmYNZ2SySrIDlttW9F9zCfIPQGLDTIcFROWvs40O4RGFsWHXZArXjFvctFybsyrv4U3VEQUx7QIqOPrAv+tE0olrILJbyNaLKsH/AT/I3+ZYh/r35iy6BCT+/YnFr3FOpaaaKWL80pqb5XHMMeTxa/U6lEE3Ok9p6+LnoffqFdrsB9H4Vudg4TsPchPryyx8EhOHs/QlAKneOXSnSc+DSi70tUCXrso5xSxvSaagffBN1tm9sXFWKK2j/xCT2coHdOgIol74zu9+Joq8R6HNdYFPeRJBLecfl575w1OOSabTBXxWuTBTD5YQ== 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=0uE+Z8OmnbY39U4kHM8cLHhfVYKrfdlI6G2svtp4vw8=; b=IDzxYAnHVYVRF33OWnGXbMJyGKtWIl9pWSqD0Jd52b1hVgE/jhPW5SjiiFkWjpyo936so4IG53PPYaH9Dot3COjO/Aw6YtBikGOptVhyDJ0nLL11OwwUhyRGBvSyQpTt3SuMRkQ3RWd4H3NV092h3ZI5kF/VIrHUk2TcbjyK010= 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 BY3PR13MB4834.namprd13.prod.outlook.com (2603:10b6:a03:36b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Wed, 17 Jul 2024 03:25:18 +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.7762.027; Wed, 17 Jul 2024 03:25:18 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Chaoyong He , Peng Zhang Subject: [PATCH 2/2] net/nfp: fix AVX2 vector Rx function memory overrun Date: Wed, 17 Jul 2024 11:24:45 +0800 Message-Id: <20240717032445.442348-3-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240717032445.442348-1-chaoyong.he@corigine.com> References: <20240717032445.442348-1-chaoyong.he@corigine.com> X-ClientProxiedBy: SG2PR03CA0127.apcprd03.prod.outlook.com (2603:1096:4:91::31) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|BY3PR13MB4834:EE_ X-MS-Office365-Filtering-Correlation-Id: 9fdaf902-d5ca-4651-ef5d-08dca6101506 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|1800799024|376014|366016|38350700014; X-Microsoft-Antispam-Message-Info: tvT08ND9C3GI/txxq6f+WNQCBbLbJTpcLhLxJN6Q0EDrM0S/lLdnq7OLho3ZRPNBTLCz1bnE8P6Yg3VcEsyZCYc7LJm9Y0oHKbHejTeqCJZ66/uPC+VGLqFG/HtA7nqIvDbXQRK4oN/Rqerz69pCFyw4ace5oQVHSd8NeUXH1W7/Qgw7wz0mycRAi6+4knw/olFfdq63TW+mybN4SBviiAuYAE34Sb6gunz6VOQwobRURsQpVHxFt69ei8lXydqX5ozB4RW2XfXtiv03NmunK3wkKnDMc+ffbKBpZQPjMUfEgUduiq6fpvqnZX7AY1YLkQkkOfWMl1s7UJ1hZXsW44itUvIcFO2WJGQKyXKufoaLkr80aljUZEOq+LL+0FlzaYonVTq8EF4JAgmfCYwAFVKC+sqqsAFsUVLOD/PI5O2CJUquURCbM87oITylMJyDasGjnVsAhQdI11gAfTFheMy68bwiKwMyCpIveSXi8fJ6YMwlNn9OTr56P9sVne0RHVgUFZG3l+9WeleV8Jhd8A0jJzRyyGJNqCtJgl51VYxB+RZV85lB/cVlieBRfYphrbn68dtChIm1LZYpRNirebS89+b9mSJ5QVYsVLo5CccxcxSL9xtLiQgQJsVTIqrk3gynBnVWqR0tyLpqzYh0LZK5VBRWU5YW/khB8tv/ZV4BuM/P5LPLkkbGCXJKejt1kkiSynoV5DuqpqW5I+fUg5Rq0WJeklKeueL1TP1OA7tDhXsT5dQHAHnBEzHprKcGemsDpLxy7tm2i0aPj9vviTe3f040YCsWllXaEIJJK+3BV7wcqV2NyS1JbjvyeIyIR5WDPWAOyttPGhWiceqsj62H0BOIyiz7TO597Ebb85WdBZhgckx7wEg2PM8a8YQlPHmFmmjeMroN4zl2e4Zt1NCFWLM2Kqb0EUyr/xAq7LevfPeDquv2dhgLSjBP6UxV07N00MN8wT5Cd/aHo7onwZv+Gzj5rogozBXCpYA9ggf80UMyPb9GsaoWT1oEH86R0uUd0VFVaXL9DOeB45t/zHp/qKvojUZAzyk36tk4l+RsZC1zNRaltIr60hHQCbshvmInBCxsb+KwWHwgBdaljh7I8Xb3meK5bGsHi0K59MAM6FtwGKh4U+96ZjQzrXkNozDd+eAvPtzogfHanGBRn4MlpG0QPurWPXCfd2Lm4XHQDYC2dBDGSIaZlCTFLBnBT8/ZV0M4HX/u4CTkeIKQ/T2ZslOmDQPw6y1n8VczplpVzgxwdYl3FZNGclKohjetvkR7bojDsL8J9RwNBY/dJWSo2k8sBroj+GNjiY0pC2qXY4p0V0D+YCPrf2lKUDCF/0Ovgx+BNpR/HRyA40LORoX4exMU7wYZZMDj1+g7GkcHtKpZkCrr0yLMtz17lrS3uyi41nVBLshNuMmwFmonAw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(1800799024)(376014)(366016)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HTqJz3mtRdaURANt2SqVOnRIY9BErEv/55bP5NVc2ASxU5ibR65e7xrJgHoxg/DUEws1TuUWA/o3/2Caq/VQIm8YfRGKG1+pikjxHg23EmtJgHx8Ox/1fMgvMWxSB89lW3QjEtMY9ht8w7k/uxcGXDI2OUVdHB0akYtLkh4XIO3cA6dKW4MGJJ2x5kmbUDV/el3Du+PVHeRTmdZ4UtUzrtXGZ3gSCcLAnGcN8GHzIojBfWziI7lb60kxizVLMycOae3KtgVFG9EUf7KfMz+ajqg+V+ZEsE+BuHb5IU130UDME4ZYPo8J99OgNlLYEJMPdjn+hncL5lcuE60svsOWPnL58f3cR7WbMkhwFNFFFIrt6cUo9ziXB1iCSkrEkxO1mptt//TEnNPILc+kSDNmknt5N+I8GMNtl57Bt4RimuSJPtZ777YpKCwBRx5EMXGIuBD0wk9erFIGLud/kYHPU599WpYVvcNAUW1Yi6TY34xC3q0sgsHzL29bHfeHsjuu7shz6F/em30ocu8nssMP1SAhPP7Gy/AL5iok3qzXdOIgWEKEgaLtyV4JNS9kfjvFCEhu4qXmnrzuLj4SgXGCaYpFpbP+l6RfwrZ2guwmXwH/f4zDGbDlo4QFMuycB11IHToeq3KfcUpHuZ53mk1tEG8xgI2zmboRYHwG6Q6AXvG0xPw3gZ7rInCeL439qIb2HtXt9k6QboP3Lf5MnUj8vV3w/+k+CV0nY2O2tcPs3EGIPshJ0+OazCIn4+Ipy54fZd1M6SqAXDY6s8/Yea+9W27c8byHKVyxM8gARZALaKgkltzxQS64k5jBXfQX97muVdsVo0GXhWCthk2dlFVFXEeaeqZQ3SfbvC3DhPK41KnJiWHD88VRBj382ATZJIeLcfvmgAfKN6wv/+kGgIO27MosIE2TsotzpnoAoCk368wKzQH5J73Kou7a+G86PrU1ztOxl3clebUWBJU3CZ+3nBxASBjfy+VznEt5epKX3mWpzWF2XdiFhpuBXfcGcx4TbbKS6Kb2pUS3UmpjJlGGxVapprQUGq4KkY982Ctn6ekAvk1203OlLh1SOycT5aJs+wEIs/zTFytHHt8YqUKFmmUbJpscCKfFTJvZYL2Clf9tzwJjcSpLGL0R1anDR1dIWmSb6zGLRiOchMcBFZeS3vtugJ2NAqoKuJ+KoaSVp2auO7O/XF5vzO3Nw2jcXf8xuuqCQVsGVOt/F0G5Kaa8JWF/8x+2fJveqURS/6lVHAQtF/XOJOoKiOjhudk1D8NvJX3JILbuJ9J9lYIEE3aUlQPvQfZoArj1mcWdfmvGlPpZZ9aPkkxqJJNT+85vdEGJgAJwhEbrEdXHtoS+D5eK6kFM5x+bLJ7TquhNWmWNNUdCQFrkqsh4aPmt4RStIQXFRDW3m/dsIHTRML4zw1B+hz56WYVawxpSg5d2EpsfYUQ+1AuLb5b87lh0y9mz2CDwj+DON/GSWg941kIU8r/blhjcmPgCnXwmjNE/HOW6XsXV1grPNdFhvzTX05P/gepR8BW4mtOj8Ccexje4qDmM6BbkQ9mmcsAjJg6HlJhgWrXDqNMGlFu8NfSG/ffEi46Uqwh4IwZCS09smc94qMa2jQ== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9fdaf902-d5ca-4651-ef5d-08dca6101506 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2024 03:25:18.4053 (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: uJJMGlcNDRk4ZEsrYXTaId5PkK2GKWrg4WJf55HQejhnyVrTB3phfm2C4hedzE2pYn3Ig/ESYK5T2crnXF8Tz8UKKgHsvWwZuqmXi+9g40w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR13MB4834 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 CI found that the 'rxb' in 'nfp_net_vec_avx2_recv_pkts()' may cause memory overrun. Coverity issue:439964 Fixes: b67555307628 ("net/nfp: add AVX2 Rx") Signed-off-by: Long Wu Reviewed-by: Chaoyong He Reviewed-by: Peng Zhang --- drivers/net/nfp/nfp_rxtx_vec_avx2.c | 41 ++++++++++++++++++----------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/drivers/net/nfp/nfp_rxtx_vec_avx2.c b/drivers/net/nfp/nfp_rxtx_vec_avx2.c index 508ec7faa5..2a033133a1 100644 --- a/drivers/net/nfp/nfp_rxtx_vec_avx2.c +++ b/drivers/net/nfp/nfp_rxtx_vec_avx2.c @@ -117,29 +117,48 @@ nfp_vec_avx2_recv_set_rxpkt1(struct nfp_net_rxq *rxq, nfp_net_rx_cksum(rxq, rxds, rx_pkt); } -static inline void +static inline int nfp_vec_avx2_recv1(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxds, - struct rte_mbuf *rxb, + struct rte_mbuf **rxb, struct rte_mbuf *rx_pkt) { + /* 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); + return -ENOMEM; + } + nfp_vec_avx2_recv_set_rxpkt1(rxq, rxds, rx_pkt); - nfp_vec_avx2_recv_set_des1(rxq, rxds, rxb); + nfp_vec_avx2_recv_set_des1(rxq, rxds, *rxb); + + return 0; } -static inline void +static inline int nfp_vec_avx2_recv4(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxds, struct rte_mbuf **rxb, struct rte_mbuf **rx_pkts) { + /* Allocate 4 new mbufs into the software ring. */ + if (rte_pktmbuf_alloc_bulk(rxq->mem_pool, rxb, 4) < 0) { + PMD_RX_LOG(DEBUG, "RX mbuf bulk alloc failed port_id=%u queue_id=%hu", + rxq->port_id, rxq->qidx); + return -ENOMEM; + } + 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); + + return 0; } static inline bool @@ -215,15 +234,8 @@ nfp_net_vec_avx2_recv_pkts(void *rx_queue, _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); + if (nfp_vec_avx2_recv1(rxq, rxds, rxb, rx_pkts[avail]) != 0) goto recv_end; - } - - nfp_vec_avx2_recv1(rxq, rxds, *rxb, rx_pkts[avail]); avail++; nb_hold++; @@ -237,14 +249,11 @@ nfp_net_vec_avx2_recv_pkts(void *rx_queue, _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) { + if (nfp_vec_avx2_recv4(rxq, rxds, rxb, &rx_pkts[avail]) != 0) { burst_receive = false; continue; } - nfp_vec_avx2_recv4(rxq, rxds, rxb, &rx_pkts[avail]); - avail += 4; nb_hold += 4; }