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 68D6345492 for ; Wed, 19 Jun 2024 11:59:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A207142E70; Wed, 19 Jun 2024 11:59:28 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2114.outbound.protection.outlook.com [40.107.243.114]) by mails.dpdk.org (Postfix) with ESMTP id B3F7A42E6A; Wed, 19 Jun 2024 11:59:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n8Pxn5o7OMgX1+5B/B2QOGC7f48H/7WqKB2I/tPxtZpuESfVvBW5TA1k7MJFVFjslQGS+K2UZtNHOlpev8d8OjRQQ1mYdrveT/rsYh8ChuVSOFIdmbQvoICqwypfvp6mYEFwc+ue28A2EicaUW7g46j3stKRgrkgmW6emwEqbQE902/75DNfdiB25cUh1lXl8041t3LPDCtAnMD8mdpoHeoTAbahfp8rrN4BNjjLx1T/pAOBzvdcBJIihCE3x2Oyk5MdDS69QARbwzLCLKFh0cNbVnR9koSh1FG+F/RkN2zGIdxvhPhhAm7KKDP0YS1yVZbEEmelcbA6LWiwmr7SvQ== 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=upVtZgsWwW4p+K0WWVa1t7V5OBZvJmpy1k7QlnGqjEA=; b=l2B5n+9xy4R3jIIAQa06Sbw3O2V0QG8EkR+iEZ+wViW+veD51W9XqGduPSyL6weJeA8Hv7cRevQsl9s0vxvqYiwuY4dAJdvTyoRITK8LyjhDJja5bbk5RnJj4Hh5xmbLaCNsZGXUZaZIuL8RfcM1JHNX7VYhbwWxSsCj81LutTFyDg+cjqwYknCOCEQEKWvjamn5qBcBhVhPmBRnbeuL28HxXDe0J5ICQ8bSJVDlXzdml93BLdZRwEysjmQAy+Iq7B34GSrPFcquNWXGRFMdpt6xDLBjeJUwedl+BoTGwdI9GGhXlCG/vL7BiWFj5qz2zQq5YLT2xao0t/4O4SJBtg== 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=upVtZgsWwW4p+K0WWVa1t7V5OBZvJmpy1k7QlnGqjEA=; b=cVmx3GqEx7B//6gfHg7R++enzH5oef9UwZvw5KfI52g/uw0sj07A43/tioUTgeXaSMKJ9dF227Q7ko0RQcg22A49fu4wDZx+7oeHQDItZXJNMpessiTybPDZIe8bli8JDIOvA4zlqz8rhXAtnEjPAJEG0Y+sWXfp6J5VjX7PHzA= 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 MN2PR13MB3912.namprd13.prod.outlook.com (2603:10b6:208:263::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.31; Wed, 19 Jun 2024 09:59: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.7677.030; Wed, 19 Jun 2024 09:59:24 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Peng Zhang , chaoyong.he@corigine.com, stable@dpdk.org, Long Wu Subject: [PATCH 18/23] net/nfp: add check for numbers of VF representor port Date: Wed, 19 Jun 2024 17:58:25 +0800 Message-Id: <20240619095830.3479757-19-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240619095830.3479757-1-chaoyong.he@corigine.com> References: <20240619095830.3479757-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR13CA0057.namprd13.prod.outlook.com (2603:10b6:a03:2c2::32) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MN2PR13MB3912:EE_ X-MS-Office365-Filtering-Correlation-Id: 54bb3fcd-6d63-4f98-ac8d-08dc90467f7f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|366013|376011|52116011|1800799021|38350700011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Qv8JN++V4QDNH8U78r4JT99PK9nsLr3NsTGl/t0Yy7gfNkV+SctRM/Adnvyb?= =?us-ascii?Q?WRrjDOeNdUJcsmwUgm0MZ5j9CfWvdDuthqR0RXNR2KbIJlM+IeyCs5CbdOQs?= =?us-ascii?Q?AKN2F4zChz9f4Sixv0X6CKDIGpbNTkuIUnU6obxP8YCG6BqazjLZoRjoIhbL?= =?us-ascii?Q?wG/xm3xdoM/Qwi2hOFNbMXVecGFrCHeJ2K0L9wyAJbU18c+PQEv2lOJAQHxa?= =?us-ascii?Q?Qi/e6Gu4uZUYfFj7T6OmCCX0bgJ7BHt6jXm704rv7m9HlLV5JElEs1hwgNDc?= =?us-ascii?Q?B3Z+KCJmTyvl1DVRIWj2f0F/bqvNRAPd9s+pokwLB/FrMpwIF/R0PfC9hEnu?= =?us-ascii?Q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4EogB7R9EllDc?= =?us-ascii?Q?lWGJn6JwvQZfcv+gi0r0ZB2sPix3TH6v/TVf7+EoSAQ+FF+BsKaONeLkz9dX?= =?us-ascii?Q?rQe0xM1DfPsLfD5tARLr20WtZky6tPTAEk2n2UTv2HQvASy31Q0WFHm4IBlA?= =?us-ascii?Q?6oAOu3Y=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)(366013)(376011)(52116011)(1800799021)(38350700011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ANMogYywMw2KP5HxvR8nK181mwx0HIzbdL3+28ixx5w+ivL3XjE5OQaGsgWm?= =?us-ascii?Q?m9mL4fId8fkGS7tUfBuY8iKutBKOBbsXIQnbmfEgQ1/i79hMHTuOuy7ow2Qv?= =?us-ascii?Q?CuwnI0KTQDnsMcJnCc4IJ4zKdJemn8r6++e+lGRA16Heyoyu2Zku+2IfRfqx?= =?us-ascii?Q?Trn2zcd7J7aDATkIWrC3LgyIIZ/j3eLovhlTGOpToW21bWpn3aRJxRVpNC11?= =?us-ascii?Q?wUaE8G+Zb/wuzAfRgk8IOzHvlPZJklaF9Wco7CV96WmdE6gYJ5d6BsG27Sb4?= =?us-ascii?Q?djTsKkCEP6MQ1xfPWF0m8CCewv5PhyZXZnhACbH/kKUHhwK3rGTJX5+Diimn?= =?us-ascii?Q?METkkqk+8zxaDCQKvnQQsEH7qMx4nCvOTUWJjcJ5ftIlDVZ+gbvq20XqI0rH?= =?us-ascii?Q?mxaLwCZe4ThjnBFaYnY6WXFehuarJaEaZkodB1SKVDwNY6l31hjIg4EFWpaC?= =?us-ascii?Q?0dwIrV1GWc1EHjydHLN81Ba87iBHG5X3B9oXs8BNNLuW1rdAIkahWCRTPvw0?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Up7NJj+crXcuaBT?= =?us-ascii?Q?PQxEShR4SWk+tENOWL26a8oiwyF4BvgjcyY9wq6KJwdKbOWdrTpBo+Uw2oN3?= =?us-ascii?Q?+lEQJjSxERto39/+ZS59yLPUaU4xANyYdgu1pA80n2DYw2WGJaMuiesjte6K?= =?us-ascii?Q?84ingKpPKdi5pDoqES0IpAOjMtqkXduglV/f/XcWDGTSostPWL3SoZFRNUDV?= =?us-ascii?Q?Kg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 54bb3fcd-6d63-4f98-ac8d-08dc90467f7f X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2024 09:59:24.3740 (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: OghmPGsVVyjMXtzRlABH9CjVMiF/QoAoHBgunZ+g7Nw6ww1xW4Q8k/CO7XgAQ7MERi1G3SvzP+PgfwVx3zRf+QnV1zxSe2fLJqmQDGITruc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR13MB3912 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Peng Zhang When the number of VF representor ports is bigger than the number of VF ports, there will be segment fault. Fix this by adding the check logic. Fixes: e1124c4f8a45 ("net/nfp: add flower representor framework") Cc: chaoyong.he@corigine.com Cc: stable@dpdk.org Signed-off-by: Peng Zhang Reviewed-by: Chaoyong He Reviewed-by: Long Wu --- drivers/net/nfp/flower/nfp_flower_representor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index e6fef45ddd..086dbc58e3 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -959,6 +959,11 @@ nfp_flower_repr_create(struct nfp_app_fw_flower *app_fw_flower, app_fw_flower->num_phyport_reprs = pf_dev->total_phyports; app_fw_flower->num_vf_reprs = eth_da.nb_representor_ports - pf_dev->total_phyports - 1; + if (pf_dev->max_vfs != 0 && pf_dev->sriov_vf < app_fw_flower->num_vf_reprs) { + PMD_INIT_LOG(ERR, "The VF repr nums %d is bigger than VF nums %d", + app_fw_flower->num_vf_reprs, pf_dev->sriov_vf); + return -ERANGE; + } PMD_INIT_LOG(INFO, "%d number of VF reprs", app_fw_flower->num_vf_reprs); PMD_INIT_LOG(INFO, "%d number of phyport reprs", app_fw_flower->num_phyport_reprs); -- 2.39.1