Bug 93 - crypto vdev create will reset the dev_started flag when one dpdk process has been up the crypto vdev
Summary: crypto vdev create will reset the dev_started flag when one dpdk process has...
Status: CONFIRMED
Alias: None
Product: DPDK
Classification: Unclassified
Component: cryptodev (show other bugs)
Version: 17.05
Hardware: All All
: Normal major
Target Milestone: ---
Assignee: Pablo de Lara
URL:
Depends on:
Blocks:
 
Reported: 2018-09-28 11:35 CEST by jin, wenjing
Modified: 2019-01-05 16:25 CET (History)
3 users (show)



Attachments

Description jin, wenjing 2018-09-28 11:35:23 CEST
when use crypto vdev in one group primary/secondary processes, when one process up the crypto vdev , if anther dpdk process startup with same dpdk crypto vdev paramters, that will lead to the up vdev started flag set to 0.

from the code, if we want to use the vdev in secondary process , it must be create in primary dpdk process first,and the secondary process which want use the crypto vdev need startup with same dpdk vdev parameters(--vdev).but when one dpdk process start after the crypto vdev up in one process , the vdev started flag will reset to 0. this seem not an expected result,this will broke the active cryptodev using.

test step:

         1: create one crypto vdev in primary dpdk process and then configured and start the crypto vdev . 
         2: startup secondary dpdk process with same crypto vdev parameters(crypto vdev will create in rte_eal_init())

         
        expected result: crypto vdev stats normal in first process  
        actual result:  crypto vdev dev_started set to 0

same issue with up crypto vdev in one secondary process and startup other secondary process with same crypto parameters

this issue will result in different dpdk process can configured and start crypto vdev independently in such scenario, it seem not an expected result. 

from the code we can see 
rte_cryptodev_pmd_allocate {
..............

if (cryptodev->data == NULL) {
		struct rte_cryptodev_data *cryptodev_data =
				cryptodev_globals.data[dev_id];

		int retval = rte_cryptodev_data_alloc(dev_id, &cryptodev_data,
				socket_id);

		cryptodev->data = cryptodev_data;

...............................	

		cryptodev->data->dev_id = dev_id;
		cryptodev->data->socket_id = socket_id;
		cryptodev->data->dev_started = 0;  

		cryptodev->attached = RTE_CRYPTODEV_ATTACHED;

		cryptodev_globals.nb_devs++;
	}
....................
}

in this function "cryptodev->data->dev_started = 0;" will executed in all dpdk process which config with same dpdk crypto vdev, it's better add some condition to set to zero, such as if the dev_started set to 1,dev_started not set here.


would you please help to check and fixed it?


thanks
Comment 1 Ajit Khaparde 2018-09-28 19:14:32 CEST
Pablo, Can you please take a look? Thanks
Comment 2 jin, wenjing 2018-10-17 10:16:46 CEST
(In reply to Ajit Khaparde from comment #1)
> Pablo, Can you please take a look? Thanks

hi Pablo,
     would you please help to check this issue?
Comment 3 Fan Zhang 2018-12-17 13:10:20 CET
(In reply to jin, wenjing from comment #2)
> (In reply to Ajit Khaparde from comment #1)
> > Pablo, Can you please take a look? Thanks
> 
> hi Pablo,
>      would you please help to check this issue?

A secondary process should never create the software Cryptodev with the same name as the one created in primary process. To distinguish they shall use different suffix such as "crypto_aesni_mb0" and "crypto_aesni_mb1" for each process.

Indeed we need to provide a way to prevent such usage. I will look into it.
Comment 4 Fan Zhang 2019-01-05 16:25:35 CET
(In reply to jin, wenjing from comment #2)
> (In reply to Ajit Khaparde from comment #1)
> > Pablo, Can you please take a look? Thanks
> 
> hi Pablo,
>      would you please help to check this issue?

Hi,

I cannot reproduce this bug. Could you offer more details, including the commands you are using?

Note You need to log in before you can comment on or make changes to this bug.