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 5277945DBC; Thu, 28 Nov 2024 06:48:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1FA98402AE; Thu, 28 Nov 2024 06:48:46 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2084.outbound.protection.outlook.com [40.107.21.84]) by mails.dpdk.org (Postfix) with ESMTP id AF40B4029C; Thu, 28 Nov 2024 06:48:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sj68QdtskKQ0LAdRekHT6CkI2Bpf0QPfOgvJFLcSJWqegvo80lVS+55V3T5WEAtZ50Z2dGzZEOw0nbMoFxPTnHa+VDldNvasVz49Xa/SiJORKrh1hxdCws58mq7CtJDlGr4Z9RJ3TZBw4cOiNUTTMhStKZWr6nZdZBGj5GCiDa8yRtN3GcjRnbkG89F2DOLyneHBMLhFsD1hobi31nCqwDDIcvbQAm26UEsddEo7xOA3qJm4DHE91vb3282DBL+LJU8R51Au7vX/wd3yK31jCHfJMtgw82kIIz12lK3ylLEUQNqG38apfovVwyAkSwnQagSmneBgKCUG1F+lOv7exA== 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=ddtYaLmKJx4EJQZIocHt1+KfIPbNo9Ci4ByHhLlOWNI=; b=RtM4X5ms5FUiPcUNhczwAzkU2lzefPd4/U2H2l0RcMIxtIsQhj5vGnQFEL/t2gobshn8jGhGo3jgR5B2TvTM/ZJ4gOMg+rU4BGPeCJGeTnb8AJ3nEo9nQWF4F9by9VYipf4eG8haD1PxMB4mBoE1rC3+g/Aa938aKAoG5liiNyCEgc85Ez9Imy/2zX27XPNFE7gjn2cEy1dQyA9ljVWGMZe3hMskGcFCMrK9UScbJVK4IVLlahKxIX20pVkGwhVC8QFVvxFnbctVPUjo93r8vGWdN90zgcX4MW9838e6yEsk8WVl9O0AiPYLA19Pk9KCAdRjtJZbmQR8488ac+LTMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nokia-sbell.com; dmarc=pass action=none header.from=nokia-sbell.com; dkim=pass header.d=nokia-sbell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia-sbell.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ddtYaLmKJx4EJQZIocHt1+KfIPbNo9Ci4ByHhLlOWNI=; b=UQsTep0SNlUBNp979DqPR5vRmiYbZxiCWmfF0D7o8bDyr/BVb7wP1+5Cx5Ozc5x2FxslFVk2YbGB4IHH3S94Yt159+ZxBbHSXtT86Nr46BFuZd/e8oq+ZSX+NPETeUuArmkLOKp1IY4TuC8T7DEmmcOsD6IHqg8aRB6rGp45XXuRHqrblF8CN4ad6DhDxgUhGy0MOTHRsNinnWF9Uq6MJHpddi0rU9cBkXB53F/bX2orezzQfQP6nfVHzDKEb9vT1M2UbffJ/VEGy41FCoSS0nL/oiDU4lpn12ccO2FgTUHP5zBrSaKUf33ROZzK3rCs4HzMfFl9Qg/aE0dc9gbMSQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nokia-sbell.com; Received: from DUZPR07MB9882.eurprd07.prod.outlook.com (2603:10a6:10:4af::7) by VI1PR07MB6237.eurprd07.prod.outlook.com (2603:10a6:800:13c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.13; Thu, 28 Nov 2024 05:48:43 +0000 Received: from DUZPR07MB9882.eurprd07.prod.outlook.com ([fe80::bdde:dbb6:efdd:e75b]) by DUZPR07MB9882.eurprd07.prod.outlook.com ([fe80::bdde:dbb6:efdd:e75b%3]) with mapi id 15.20.8207.010; Thu, 28 Nov 2024 05:48:43 +0000 From: myang To: Anatoly Burakov , Bruce Richardson , Kevin Laatz , =?UTF-8?q?Morten=20Br=C3=B8rup?= Cc: dev@dpdk.org, myang , stable@dpdk.org Subject: [PATCH] eal: fix bus cleanup in secondary process Date: Thu, 28 Nov 2024 13:48:29 +0800 Message-Id: <20241128054829.1453-1-ming.1.yang@nokia-sbell.com> X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0233.apcprd06.prod.outlook.com (2603:1096:4:ac::17) To DUZPR07MB9882.eurprd07.prod.outlook.com (2603:10a6:10:4af::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DUZPR07MB9882:EE_|VI1PR07MB6237:EE_ X-MS-Office365-Filtering-Correlation-Id: b6a57251-2ef7-486c-4da9-08dd0f705148 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|43062017; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Yt6aXLFsCHF9dlkxeyd6CmTSrkmp7Q35DcP3Z6uBml6CKI9fD82I37QMEEaR?= =?us-ascii?Q?Nq1CjMDiOZVBso8CIbCgjWKobmwqyhQIlCXi3Kz/RoU0+fiqoQplQ3sZwJrb?= =?us-ascii?Q?NNU0LtUk7N37HatX4EBZf5P3sHSeZYW7yIMRpBe4K/vVv6QY/ZQ74V88ll+o?= =?us-ascii?Q?iCHHxT27ecFmEyhDmcqMkAVohwQEXxkgTZU27DOZyGnQFbJ5voLyd+W5OOfO?= =?us-ascii?Q?QFj9RLLsGOMCujPTSP6FYfKFU8MbvKAWX7cixS/MmUl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eHODraLM7NqiCUyZiuHA8DOutLdsh507B9dGVY1JYjgiCDTseNuk47Zb?= =?us-ascii?Q?0iTgDmh9Da60kJx/pwcFHW/agZzfD6XRodkDvLAS6L28XXZF2RT4XDYMVg/3?= =?us-ascii?Q?hP0Zz2jOulj+F1GXSy5mSaZNmt77LgTtFOk9sy58bZrnqEqr/zkz02XRZdQQ?= =?us-ascii?Q?ts3ddEtGLVxRGvU4K9saAQrMBQoo+y+I4kuW9GyCPldEZvyzS8Wg5V5Qqhi+?= =?us-ascii?Q?cF+y5Zj2Y0F9E/tOUoNCMe3GTTVlqkDkeQUzpz96Ppga42iNmw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DUZPR07MB9882.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(43062017); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?kRfr385wint26i2u7bwFe9Yjd6sD2ILj3KC0bCQ8KCjpZsk/Xgo961VOrCnh?= =?us-ascii?Q?RsvxNfKhwuAmtaokn7bOsGbnkg9ACtSuwMhJe/kkfUW4vTOhrBvpUhEpFD9Q?= =?us-ascii?Q?igw9Y9EkpIC6NaNWZxKo94qyxay83SfepdlrJJrgrs6KQPGSF8Oo18D7A/yQ?= =?us-ascii?Q?lpFtb6FpGMgmGKXwVE0q92+qoUcQxecusfmBEfqjMh4pbAqXZDco+D85lf/Z?= =?us-ascii?Q?utDWz4qJ/QLHg0HZhONLQXd0Bgr3fzL6nthxB2yEwcRj2sMnWkrYhxjbIOr/?= =?us-ascii?Q?kR6YcBqVqTq7G1dGU4skI2BWmZvklmDU3w2u61VxhxJy1iBTEVyd3Q7o2HLU?= =?us-ascii?Q?LPt3hmav6Ijqcqdbge6p3uFfGoyGYiBTccsmAh0uC5nzcRI1Yt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MJmKa6nEHiTDF17uhxD82vYqBP+zrrO006zItK?= =?us-ascii?Q?GtV/TBRNZzq9tffimVmv4hMz4o3grA8XQkEIPrOnMZgzh50wmop0iiSIV9yI?= =?us-ascii?Q?mPRrby0eij2xrIWo0/UB+hcT0a6KX079OXajyhb/jVe6uOJ5qQfhBw84F0lS?= =?us-ascii?Q?89jZjW7y2RQylOzP7JRllDb+huj3mepDpwXuS9V5YslO2XMcgr5KgGm8k4V7?= =?us-ascii?Q?la/P113lNnn7zVjPn+RESF/eHxEuf8XBVDJzG3WFJ3ZhHdbi3XBCSaZJdQb2?= =?us-ascii?Q?SDH9tiJOmJ/2c80VkBXGu71TRNhGjBZiyZrCKqWhICwfPidmN+0gb1hjgiU4?= =?us-ascii?Q?8g=3D=3D?= X-OriginatorOrg: nokia-sbell.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6a57251-2ef7-486c-4da9-08dd0f705148 X-MS-Exchange-CrossTenant-AuthSource: DUZPR07MB9882.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2024 05:48:43.1843 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0D02MQo1AAD3cyIcc9mDQg3TFTOOFrgs9fARtSbvz10qykwBAjhBWV9XLGWZhzVm9Cvm20QYeOIO2E8kxSS+7q3VeHtQ+FtZGQxjYuocvq4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6237 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 eal_bus_cleanup has been added in rte_eal_cleanup. But for secondary process, eal_bus_cleanup will trigger vdev_cleanup which trigger rte_vdev_driver to remove. Then our crypto devices will execute ipsec_mb_remove to rte_cryptodev_pmd_destroy. Finally error logs occur as below: CRYPTODEV: rte_cryptodev_close() line 1453: Device 0 must be stopped before closing EAL: failed to send to (/tmp/dpdk/l2hicu/mp_socket) due to Bad file descriptor EAL: Fail to send request /tmp/dpdk/l2hicu/mp_socket:ipsec_mb_mp_msg USER1: Create MR request to primary process failed. Function call trace: rte_eal_cleanup->eal_bus_cleanup-> vdev_cleanup->rte_vdev_driver->ipsec_mb_remove-> 1. ipsec_mb_remove->rte_cryptodev_pmd_destroy-> rte_cryptodev_pmd_release_device->rte_cryptodev_close 2. ipsec_mb_remove->ipsec_mb_qp_release->ipsec_mb_secondary_qp_op ->rte_mp_request_async->mp_request_async Fixes: 1cab1a40ea9b ("bus: cleanup devices on shutdown") Cc: stable@dpdk.org Signed-off-by: myang --- lib/eal/linux/eal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index a6220524a4..eec791ce1e 100644 --- a/lib/eal/linux/eal.c +++ b/lib/eal/linux/eal.c @@ -1320,7 +1320,8 @@ rte_eal_cleanup(void) vfio_mp_sync_cleanup(); #endif rte_mp_channel_cleanup(); - eal_bus_cleanup(); + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + eal_bus_cleanup(); rte_trace_save(); eal_trace_fini(); eal_mp_dev_hotplug_cleanup(); -- 2.34.1