Message ID | 20250103030957.1117-1-ming.1.yang@nokia-sbell.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | akhil goyal |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org 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 <dev@dpdk.org>; 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 <ming.1.yang@nokia-sbell.com> To: dev@dpdk.org Cc: Yang Ming <ming.1.yang@nokia-sbell.com> 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: HIcFEbU8RCN03xwHY9AKoRBXe5yMhtYyYBoZSajWzUzIhx2F3qKwkR3zPZ4wPDfICTswZ7iKcH2o49IutiVWT1idIUyZTMlT6JPQia6jou0ztjCuV/p/Htrfca7zfa6Z8ichyw8AL+INS+12PtpXV0tNKqXAhXWlyUa2u5+2i6tHZS/xyxTCLj3Bz5kDE/hf0RpLdI/elsQ1eXdJC3BPwlMWsBwJ3zAIbV2SF7wiCcZ1bjiS6Alu6rC70lG5W8juRZYo70oV6/eWmRdjV6RHromLgjwVy31e2tR4IZO/IDyY/u83u5zaTguOBW1kDOG9cGZXGy0BgTkFWMxwJBY+WvRW/txsMqxYMd4kIZgv9gXn4ykFrwwXSMUwW9QYrxAwJjrllTqWdTkWYrvdG7YXjIVzWLAMhRF5k9mcGBraOyhMNl5S+CrURmisb3QPZcl2Yvl/7Tai2AI7SU1Af4JaiW8fa5g5dI+dlfDfB0v2FfW93OFSYNO4GJMR6ApGLZjZ/GhlYkvknTR9AAA2OWRgZlMRcqDLWnX2I5pt05mu0Zoh9ZdcmoDIpzRcauiS2nj9lF3u5ftlJrqm4DHF1U1DFu8xzrdePA+3U6bMZOK8R9+O4d1eGA24lZ9wXV6QTwhcQoH0ViR8fBxG+rAZRE9Q1+3017wIS3Mz4xh7I7xfv91JDSwmLzrP093TbjJ2itmSrQiSWcXnZ9o546yjmVhvaHP/rJb3cHVyqZgzxgtXkg2qlJXaBAmNYmThLYtP0HbOUGU+9k8yyBn7Zta3GaiXlDc3a4iFcWjZUNpi5hl/TB1x3AlEqRMhW3vf5bROfnp2QVwo/u4AzqZXCaR6UzbASqt7LO3u0zBJl9altHpJyXPIyUKkwkmgW4KFGXBbh0ZvCwHK/Jfjigj+VQEGAbSOioF8ZUx9uDexYAjdNNApbNbAoGgzktyPTce2zg+gzxNGxWddWKdm5W+CSgNbp5Tftyy6WSgbx25QszRz2232XU5NRJH4DJOGzgyXn6x62nHBzatzxMeSYwuf/kT3jHwDz4MpUNQrpoYgwlRivlZ8bn+80Iow8A1A3gelH/NwXPAtQXppo+Y+L7rbzY2bKOxN0wutQSa1+zggqRxIeAbwMzp6aiyXtTG1QZVimE4vZ1DpLtVXZ1KIS9EZTJrzMl+2Tb2nHuvzD+So5nwQMqGmqzVzvrT8xIEijrnoEOzDtX/KNxgJGW3HPkzItEjGNE/FhWaIdMzNeey6+YLU8LyGK3+daVwwMe5vYsiXaHVHbgB3u8q48sengZeCz27hypsX/KMRifHZXCT8Ei6xJAGz60L7SS1wYxT4c64jScyc4A61umCqyqou8mukqtHwNhbLahXRP2AuA5CqAKuoy3FKNe5QUD9flW6TXBXlco+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: aSbl/JU/nKXMJ/HUTocxgPThrzJ4Ykl2/xQu5awdJFgyLW32fjF1TxFwXA2SAyJu3QrbUdEoYiZDKfPcHFTOAjT04FGtAs4K2KOlmaZK2+Mz07odD8E7tGMw6cWnYgDOuYsI6ZTdEWaus4l+AGzflkOx/buNR8aCoUDJzdjeaaL1M75Rz9ZcRwZkY+b7VnZURcYL4C8lz/SUA6bri/IgCPaNaf2x14/7euTU8lra1gsGwUF6cHQ/nUKI/FNoUHRkFYVHjQ9FoYNpIVR2B7HQ18nPQZigucb6VCDedSPK9iMMLFGtWW3738qzn0c80rC5abezqeHBcLIEH5re7a2yxHGgROWDR5tSqxkqIviVCes/Z+IQ+husyDc5MApJ4S3HnzkB0BjQE4Y7gdwwX8jC1hAIQ4TCBqbjIpDKD7Qmn1rGNoBkNMUHTEoY9a9vVElSnLO3c/scrxEIYOuSapS5fA6aG8oLfHkBzH8QtQ2+HVPJjHJmXgDTwntUy8rLLPOYKdmTcOtxinzzLxOMnfGQ+c6YdFgbc+RfqSVXXeSnDOnCEiya2wx7RUUvCKfPC7S73ZlPUeeS/nCVUcf4HJn+3ma8wvTAFE8epldgYnlM4yqjUlIdGGNWfKMWWE4V21NpJDMDarMJyHakRRkK8XkN9x49TG1Yb8iZmV+2jyX5XSaetqBLibVcTap6tcMtzBBrRHzNlTYnuj6DLHWUa3ZB26fXt0j4zLHcguUFiUATyoyGrLQ75/MzQClCw6fyQsp00/xXjZ0LD7XUtPzOtIFyaPpTHXAZUHY6Vh4c9tGeujHIEk8NTzAf4kPL/rKsZ7sE37JBV7Ie89Ct1yTnWaOxcyykO/yYX0HKQV5g2v+nzlTrZetXuuOCSnYj4IW3oGiIcu5D6+6too6sGUtwY5bRPWJpbg0NLgF0FaNwXrHU6F+Gei/2KZatq3WPSOlTz0ueS1CwTehzsOCfmdWF1P+xAQNU1Wwvz0LYrIR/04ylnfJSyL0srNlRw8s4IkgCpvZn0rP6v6Qva5Vtr+Wnc6IQVFUNV9WgJOyMZqBAwWvmbAq64Tpky6L0QqgqiD5+7O6QNqp6SULbmrJIK3IawLi0GTlVLJ0xs6sIZcN5KbVONYH1MxStIM+kCZHfdw55vTXHKqVyjHkyJzKHw589NzVaKwyas6p9QAFIHqwv9kM0BscWcYtbDMYYAJOaZ/4UbRZxRyyQgrGETIiMomcAeGzA51vnQCiRjVOqaMSjcknsskWj4T2IrwdgOtTmQrkdO621YsSuJj3xZbY+M921HpKrgmN8Qe//MvszYQQGnIxEVrOJbsBc49y0oM1wxlMGWtB35xmIDikyp8+5Nyq2aFwYt7phLbnDkiV2JS73n5o/IdB8lW1TpdLXymV/FlTwuJXRfSW5iM9LKz3EwDZr4nU3G6zHbIL1iHE/z/d+5PMZe7ph2jdB3j+LhT5v5GUJG7z4Z2Sx2+IN2AsUqCSJ5Wl8G6cBtQ4txyu8ouQ3axNyAAihRPykq5xCdSO/1bnNuirNlq03zMtLzdMEngv9nNqyqxhjzpIAcxNC1Pxm90r7+PhC5EMkDLFuA3Zt2cdWjk8eyigNK2EiInl+5a4cNcAJAA== 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 <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
[v2] cryptodev: not close device when secondary exit
|
|
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
ci/loongarch-compilation | success | Compilation OK |
ci/loongarch-unit-testing | success | Unit Testing PASS |
ci/Intel-compilation | success | Compilation OK |
ci/github-robot: build | success | github build: passed |
ci/iol-mellanox-Performance | success | Performance Testing PASS |
ci/iol-unit-arm64-testing | pending | Testing pending |
ci/iol-marvell-Functional | success | Functional Testing PASS |
ci/iol-intel-Functional | success | Functional Testing PASS |
ci/iol-abi-testing | pending | Testing pending |
ci/iol-unit-amd64-testing | pending | Testing pending |
ci/iol-compile-arm64-testing | success | Testing PASS |
ci/iol-sample-apps-testing | success | Testing PASS |
ci/intel-Testing | success | Testing PASS |
ci/intel-Functional | success | Functional PASS |
Commit Message
Yang Ming
Jan. 3, 2025, 3:09 a.m. UTC
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 <ming.1.yang@nokia-sbell.com>
---
lib/cryptodev/rte_cryptodev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
> 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 <ming.1.yang@nokia-sbell.com> > --- > 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; I believe dev_close is actually not required in pmd_release_device. Dev_close need to be called from the application separately before it is released which I think is already happening. Adding more people for review.
On 2025/1/8 20:21, Akhil Goyal wrote: > Caution: This is an external email. Please be very careful when clicking links or opening attachments. See http://nok.it/nsb for additional information. > >> 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 <ming.1.yang@nokia-sbell.com> >> --- >> 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; > I believe dev_close is actually not required in pmd_release_device. > Dev_close need to be called from the application separately before it is released > which I think is already happening. > > Adding more people for review. > > Hi Akhil, I suppose the change of removing `dev_close` in `pmd_release_device` requires much more effort and commit size because this change will impact a lot of examples and cases. As there is no more comments from other people, can we accept this patch as a little improvement for the second process's scenario and wait for the entire improvement from anyone who is interested in this entire work?
> >> 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 <ming.1.yang@nokia-sbell.com> > >> --- > >> 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; > > I believe dev_close is actually not required in pmd_release_device. > > Dev_close need to be called from the application separately before it is released > > which I think is already happening. > > > > Adding more people for review. > > > > > Hi Akhil, I suppose the change of removing `dev_close` in > `pmd_release_device` requires much more effort and commit size because > this change will impact a lot of examples and cases. As there is no more > comments from other people, can we accept this patch as a little > improvement for the second process's scenario and wait for the entire > improvement from anyone who is interested in this entire work? Acked-by: Akhil Goyal <gakhil@marvell.com> Applied to dpdk-next-crypto
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;