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

Kevin Traynor ktraynor at redhat.com
Fri Nov 22 15:41:21 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/29/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.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/8dec9eab6ac4eca67cb8df2dcdd5a09eaf86bc8e

Thanks.

Kevin.

---
>From 8dec9eab6ac4eca67cb8df2dcdd5a09eaf86bc8e 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 ff8520cf7..9c35e6d9c 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -685,10 +685,12 @@ 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 */
-- 
2.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-11-22 14:36:57.075638984 +0000
+++ 0035-cryptodev-fix-initialization-on-multi-process.patch	2019-11-22 14:36:55.204149137 +0000
@@ -1 +1 @@
-From 1a60db7f354a52add0c1ea66e55ba7beba1a9716 Mon Sep 17 00:00:00 2001
+From 8dec9eab6ac4eca67cb8df2dcdd5a09eaf86bc8e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1a60db7f354a52add0c1ea66e55ba7beba1a9716 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index 43bc335f5..b16ef7b2c 100644
+index ff8520cf7..9c35e6d9c 100644
@@ -25,2 +26,2 @@
-@@ -726,10 +726,12 @@ rte_cryptodev_pmd_allocate(const char *name, int socket_id)
- 		cryptodev->data = *cryptodev_data;
+@@ -685,10 +685,12 @@ rte_cryptodev_pmd_allocate(const char *name, int socket_id)
+ 		cryptodev->data = cryptodev_data;
@@ -28,2 +29,2 @@
--		strlcpy(cryptodev->data->name, name,
--			RTE_CRYPTODEV_NAME_MAX_LEN);
+-		snprintf(cryptodev->data->name, RTE_CRYPTODEV_NAME_MAX_LEN,
+-				"%s", name);
@@ -31,2 +32,2 @@
-+			strlcpy(cryptodev->data->name, name,
-+				RTE_CRYPTODEV_NAME_MAX_LEN);
++			snprintf(cryptodev->data->name, RTE_CRYPTODEV_NAME_MAX_LEN,
++					"%s", name);



More information about the stable mailing list