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 59F95460DB for ; Wed, 22 Jan 2025 02:28:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54DC2402DD; Wed, 22 Jan 2025 02:28:43 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2116.outbound.protection.outlook.com [40.107.223.116]) by mails.dpdk.org (Postfix) with ESMTP id 9111C402A9; Wed, 22 Jan 2025 02:28:40 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PQLn/9+f0YxJaMXADNSSp6m6BKL0+TwqwAwy4AkV6yDQq4cGgUke+qInjLl5Z03Eh4sqZf8JcB5m8Hze+eIRPWHEsZkdy82g0PbmWkLPOMhlhfdHmXgHPWY5Qcl3dQV1qgyhvk32ir3iMezQsv4alCnGeOKDlIbibNXU1/gjbM/YVQBfSvjqR9myB/1wR/aRWB8jkODwsj/KMuOZ3tb1VNi23wuSQzsa//HpQtQmpgq0+2BzEv0Bx9kZ0jyyFPLyuYhVFcaAHYgdHb+3QMjrxUYqQE5TvkNrUuABnYbfdKKyrwmRfa3R7sFm3fUue7fn5I/maLFuM/TfmBCgp9tfuA== 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=XHeBTFrWkmMkqqnNlVrzCRIoZ0X44UuLbpVxP3Aw8VU=; b=j1pqfXh943Yq/A82+gCf5PrmZYLSoMOjbNwYfJISqq5yXPvlg8whtOx9G1LqdCg+cWQW3Qk9T5qw23rsxRahOXJQEpTLL8dx8T+UqjZBLVd2CevMfrZC6ZfAGsYDMskV3qmd6vY9mcVwhY/UF1eMAt6Keh78J/2D5kdb1GRGKuBEsJINfwBJPb3xkBaQ2kN2DIYvQpGz0RUuu/9J8Xu7MLovpZzLMxn8l2QClIw9KJmTegEQ/nIFTAGlieNHKFA5H4WkoYgM0okPBmzby6xKATDHONJUhvdB1tskbFd7V6mDtn07QORWdkZrk9nv8ZVxTaa2sKjAHif+djbg51hlgQ== 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=XHeBTFrWkmMkqqnNlVrzCRIoZ0X44UuLbpVxP3Aw8VU=; b=H8IPtVUE0hTFkEL7KNfM1Wv5mWcRGzjI8bsi2LOVYPl9xd9hCm+8tT7TCsWvIAYDD3sc+t7R6Pkf6i2uPCrSLzffLwzBrJFy3Pu39xD+ZsszFr82lgywqLLfJVK1dFCrE8ZJMpE04JBSiisH9NP57rbvk/RXzIWY4JkQVBk20e8= 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 BL3PR13MB5228.namprd13.prod.outlook.com (2603:10b6:208:347::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.22; Wed, 22 Jan 2025 01:28:37 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%6]) with mapi id 15.20.8356.017; Wed, 22 Jan 2025 01:28:36 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Zerun Fu , peng.zhang@corigine.com, stable@dpdk.org, Chaoyong He , Long Wu Subject: [PATCH] net/nfp: fix multiple PFs check from NSP Date: Wed, 22 Jan 2025 09:28:15 +0800 Message-ID: <20250122012815.1703017-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.43.5 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2P153CA0016.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::17) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|BL3PR13MB5228:EE_ X-MS-Office365-Filtering-Correlation-Id: bd42a3ec-28f5-4791-8b75-08dd3a8417c6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|52116014|376014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?jAQHmWy6RfZN02ScVJ1NthtBWyob/iVqs3ke/K3PIOZU1c0RaQ80EqnM3Ssk?= =?us-ascii?Q?ZLkBiKTm8nq21BugMRd8Q6VVvVOwqCd1SBv9Z/MS9TKaKfkwCSNckDSuNW/b?= =?us-ascii?Q?2hVaJQwkuw7aVr1z2rKKXgZzaP1Lhi6WvDTLPH9sORS+2qz3iupyOAjvm/DN?= =?us-ascii?Q?MJAzfuT1cN4P8X0DOUqGPGxt+s9EIH6HtBVAq/sfaY2RtJcCtY/G7strSYoq?= =?us-ascii?Q?wUyVq2UMVf5Xavn4wnqqu3exrjGwZyNahnDHuP8VQcz7OScOU22yxmGwrNQ5?= =?us-ascii?Q?14D5ea5tqcaMerRhtatnYBEetwxrydc77qK2n6tZPK2VLJ5F04psVaMf5Mya?= =?us-ascii?Q?elvgMxIjKr53b3vJ1gejl0hImQ9i7o6Rj7NfdP/NuJNJaVS/1V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1b/mfeMb/GF3ev0oIHHOKf84S3NZvJpQ5uAJdT7Xf42kK?= =?us-ascii?Q?XY7e7aFSh4Nusdo318ZHWkZcQYaQoNPDNDusXuUNYv+BGgTJlmVIYPVUjnhz?= =?us-ascii?Q?LTBApAy3E9Uh2FSMMhV/zQRZrlvwtE1Mngx0o+p+v6iAcqKgK2CrfBnz8//t?= =?us-ascii?Q?mitSgCbpniGc8b+HDehkrve6qiZe3XKG?= 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)(1800799024)(52116014)(376014)(366016)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?uN0MA8XStC2D/BkJ6c32tncXdTY07ys8zGpq1gcUGety2h61JkVH9GIf103e?= =?us-ascii?Q?HyTY+g4NJE2oWjW7cfikmwouU4OSaedivFOmSIskagA66DavROiPUzyELpia?= =?us-ascii?Q?GEycrPoUkLc4vXUBJxC/mZzUg7WiUFWQDTXELwUB0UMY81/NAZbq+crJnXLH?= =?us-ascii?Q?VqC7QPAVpzPwscbN/ctzmXPfBmnd+lqV6B6zNUSHjrpS+a0U06fX0vzCLv79?= =?us-ascii?Q?CKpUXZ/ONfWdFialDHJz5e9R4bM17081yRj00ZiQWxPz+VRUEHK1pDicjubw?= =?us-ascii?Q?1MxOAwnZhURi+ud6l7tRlx4sQpC+6A392rdEq98gdzdqjtmubzH1gl1SyN/F?= =?us-ascii?Q?/af9oh4mYEr/+p1SsKcHrUofehv6EuB6rYYUM6+fBnqWygLn8ZudQyK64P53?= =?us-ascii?Q?SOIfFW/vJNKBT6hlQdopNPKvB52baBGlzyxLQWJI86isFTUduMuzci5o1COL?= =?us-ascii?Q?dUw70Clh5aMuKYq5RBNHk67Th+7KnEFR53pR9du19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XoTiHlYzcGKdOhmrkCYGDfWSzyT/5luQ5Niy4gu+aFuBVC4?= =?us-ascii?Q?AOYihAwDQWmrEbDV9RvuULLXznxmmYWdnxaiFOewpmJUG6joNIhXVXe6zgbl?= =?us-ascii?Q?tloivenVhUwtFkk2xb86gsqWckozHSUoItrdWTCwmaxZhaCw7qOqhmMr/TBW?= =?us-ascii?Q?CxKrWdmbQf4OSktM6SOBBSdmEDgycZyiMagw9UYYgpO3qCm7JuzId9wRnaGs?= =?us-ascii?Q?Vg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd42a3ec-28f5-4791-8b75-08dd3a8417c6 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2025 01:28:36.7244 (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: 3sNRzlxeIvxehmqfj5rExsgqZKGmkw/a+HCcJ11ohDkxwI8ypIHOQZYCuGWBabcZ27IcDfQQXp6tAA12HbOVQpbG/XwVPL6IPMg/NGZBKVs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR13MB5228 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: Zerun Fu Fix multiple PFs check from NSP problem in the logic of PF initialization. Fixes: 8ad2cc8fec37 ("net/nfp: add flag for multiple PFs support") Cc: peng.zhang@corigine.com Cc: stable@dpdk.org Signed-off-by: Zerun Fu Reviewed-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang --- drivers/net/nfp/nfp_ethdev.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index f54483822f..aad044a0f7 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -1749,24 +1749,25 @@ nfp_check_multi_pf_from_fw(uint32_t total_vnics) return false; } -static inline bool +static inline int nfp_check_multi_pf_from_nsp(struct rte_pci_device *pci_dev, - struct nfp_cpp *cpp) + struct nfp_cpp *cpp, + bool *flag) { - bool flag; struct nfp_nsp *nsp; nsp = nfp_nsp_open(cpp); if (nsp == NULL) { PMD_DRV_LOG(ERR, "NFP error when obtaining NSP handle."); - return false; + return -EIO; } - flag = (nfp_nsp_get_abi_ver_major(nsp) > 0) && + *flag = (nfp_nsp_get_abi_ver_major(nsp) > 0) && (pci_dev->id.device_id == PCI_DEVICE_ID_NFP3800_PF_NIC); nfp_nsp_close(nsp); - return flag; + + return 0; } static int @@ -2432,8 +2433,13 @@ nfp_pf_init(struct rte_pci_device *pci_dev) goto eth_table_cleanup; } + ret = nfp_check_multi_pf_from_nsp(pci_dev, cpp, &pf_dev->multi_pf.enabled); + if (ret != 0) { + PMD_INIT_LOG(ERR, "Failed to check multi pf from NSP."); + goto eth_table_cleanup; + } + pf_dev->nfp_eth_table = nfp_eth_table; - pf_dev->multi_pf.enabled = nfp_check_multi_pf_from_nsp(pci_dev, cpp); pf_dev->multi_pf.function_id = function_id; pf_dev->total_phyports = nfp_net_get_phyports_from_nsp(pf_dev); -- 2.43.5