[dpdk-stable] patch 'cryptodev: fix initialization on multi-process' has been queued to LTS release 17.11.10

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Dec 19 15:32:49 CET 2019


Hi,

FYI, your patch has been queued to LTS release 17.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/21/19. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From ea9e76487f82560c0f7041fd3997dee01d05523c Mon Sep 17 00:00:00 2001
From: Julien Meunier <julien.meunier at nokia.com>
Date: Wed, 7 Aug 2019 11:39:23 +0300
Subject: [PATCH] cryptodev: fix initialization on multi-process

[ upstream commit 1a60db7f354a52add0c1ea66e55ba7beba1a9716 ]

Primary process is responsible to initialize the data struct of each
crypto devices.

Secondary process should not override this data during the
initialization.

Fixes: d11b0f30df88 ("cryptodev: introduce API and framework for crypto devices")

Signed-off-by: Julien Meunier <julien.meunier at nokia.com>
Acked-by: Akhil Goyal <akhil.goyal at nxp.com>
---
 lib/librte_cryptodev/rte_cryptodev.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index c9f2b6235f..ee3a2447ef 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -603,12 +603,14 @@ rte_cryptodev_pmd_allocate(const char *name, int socket_id)
 
 		cryptodev->data = cryptodev_data;
 
-		snprintf(cryptodev->data->name, RTE_CRYPTODEV_NAME_MAX_LEN,
-				"%s", name);
+		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+			snprintf(cryptodev->data->name, RTE_CRYPTODEV_NAME_MAX_LEN,
+					"%s", name);
 
-		cryptodev->data->dev_id = dev_id;
-		cryptodev->data->socket_id = socket_id;
-		cryptodev->data->dev_started = 0;
+			cryptodev->data->dev_id = dev_id;
+			cryptodev->data->socket_id = socket_id;
+			cryptodev->data->dev_started = 0;
+		}
 
 		/* init user callbacks */
 		TAILQ_INIT(&(cryptodev->link_intr_cbs));
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-19 14:32:27.199392859 +0000
+++ 0022-cryptodev-fix-initialization-on-multi-process.patch	2019-12-19 14:32:25.541286641 +0000
@@ -1,8 +1,10 @@
-From 1a60db7f354a52add0c1ea66e55ba7beba1a9716 Mon Sep 17 00:00:00 2001
+From ea9e76487f82560c0f7041fd3997dee01d05523c Mon Sep 17 00:00:00 2001
 From: Julien Meunier <julien.meunier at nokia.com>
 Date: Wed, 7 Aug 2019 11:39:23 +0300
 Subject: [PATCH] cryptodev: fix initialization on multi-process
 
+[ upstream commit 1a60db7f354a52add0c1ea66e55ba7beba1a9716 ]
+
 Primary process is responsible to initialize the data struct of each
 crypto devices.
 
@@ -10,7 +12,6 @@
 initialization.
 
 Fixes: d11b0f30df88 ("cryptodev: introduce API and framework for crypto devices")
-Cc: stable at dpdk.org
 
 Signed-off-by: Julien Meunier <julien.meunier at nokia.com>
 Acked-by: Akhil Goyal <akhil.goyal at nxp.com>
@@ -19,18 +20,18 @@
  1 file changed, 7 insertions(+), 5 deletions(-)
 
 diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
-index 43bc335f58..b16ef7b2c1 100644
+index c9f2b6235f..ee3a2447ef 100644
 --- a/lib/librte_cryptodev/rte_cryptodev.c
 +++ b/lib/librte_cryptodev/rte_cryptodev.c
-@@ -725,12 +725,14 @@ rte_cryptodev_pmd_allocate(const char *name, int socket_id)
+@@ -603,12 +603,14 @@ rte_cryptodev_pmd_allocate(const char *name, int socket_id)
  
- 		cryptodev->data = *cryptodev_data;
+ 		cryptodev->data = cryptodev_data;
  
--		strlcpy(cryptodev->data->name, name,
--			RTE_CRYPTODEV_NAME_MAX_LEN);
+-		snprintf(cryptodev->data->name, RTE_CRYPTODEV_NAME_MAX_LEN,
+-				"%s", name);
 +		if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
-+			strlcpy(cryptodev->data->name, name,
-+				RTE_CRYPTODEV_NAME_MAX_LEN);
++			snprintf(cryptodev->data->name, RTE_CRYPTODEV_NAME_MAX_LEN,
++					"%s", name);
  
 -		cryptodev->data->dev_id = dev_id;
 -		cryptodev->data->socket_id = socket_id;


More information about the stable mailing list