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 5C918455C0; Mon, 8 Jul 2024 05:12:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E57940A75; Mon, 8 Jul 2024 05:12:36 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2113.outbound.protection.outlook.com [40.107.237.113]) by mails.dpdk.org (Postfix) with ESMTP id BE118402EC for ; Mon, 8 Jul 2024 05:12:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hy/Fa2hEQ0Nr2tdzUsYuTAyeDP8LLumajw24tTf66+APkkMxyYmRyPfSH2mRU8dah6sC9ibPkc4qc6rjikAkUPEXukKelqu7jMZA0UxXw4wBBdJt3dV1q28T+Bu3fBwI+GOnRvHzvwfJeArqnX+qRDAqQ+curo9mwXIP2F/HzIl+E4igXsbX2k0tLwNvE+lcx9X+Ke3Z8CG8quDPISV+BN/D+r7fgcRY7ETNKcH6KRg4N1kbbuEOZYkvvsM8CcgfMld3zviLNsBTRFoFG7thG1otEXpd/2EXCMC82eey6MtZ+xgrIKLvpqd+Xo8zEdf9VsUZKYficGm+bdGBnHg9/Q== 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=LFcOZNlyS9IGoEbJu3Vjq1qF52ty8suxrI38HQigVDA=; b=Llw9GCRwaKhnWCuiMqpgoYoC06xBo/jHa5yeuyNWgiAagaVlJUv6OtxTCXrPd9W4fw6ayQ4YWWdeqOS5Inyuo5QEFVij8aMPX/niqhe/cCVoJPC4YvEi1yGRzgc6JrN9mzlYEjGOa2AydbbUKekVlm6CSVGcZgL+XEk4NoSE2b+tX8rtn2/diHIpgltJMH3Psm1WaJHUHVLrbCkQvTvk/p9sNQVpahIR47Rolm3gD3weUIl6GzgEiqHaKri56aQoHxX8EoRQWRveh/d+99GCwkwfQRfA8S0Pw2D/erxLBeYU960tTOKdDRhNvu7t2K6vpxNUOU9cqItgwyTOESbm5A== 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=LFcOZNlyS9IGoEbJu3Vjq1qF52ty8suxrI38HQigVDA=; b=npSUFjyTbdiwgM01PipDx1QPwsvTlF/qO8ZQtLApmCmXTBNsGSqLpRsXYc6mjbC1qMT61TkT30bZJ3jVprplNw7qgaaDhLtDwX5yAR0ZE739Uw0enc+HanD2MlsCgb+qXYlWR9V+QywTT+avNkC0jGto5xLwUrqytJ0PtZL7K1M= 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 PH7PR13MB6464.namprd13.prod.outlook.com (2603:10b6:510:2e6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34; Mon, 8 Jul 2024 03:12: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; Mon, 8 Jul 2024 03:12:30 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , chaoyong.he@corigine.com Subject: [PATCH v2] net/nfp: fix port action core dump Date: Mon, 8 Jul 2024 11:12:09 +0800 Message-Id: <20240708031209.79302-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240624015723.3712898-18-chaoyong.he@corigine.com> References: <20240624015723.3712898-18-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR08CA0031.namprd08.prod.outlook.com (2603:10b6:a03:100::44) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB6464:EE_ X-MS-Office365-Filtering-Correlation-Id: 6fcc0c71-4b77-44e7-56d1-08dc9efbcd93 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?BeYX8QwfU95zxivoJnfHdGuC7sHhztTxU6wetMsEnJqZlxns1dVku3hd4/21?= =?us-ascii?Q?kN/mO2VJIp6Sl/db0LEof1RU6UgMoxHnciQ/dHim3s4/tlRWpiVQ+Zp2emVZ?= =?us-ascii?Q?4iUuUD1ya+pLQTcsxV3UmD8s393Zv8p92TPhWzmHZdy516gq3bvaIzg8EYG6?= =?us-ascii?Q?S0FB0XzpjDyA5cDCpXXnLiCc446QPs3vj6ovJahuERvp3yTv9VWzg9UGIhB6?= =?us-ascii?Q?HoLAEkMoq9/Q9+4Nwe7hEzUNShB6hvx8UGrv/LBZmL476x8qO1RwcONmt5Rm?= =?us-ascii?Q?Rk0+r5HsQsCJ0ODU0wc4dk9S5DownHptiWNhtabqoAm5pBZNSU80FXRZvyf1?= =?us-ascii?Q?4GGmnGFCwMVCug0xRDz8o6Oqdjhf7v9dAcP6p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6FBjJwlQjyWYKTW7mq9++vku+NEHlimitJx4vFq9uTU9q77eXeQ98yXGBi?= =?us-ascii?Q?pcKOsI0JFV4v0YlnJxMjFkrHMjtjoCQFJ9sJCD1MoYZ0x22xl8F+39J93DO0?= =?us-ascii?Q?Xw8Hd4MjzZOGCyDilvSbov+dfNwQ2vly4c4jXjtzvFG4lkoHCA=3D=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:(13230040)(376014)(52116014)(366016)(1800799024)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?iWCjOtrJPvgWAiodyZMbkBVjoxT3/xlWORGyg3tpTQDcPLV5/KGKEYqlg7Bs?= =?us-ascii?Q?Gzp8GS1VmrKDZ+pNUqyQoINCzIjHywUF03Wx9oVlh6kcOCHkbz2yaAbufz9o?= =?us-ascii?Q?QO3EL4uVy9IezI+aAFUUB2kGMMszzp2wUTy8IB5wsXJUB7GXOe9pk/75ahcm?= =?us-ascii?Q?ocnbZ9aLld/a9eYSDGTWEHM1nUiuAmW85m3MYNOuvouqa8Rgqy6PnKQO9QDo?= =?us-ascii?Q?vty6elYFV3APRbG+5t46Fpk/SNazW0HalZ8PR9YkdDREW3x0IQXh4Fures4y?= =?us-ascii?Q?fZl4nPvAF2cWpLX4aFRAIJzPlWtKN20f5z8zGfxpSoHvIpjIZYZt4pn3sDKE?= =?us-ascii?Q?9GuR3g7M/n3aXi2b1xO4uUwzbuFADknAiTHW+RXjyS2jjCtwWsbRZ7FIjm66?= =?us-ascii?Q?WBjgVK20VYNaJBeaaOEgfjTgESRo6/rMkXYB89qYEKel3HPcGTNyK1XG98Yx?= =?us-ascii?Q?quPmugFr0HFEpiRRhOv7Np6IDDKOwWVG+ZJ/cFsRSt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ii?Q?njvCytADOrV3zj8GLxfwhiZKRiF7GDytOzsmnAK1kYW2wFph6nHWlt3C0dwB?= =?us-ascii?Q?83ICK4UlusphQj6hBhMh94KoOz1WrAWVkZ7NG3snJ4sAIld7aVyQDCDc+CHw?= =?us-ascii?Q?1bJF2lC/dOijzt8PfonJisYZrUkaBEC/2DuWerRgCQwH+a7phG39Q1cgfnqf?= =?us-ascii?Q?qH03fgpaA+Svh5CUC4R+s4opNBh5EMi2iu1ZJWmSw0FGyrXQQa6vkS0Y4Gil?= =?us-ascii?Q?Rw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6fcc0c71-4b77-44e7-56d1-08dc9efbcd93 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 03:12:30.5416 (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: oRUd5seT8ilRwOXQ8BcP6awQKgZvd+Eg55ARFDlREcVfdk+EkxFTHqn/knfdM0Gbnf57sqH+wLPKvwuGLr4ecBBJmpInYHw1SITejljOI20= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB6464 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. Fixes: bf4416016c66 ("net/nfp: split out flow item check logic") Fixes: 18c0ba1d69a8 ("net/nfp: split out flow action check logic") Cc: chaoyong.he@corigine.com Signed-off-by: Long Wu Reviewed-by: Chaoyong He --- v2: add the 'Fixes' line and 'Reviewed-by' tag. --- 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