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 37EB9454B8; Mon, 24 Jun 2024 03:58:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8306340685; Mon, 24 Jun 2024 03:57:57 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2122.outbound.protection.outlook.com [40.107.101.122]) by mails.dpdk.org (Postfix) with ESMTP id 97B644027B; Mon, 24 Jun 2024 03:57:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rj2DpCuWDeRVMlebkZbeqMWK9BDyppBLYTD/Z6R523nMgpN8K4qrqAaKd3NcJufBPvbRiEcRE+/nRDyL/6zcUjZC1zIDn+ddVm660bJmbmcZT17Md2uEuPhYMwlK8wBY/p9L94LM34FwShVujmlEL8zmyQqf+wORh1lJYW/G8mxy67ggBeP97h2yA2KRvqojYeVvi+nLTYCoXYfoioxT1nZJ+hmIlGumQIt1aKzEuk8Hd5YoNxqPkNo0U6q/UpH5WbOp3IPd7H9q77yxKBnTQ1/58EXIWpWaVPTS/93v4aZykmsFAVYZubenogvgC1HnwHFox4IXtky3OOQPAOGhhg== 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=MLRxC0wIrFDD2ecuHDWDfjlPi2KsRjDRvReA6gXEb58=; b=HHQ9kF345+FwpyWT+Fk6cWwxdzdzH86osj5QNpC3czbX5tvp5h0M28nOEPpRVM03S5XT3G3zza2DpzEUVCSQeQjn0jaPlVuA76jAtcH7TIfmpCz1hu3/J7YfHVrzLLTLCivHJQHZB3awdiA5y9F5wjssbMKlNH15LFIDOJIj8q5WHqnAvY+R5cKZunZLWl4vSWep874fOu2mvdXe50qXTGfdxY59JlVZ6ILHcqby2pozQI3F2IqoVz4kx3AD+Ud0SQKcqUatzq0x60DRu0O2hxOFgIInoC6g83NnOfOaq+Jql1c4eWIviEt/Xm+n53y1C660OCnycyFCLb1+EAPWOQ== 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=MLRxC0wIrFDD2ecuHDWDfjlPi2KsRjDRvReA6gXEb58=; b=o8zAhNQvYpvg415Rnhn7tWnttk2PDEiPTdZovnjMTUOmJ1jojVpzNcD7jxjwuuP1yUV6nux1cFTTY6GKzaB/aWGPqR1WXs7EfnBpYadvdpd2Y9tz2KWByYJIFe0Yn4JoyRsZ0N8loRGKu37CNq/Ugm1WILzHW7Kk+ZsnQuLm8rw= 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 SA1PR13MB5443.namprd13.prod.outlook.com (2603:10b6:806:232::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.37; Mon, 24 Jun 2024 01:57:52 +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:57:52 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Chaoyong He , peng.zhang@corigine.com, stable@dpdk.org, Long Wu Subject: [PATCH 04/17] net/nfp: fix coredump caused by firmware abnormal cleanup Date: Mon, 24 Jun 2024 09:57:10 +0800 Message-Id: <20240624015723.3712898-5-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_|SA1PR13MB5443:EE_ X-MS-Office365-Filtering-Correlation-Id: 53c0e58c-ec1f-46bd-f02e-08dc93f10e7a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|52116011|376011|1800799021|366013|38350700011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Adv8Xtbvlbm+LmPGqSbiKcqbU3bA2hNPOdyCP4ywp0zPdNZjzGNl8v8srX2m?= =?us-ascii?Q?0zAM61bsFgByxLbzp04Z/Uwt68kpCCIhTwY2mgFtfu4BOvNVRlrDFQMqEzXB?= =?us-ascii?Q?IAoXewoYrVS8l9GeKAI/P/ugYsmBlO9/kqqm57saKy6JmNGErsOCDYIfZs+k?= =?us-ascii?Q?6U0g7NfdcStsbFv841bg5TQkk6NS56zkHctXOqbEWMxeUAymC8MyrQyRPmge?= =?us-ascii?Q?tF2rOiWQD+6unF01fl+iro4nkYXj3GDj+mXKXCmwCMgsxlhiH2602sHNqHiy?= =?us-ascii?Q?yXaOzkIeBxPZu2Z7JqMTlkg+/Yrrgd6qqtrwYJAfc41m5i3j5/egE3UCxVoZ?= =?us-ascii?Q?eKPdrOsQGNx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Wk0SkyHJSs?= =?us-ascii?Q?xa65am5gbkAld7lOJ5SiW7T3bNwjVnVlI21HBHkv930FIcu/3C1yjU3M3Dgt?= =?us-ascii?Q?Xc9dLdmQUxh7UMF/+Dc8FdL7ZajLqPTdsIM0jEw5aJPlqrWV6TlWA8cI3alH?= =?us-ascii?Q?rGHQQhyAy2Ynzu/opQ8VoEoNBy/9EkixFhhEQEw+nHTZXjzGBw=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:(13230037)(52116011)(376011)(1800799021)(366013)(38350700011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?rX5UWUDi7eUjDvEuUhhlFEztemGrXAfyXKgvFUjjBbxBm6zjty8W0pYh5+AO?= =?us-ascii?Q?IV901i9cxvLL1qQvBJBRHkMpyaM4/PLvWjBLHpGUziHzbn9Kxwxacsxy0hIa?= =?us-ascii?Q?CdTY1WKM/c1xSVNHwsF9oUuocHIXWhwBvNA6bxr2odOhY/8nmJDXOhIfN4Vh?= =?us-ascii?Q?jwN6TqtuQXWJHGrWsOH+TFz5YXSlbNCmEAIFzq4MxGU+YYTF+j+7+Fe4BRYO?= =?us-ascii?Q?Gt7jc/tOQ4JCWFw5MBNzN2wEedYGL18xgt0sCccA+DONYDTZsI1udkF+FO/F?= =?us-ascii?Q?novbWpvJdNDjOjF0J0l4/nsciuarulbAGrf4ayvuEwLWk2o3DmwKgwPDuXQ9?= =?us-ascii?Q?oktv1vs2etgeTu6nx+cDphNoCcT+HWUCGcypTnWGTP4r1g+CPunmwxlLTYnU?= =?us-ascii?Q?PkTkTEWixFtCsC5uVpSJwqHXvIjsKMpEBycpFE4ivWtsoF0Ycqzrtqc3Ir8J?= =?us-ascii?Q?8sSB8ZK6wz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vas?= =?us-ascii?Q?8wyas9G9RSu8qdW7nqMVXHqQRXe9YCzCigTYlqOjksqrIUX5D6yJknhDhEKE?= =?us-ascii?Q?dK8zuYKrPlTtZhw8HeBBdGMhrmfiJimsJwuD+kjE063WYLqdzbYQVF9Har7B?= =?us-ascii?Q?u/Q/fTnecXX2Go1uMX/189dYQMzzgAe+XcTeT/oMWFT/n3vU1PTOyTRGdmY9?= =?us-ascii?Q?tJ/ceEyJCBeD/mRwTGjvuRw+tMnXC0DwXEym2fv+3kMGojlb/WV1tH7TE8dV?= =?us-ascii?Q?SQ=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53c0e58c-ec1f-46bd-f02e-08dc93f10e7a 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:57:52.1824 (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: Clm8ikrsjY8IUXrKruxdvd+vppkAe1z3d0gMWp8L0hL4iD/tnT1ra9ghaArIccp/nxogiLH2qtMG5FKq7APumUkrUqatEpRvaAH0xC1wq0U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR13MB5443 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 The logic of 'nfp_fw_setup()' consider both single-pf and multi-pf firmware, but the abnormal firmware cleanup logic only consider multi-pf firmware and try to write the heart beat value, which will cause coredump when using the single-pf firmware. Fixes: 8ba461d1eecc ("net/nfp: introduce keepalive mechanism for multiple PF") Cc: peng.zhang@corigine.com Cc: stable@dpdk.org Signed-off-by: Chaoyong He Reviewed-by: Long Wu Reviewed-by: Peng Zhang --- drivers/net/nfp/nfp_ethdev.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 9870b2dd33..9196d5d0a4 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -2335,9 +2335,11 @@ nfp_pf_init(struct rte_pci_device *pci_dev) free(sym_tbl); fw_cleanup: nfp_fw_unload(cpp); - nfp_net_keepalive_stop(&pf_dev->multi_pf); - nfp_net_keepalive_clear(pf_dev->multi_pf.beat_addr, pf_dev->multi_pf.function_id); - nfp_net_keepalive_uninit(&pf_dev->multi_pf); + if (pf_dev->multi_pf.enabled) { + nfp_net_keepalive_stop(&pf_dev->multi_pf); + nfp_net_keepalive_clear(pf_dev->multi_pf.beat_addr, pf_dev->multi_pf.function_id); + nfp_net_keepalive_uninit(&pf_dev->multi_pf); + } eth_table_cleanup: free(nfp_eth_table); hwinfo_cleanup: -- 2.39.1