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 C893C45FCF; Fri, 3 Jan 2025 04:10:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6542F402BD; Fri, 3 Jan 2025 04:10:18 +0100 (CET) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2046.outbound.protection.outlook.com [40.107.22.46]) by mails.dpdk.org (Postfix) with ESMTP id 6AE0F402B1 for ; Fri, 3 Jan 2025 04:10:17 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QG17ja3dhJYccakXjn6QPcyPmJlGEv7ZILPXD8cFZQLByhI2pulmJ6n8aRk8TlimunEZUyOLedhgVUb7OhdF0smxSfNwZZqs3/qycTfjmmxQ1n4QNcdJlHgP85GPLlOWMvFsWwid/6IAXB9Q+8sV3XhBfSh0i0fmald+UJ0PGYRZtts2PKDADSaWktMQUy7BlBKTIP+D/U5dZvj+xZW83WP/NIvc1pNqTO7Eb8M7iVSxITphUKoZHqw8FiBwJ11hCiAfKmHekteMpaO056nGPJgs4U638wmcZ/rytuO3EOrs9Up0hfZkOPwEBCHvp2dxMNz9BnyVcFU3B8ts3aIxSQ== 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=PrhEoPtj6LH4drUb71gdQALwo6jeOVXFCI18KfSk7W4=; b=Nd0OscdAqZMk+mFfuR1VWu9BZ3M3ysACQFiE8JfwJZ9SaIASNJUCD0S9Qpl/HCMomuVlrD79K2lepKvrWRuK9EeUcRJIdKoW9+FTPx9skJAYkrG9igE5GuW3I5qISGIhOnj5j63A5QE/NviZcy2ouq+yMcZxgfHw6HdMrkvoIK91sV+MA4fNAg42+4seDU67e3ok8I/MiEZSfICHRrfN00y6HClWiwC7CKHs2IbXBYrCZCIrL83TMEbbvsdWpOcOebPyArLx1+EA2vKYlAaxOcisl0aftNu+p27GUrsjkF4vrB8lBm7/XfV4rdPxKqFz09E6ZSOeMHq/eEwuQY1mGA== 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=PrhEoPtj6LH4drUb71gdQALwo6jeOVXFCI18KfSk7W4=; b=jv6jTidTysBclJTcHNDkWdMy1FubWlbsmWBfHvb1T0KBsFo8lUh7EYSluGnItBiWUtcw/eNq+9fHjPnqdFaUmUNeiif+FvNx6xo5Z/KjU1rCngGTtyKUAG2JIbEvlicsAjr3k2EfmPjpjuxLWjPn9bY1wz4rxA+ao7GIjAMWvM1lfpNdOnkMKd405AzrdHpnReY/Iz45Zu6QLIcYlaN2fZNGaQ8cZ+cdh0jS4sIk1uaYgWhkoSwIyuvxYtc7wT4k+mnH5R61jDqNHkZ4UY42t+jCf/+922PonLnsV9qbvifsL3j+W6mE6/YqZXKekB/Mi62dvzvRasEFPwHVIDn+rQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nokia-sbell.com; Received: from VI1PR07MB9898.eurprd07.prod.outlook.com (2603:10a6:800:119::6) by AM8PR07MB8057.eurprd07.prod.outlook.com (2603:10a6:20b:3d8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.13; Fri, 3 Jan 2025 03:10:12 +0000 Received: from VI1PR07MB9898.eurprd07.prod.outlook.com ([fe80::1928:4afb:4eee:1f21]) by VI1PR07MB9898.eurprd07.prod.outlook.com ([fe80::1928:4afb:4eee:1f21%5]) with mapi id 15.20.8314.013; Fri, 3 Jan 2025 03:10:12 +0000 From: Yang Ming To: dev@dpdk.org Cc: Yang Ming Subject: [PATCH v2] cryptodev: not close device when secondary exit Date: Fri, 3 Jan 2025 11:09:57 +0800 Message-Id: <20250103030957.1117-1-ming.1.yang@nokia-sbell.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128054829.1453-1-ming.1.yang@nokia-sbell.com> References: <20241128054829.1453-1-ming.1.yang@nokia-sbell.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI1PR02CA0050.apcprd02.prod.outlook.com (2603:1096:4:1f5::12) To VI1PR07MB9898.eurprd07.prod.outlook.com (2603:10a6:800:119::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR07MB9898:EE_|AM8PR07MB8057:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c968850-c96b-4b0c-974d-08dd2ba422e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?HIcFEbU8RCN03xwHY9AKoRBXe5yMhtYyYBoZSajWzUzIhx2F3qKwkR3zPZ4w?= =?us-ascii?Q?PDfICTswZ7iKcH2o49IutiVWT1idIUyZTMlT6JPQia6jou0ztjCuV/p/Htrf?= =?us-ascii?Q?ca7zfa6Z8ichyw8AL+INS+12PtpXV0tNKqXAhXWlyUa2u5+2i6tHZS/xyxTC?= =?us-ascii?Q?Lj3Bz5kDE/hf0RpLdI/elsQ1eXdJC3BPwlMWsBwJ3zAIbV2SF7wiCcZ1bjiS?= =?us-ascii?Q?6Alu6rC70lG5W8juRZYo70oV6/eWmRdjV6RHromL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QZVimE4vZ1DpLtVXZ1KIS9EZTJrzMl+2Tb2nHuvzD+So5nwQMqGmqzVzvrT8?= =?us-ascii?Q?xIEijrnoEOzDtX/KNxgJGW3HPkzItEjGNE/FhWaIdMzNeey6+YLU8LyGK3+d?= =?us-ascii?Q?aVwwMe5vYsiXaHVHbgB3u8q48sengZeCz27hypsX/KMRifHZXCT8Ei6xJAGz?= =?us-ascii?Q?60L7SS1wYxT4c64jScyc4A61umCqyqou8mukqtHwNhbLahXRP2AuA5CqAKuo?= =?us-ascii?Q?y3FKNe5QUD9flW6TXBXlco+1C8QC?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR07MB9898.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?aSbl/JU/nKXMJ/HUTocxgPThrzJ4Ykl2/xQu5awdJFgyLW32fjF1TxFwXA2S?= =?us-ascii?Q?AyJu3QrbUdEoYiZDKfPcHFTOAjT04FGtAs4K2KOlmaZK2+Mz07odD8E7tGMw?= =?us-ascii?Q?6cWnYgDOuYsI6ZTdEWaus4l+AGzflkOx/buNR8aCoUDJzdjeaaL1M75Rz9Zc?= =?us-ascii?Q?RwZkY+b7VnZURcYL4C8lz/SUA6bri/IgCPaNaf2x14/7euTU8lra1gsGwUF6?= =?us-ascii?Q?cHQ/nUKI/FNoUHRkFYVHjQ9FoYNpIVR2B7HQ18nPQZigucb6VCDedSPK9iMM?= =?us-ascii?Q?LFGtWW3738qzn0c80rC5abezqeHBcLIEH5re7a2yxHGgROWDR5tSqxkqIviV?= =?us-ascii?Q?Ces/Z+IQ+husyDc5MApJ4S3HnzkB0BjQE4Y7gdwwX8jC1hAIQ4TCBqbjIpDK?= =?us-ascii?Q?D7Qmn1rGNo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//MvszYQQGnIxE?= =?us-ascii?Q?VrOJbsBc49y0oM1wxlMGWtB35xmIDikyp8+5Nyq2aFwYt7phLbnDkiV2JS73?= =?us-ascii?Q?n5o/IdB8lW1TpdLXymV/FlTwuJXRfSW5iM9LKz3EwDZr4nU3G6zHbIL1iHE/?= =?us-ascii?Q?z/d+5PMZe7ph2jdB3j+LhT5v5GUJG7z4Z2Sx2+IN2AsUqCSJ5Wl8G6cBtQ4t?= =?us-ascii?Q?xyu8ouQ3axNyAAihRPykq5xCdSO/1bnNuirNlq03zMtLzdMEngv9nNqyqxhj?= =?us-ascii?Q?zpIAcxNC1Pxm90r7+PhC5EMkDLFuA3Zt2cdWjk8eyigNK2EiInl+5a4cNcAJ?= =?us-ascii?Q?AA=3D=3D?= X-OriginatorOrg: nokia-sbell.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c968850-c96b-4b0c-974d-08dd2ba422e2 X-MS-Exchange-CrossTenant-AuthSource: VI1PR07MB9898.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2025 03:10:11.8935 (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: Nl2EfU/Tjvid6O+q8e2ymFUY+b+spxPuAiU/+DdyJBX4j7J2h6r7AssZCPuHXbFv0Jwp7S2CyB4w4rSdnCkqP/ExVMlCAfTDrD7ys+8iKA8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR07MB8057 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 secordary process should not close the crypto device when it exits because the primary process still manage the device. There is no reason with occurring error log below when secordary process exits without any operation on the crypto device while primary process starts the device. Case situation: 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 crypto devices will execute ipsec_mb_remove to rte_cryptodev_pmd_destroy. Finially, rte_cryptodev_close will be called by secordary process exit. Error logs occur as below when the secordary process exit: CRYPTODEV: rte_cryptodev_close() line 1453: Device 0 must be stopped before closing Function call trace: rte_eal_cleanup->eal_bus_cleanup-> vdev_cleanup->rte_vdev_driver_remove->ipsec_mb_remove-> rte_cryptodev_pmd_destroy->rte_cryptodev_pmd_release_device-> rte_cryptodev_close Signed-off-by: Yang Ming --- lib/cryptodev/rte_cryptodev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index 85a4b46ac9..ed1021f635 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -1142,7 +1142,7 @@ rte_cryptodev_pmd_release_device(struct rte_cryptodev *cryptodev) cryptodev_fp_ops_reset(rte_crypto_fp_ops + dev_id); /* Close device only if device operations have been set */ - if (cryptodev->dev_ops) { + if (cryptodev->dev_ops && (rte_eal_process_type() == RTE_PROC_PRIMARY)) { ret = rte_cryptodev_close(dev_id); if (ret < 0) return ret; -- 2.34.1