From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DA5D1454CB; Mon, 24 Jun 2024 04:00:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 55C8F40E2C; Mon, 24 Jun 2024 03:58:22 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2107.outbound.protection.outlook.com [40.107.95.107]) by mails.dpdk.org (Postfix) with ESMTP id 5894540E11; Mon, 24 Jun 2024 03:58:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hchLPd+ECghNPWn/iYv6SzXkFiBPBO2HWupcdiZ3bsuQ3jLNni5F+kwWVsmWkmTKjHfXUkmXgGFcpXMpKa9VhV1/VF775LzQM+BpyXjgFi/ayrqHB/bMxZjayE4Y9VQqShYHLZmiyhaN0JLKx6lIUWuf9UgK3pTKSWqOOOh8FGu5Dd1FQXSo4MRNJNt0NeogTehVXJ99r5h4/lGDFrNqs7ivVDvKudBA8kiiSb8sIlPBaoek7uarmjL8JuUtCsHDPmmyAfh8rueAo38Kjxq8NUH+wvD7sNEobImWPuJ7gYAEN2BPQdkDNmZcsJPPhVM4VUD5kof5fyG8+xYOCsrRSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TP+LKpn0lbIoFfhybw4MRubXHHfsCkzAi50p5OLn2vk=; b=cAPi8t+dLwQkfHJznOFu1RGhCS6IWl7FQWG/KJo7UVMa2apqz/Y8VdXCydwbXt1QAV2LiDl8p0bxQRqGNloVXgmJ/FcGI65ydpPgLO9w/Z9Xs67gfA7K6fmQ/I8JCtR/7tx2j8Wo7aAx6bqpxnAcdHhB+1MFPIdzjUPugLmoiatcUPrbv6GE4v+kKsxe7W4sc/hJilDmgNh0Vf0z4P21HwEemQc1wqvyYYDx78pDFAwyVrSF2J63sC1Tj4Vz3uskHGoPj2WWB+4ttrzlhGdUeKSFxqBGyf9so6BooiDI6BNFlDjLueiNxs2Lw13+4q5bpKqHUjzYYGpd/Z1C2j66Kg== 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=TP+LKpn0lbIoFfhybw4MRubXHHfsCkzAi50p5OLn2vk=; b=l0VYqQq1M9S+c9mzRgxlw1fx82SQ4gcuZQ4vX5Qk4KcakHcf21QADkQtqFVelTPvSpPZZwdVfBzi1ES8NWXnrw0n7OabO5Refr4Pl9brkW3TcqMCA6bbubpeJDWkR0ghkT5GEGSBp9nJhifNiTMLqut68UYcxfLEBKowxmti0Z4= 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 PH7PR13MB5867.namprd13.prod.outlook.com (2603:10b6:510:159::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.19; Mon, 24 Jun 2024 01:58: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.7698.024; Mon, 24 Jun 2024 01:58:18 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , chaoyong.he@corigine.com, stable@dpdk.org Subject: [PATCH 17/17] net/nfp: fix port action core dump Date: Mon, 24 Jun 2024 09:57:23 +0800 Message-Id: <20240624015723.3712898-18-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240624015723.3712898-1-chaoyong.he@corigine.com> References: <20240624015723.3712898-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR13CA0070.namprd13.prod.outlook.com (2603:10b6:a03:2c4::15) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB5867:EE_ X-MS-Office365-Filtering-Correlation-Id: 440f45e4-5ad4-4cc0-2ace-08dc93f11de2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|52116011|366013|1800799021|376011|38350700011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?q3KbmvwpChzlg0ALyTq/Nx4xi0I+UuZKcsdapLfBHnPrsONhIzX4KYoobU4B?= =?us-ascii?Q?ZpHfeO7lr38nAiou+L7LUIdAZWxfqUD81RGaIXzk3Ey9w8S3vmzq8FRasZxN?= =?us-ascii?Q?O+Hz5RpdlPdg2NWnIb/RLqzJ86Jbx5Lnk9epeJcLlxhLyI2zpyZRI5pzhEqC?= =?us-ascii?Q?GTBotVpTGFZVhSpInCNWMUTgNX68KIHKcHqVwC1Ce4TDCaxyTjDU/CkBzW2N?= =?us-ascii?Q?dJP0Sm8Ubyt2jyht49ZiLC3qqLplfEPkA4mTh3QW3jXEIgwc35oyPrUJ+Awa?= =?us-ascii?Q?qnZ1tNCtBpzduFZ5YeMmagEi4+5a+qGjLAEco2N5HmtxKg2iVFMPOBJjr1yq?= =?us-asc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eB7Sm2x/F/0WIFxkV4eww8Ms4?= =?us-ascii?Q?ve8k3sS6zSN08dZk18sA2uYQo9KJG1z/85qDJJkEkK3SCFJRYJtiO1enSzUK?= =?us-ascii?Q?SWk0bSXUsytx9+GjPyV2D7/7Uvh8djvtiazUNybmi4ROrSlZ+xo00RWiNwDV?= =?us-ascii?Q?VtVK9LE=3D?= 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:(13230037)(52116011)(366013)(1800799021)(376011)(38350700011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?bJSv9M4DuujsKrFyTNxF39TSLQTerhZsMeKNx3wa0cv55Q7utdL2ZVXD65QA?= =?us-ascii?Q?e4lKK8wpf0TmtzGHNhDpwE0i1BGV20vNCsFo1i66mfAdcIao/tOTbZhxnWfo?= =?us-ascii?Q?EIFPmm+bQhfWvknBVSdUBmYJyMGoA6mjMgBJouhfYyVk5AlOeT0FW40BuCtV?= =?us-ascii?Q?jzBgRoaRz1d0cd8G7en7MSUm1Pjcj65JD4mbB/9pNExpqfNWZlmlDoe7HI87?= =?us-ascii?Q?fbU5pzAd8+kNY46lrwjrX1K6efJafDGePs3sy83ba8xVRVtdleSid9i9Vvzz?= =?us-ascii?Q?HpuTa3klHcpGP4EygV3RQaKj9Cmw309Ha03rFQvinjq0B2Y0RSF4vRJGLyzq?= =?us-ascii?Q?4FRsjyRZEaDOXF0py8Ri56BEh5CzViBOs6d3Mx2O+YYkU5l7wsQieeuFUyBf?= =?us-ascii?Q?kss/oJnIl5to7yrUOEyO6qSaTpF7NpJTHTKh+l7ebNo1xynZ4A3njuLyi7QU?= =?us-ascii?Q?7V/br/m+IsGlxpNEmf6SaDIIdN8xm7DfCl9g4IdRfp7fH3Fu9+r69Q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TGbSrGUcoopphEaDRA9T4QlWEWzpVQQ?= =?us-ascii?Q?oxsoga8j8zpMARVYUogTonFFgrHtAcGe7Fox+xUGh9U2Qbf30bXoHiCYFBKR?= =?us-ascii?Q?SC+PsDL7wJtExKRsxoOql3vhHJz/9WexQ+pwi9Ap5F3DsKKBHfJwAlKJ/amh?= =?us-ascii?Q?JXYA6MtV8VtPiFMq6H7yHgKp39KYLN9ctGv22Sqow5vOpxW2RDuVBrolrC6b?= =?us-ascii?Q?4w=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 440f45e4-5ad4-4cc0-2ace-08dc93f11de2 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2024 01:58:18.0184 (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: NWQNxfle8TkCm1HY5D1/ubsTOj4Qx1tpQu6BlKAqQI11cFrHUfX+K47AhTkrhVXN0Xi0uAqCj9B/p+dVOX5gDUloz9uiqu/ucPqP6dBZPU0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB5867 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 The app will be destroyed if add a port flow action which its destination port id is invalid. Add a check to avoid the problem. Cc: chaoyong.he@corigine.com Cc: stable@dpdk.org Signed-off-by: Long Wu --- 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 d127171fdb..24e7047407 100644 --- a/drivers/net/nfp/flower/nfp_flower_flow.c +++ b/drivers/net/nfp/flower/nfp_flower_flow.c @@ -931,7 +931,7 @@ nfp_flow_item_check_port(struct nfp_item_calculate_param *param) const struct rte_flow_item_port_id *port_id; port_id = param->item->spec; - if (port_id == NULL || port_id->id >= RTE_MAX_ETHPORTS) + if (port_id == NULL || rte_eth_dev_is_valid_port(port_id->id) == 0) return -ERANGE; return 0; @@ -1256,7 +1256,7 @@ nfp_flow_action_check_port(struct nfp_action_calculate_param *param) port_id = action_port_id->id; } - if (port_id >= RTE_MAX_ETHPORTS) + if (rte_eth_dev_is_valid_port(port_id) == 0) return -ERANGE; return 0; -- 2.39.1