From: Yang Ming <ming.1.yang@nokia-sbell.com>
To: Akhil Goyal <gakhil@marvell.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Anoob Joseph <anoobj@marvell.com>,
"kai.ji@intel.com" <kai.ji@intel.com>,
Gagandeep Singh <g.singh@nxp.com>,
"jack.bond-preston@foss.arm.com" <jack.bond-preston@foss.arm.com>,
"pablo.de.lara.guarch@intel.com" <pablo.de.lara.guarch@intel.com>,
"matan@nvidia.com" <matan@nvidia.com>
Subject: Re: [External] [PATCH v2] cryptodev: not close device when secondary exit
Date: Thu, 20 Feb 2025 17:13:16 +0800 [thread overview]
Message-ID: <2a825be0-cebf-4218-9e4f-d64b02bf2d6b@nokia-sbell.com> (raw)
In-Reply-To: <CO6PR18MB44844F645EFA1FA6C852B11AD8122@CO6PR18MB4484.namprd18.prod.outlook.com>
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?
prev parent reply other threads:[~2025-02-20 9:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-28 5:48 [PATCH] eal: fix bus cleanup in secondary process myang
2024-11-28 17:15 ` Stephen Hemminger
2024-12-03 9:23 ` [External] " Ming 1. Yang (NSB)
2025-01-03 3:09 ` [PATCH v2] cryptodev: not close device when secondary exit Yang Ming
2025-01-08 12:21 ` [EXTERNAL] " Akhil Goyal
2025-02-20 9:13 ` Yang Ming [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2a825be0-cebf-4218-9e4f-d64b02bf2d6b@nokia-sbell.com \
--to=ming.1.yang@nokia-sbell.com \
--cc=anoobj@marvell.com \
--cc=dev@dpdk.org \
--cc=g.singh@nxp.com \
--cc=gakhil@marvell.com \
--cc=jack.bond-preston@foss.arm.com \
--cc=kai.ji@intel.com \
--cc=matan@nvidia.com \
--cc=pablo.de.lara.guarch@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).