patch 'crypto/ipsec_mb: fix ZUC operation overwrite' has been queued to stable release 20.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Feb 28 22:20:16 CET 2022


Hi,

FYI, your patch has been queued to stable release 20.11.5

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/92d7cb4446e4538032aa22546416ad4a05bb8e03

Thanks.

Luca Boccassi

---
>From 92d7cb4446e4538032aa22546416ad4a05bb8e03 Mon Sep 17 00:00:00 2001
From: Pablo de Lara <pablo.de.lara.guarch at intel.com>
Date: Wed, 23 Feb 2022 16:01:15 +0000
Subject: [PATCH] crypto/ipsec_mb: fix ZUC operation overwrite

[ upstream commit 96d0dc2a3cd21d6f392347ae1d2ff3c21e27231a ]

ZUC PMD batches crypto operations depending on their type
(encryption + tag generation, tag verification + decryption, etc),
to allow parallelization.
The array used to store the pointers to these operations was
always the same array provided by dequeue_burst() function,
and it was looping around the same positions (from 0 to ZUC_MAX_BURST - 1).

A new internal array is used to avoid overwriting the pointers
of the array provided by dequeue_burst() function.

Fixes: cf7685d68f00 ("crypto/zuc: add driver for ZUC library")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
---
 drivers/crypto/zuc/rte_zuc_pmd.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c
index c1eb42754d..2f8a34e4f1 100644
--- a/drivers/crypto/zuc/rte_zuc_pmd.c
+++ b/drivers/crypto/zuc/rte_zuc_pmd.c
@@ -358,11 +358,11 @@ static uint16_t
 zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
 		uint16_t nb_ops)
 {
-	struct rte_crypto_op *c_ops[ZUC_MAX_BURST];
 	struct rte_crypto_op *curr_c_op;
 
 	struct zuc_session *curr_sess;
 	struct zuc_session *sessions[ZUC_MAX_BURST];
+	struct rte_crypto_op *int_c_ops[ZUC_MAX_BURST];
 	enum zuc_operation prev_zuc_op = ZUC_OP_NOT_SUPPORTED;
 	enum zuc_operation curr_zuc_op;
 	struct zuc_qp *qp = queue_pair;
@@ -389,11 +389,11 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
 		 */
 		if (burst_size == 0) {
 			prev_zuc_op = curr_zuc_op;
-			c_ops[0] = curr_c_op;
+			int_c_ops[0] = curr_c_op;
 			sessions[0] = curr_sess;
 			burst_size++;
 		} else if (curr_zuc_op == prev_zuc_op) {
-			c_ops[burst_size] = curr_c_op;
+			int_c_ops[burst_size] = curr_c_op;
 			sessions[burst_size] = curr_sess;
 			burst_size++;
 			/*
@@ -401,7 +401,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
 			 * process them, and start a new batch.
 			 */
 			if (burst_size == ZUC_MAX_BURST) {
-				processed_ops = process_ops(c_ops, curr_zuc_op,
+				processed_ops = process_ops(int_c_ops, curr_zuc_op,
 						sessions, qp, burst_size,
 						&enqueued_ops);
 				if (processed_ops < burst_size) {
@@ -416,7 +416,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
 			 * Different operation type, process the ops
 			 * of the previous type.
 			 */
-			processed_ops = process_ops(c_ops, prev_zuc_op,
+			processed_ops = process_ops(int_c_ops, prev_zuc_op,
 					sessions, qp, burst_size,
 					&enqueued_ops);
 			if (processed_ops < burst_size) {
@@ -427,7 +427,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
 			burst_size = 0;
 			prev_zuc_op = curr_zuc_op;
 
-			c_ops[0] = curr_c_op;
+			int_c_ops[0] = curr_c_op;
 			sessions[0] = curr_sess;
 			burst_size++;
 		}
@@ -435,7 +435,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
 
 	if (burst_size != 0) {
 		/* Process the crypto ops of the last operation type. */
-		processed_ops = process_ops(c_ops, prev_zuc_op,
+		processed_ops = process_ops(int_c_ops, prev_zuc_op,
 				sessions, qp, burst_size,
 				&enqueued_ops);
 	}
-- 
2.30.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-02-28 21:17:55.601964414 +0000
+++ 0020-crypto-ipsec_mb-fix-ZUC-operation-overwrite.patch	2022-02-28 21:17:53.860929669 +0000
@@ -1 +1 @@
-From 96d0dc2a3cd21d6f392347ae1d2ff3c21e27231a Mon Sep 17 00:00:00 2001
+From 92d7cb4446e4538032aa22546416ad4a05bb8e03 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 96d0dc2a3cd21d6f392347ae1d2ff3c21e27231a ]
+
@@ -17 +18,0 @@
-Cc: stable at dpdk.org
@@ -21,2 +22,2 @@
- drivers/crypto/ipsec_mb/pmd_zuc.c | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
+ drivers/crypto/zuc/rte_zuc_pmd.c | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
@@ -24,5 +25,10 @@
-diff --git a/drivers/crypto/ipsec_mb/pmd_zuc.c b/drivers/crypto/ipsec_mb/pmd_zuc.c
-index 07cf1462d2..e36c7092d6 100644
---- a/drivers/crypto/ipsec_mb/pmd_zuc.c
-+++ b/drivers/crypto/ipsec_mb/pmd_zuc.c
-@@ -259,6 +259,7 @@ zuc_pmd_dequeue_burst(void *queue_pair,
+diff --git a/drivers/crypto/zuc/rte_zuc_pmd.c b/drivers/crypto/zuc/rte_zuc_pmd.c
+index c1eb42754d..2f8a34e4f1 100644
+--- a/drivers/crypto/zuc/rte_zuc_pmd.c
++++ b/drivers/crypto/zuc/rte_zuc_pmd.c
+@@ -358,11 +358,11 @@ static uint16_t
+ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
+ 		uint16_t nb_ops)
+ {
+-	struct rte_crypto_op *c_ops[ZUC_MAX_BURST];
+ 	struct rte_crypto_op *curr_c_op;
@@ -33,4 +39,4 @@
- 	enum ipsec_mb_operation prev_zuc_op = IPSEC_MB_OP_NOT_SUPPORTED;
- 	enum ipsec_mb_operation curr_zuc_op;
- 	struct ipsec_mb_qp *qp = queue_pair;
-@@ -290,11 +291,11 @@ zuc_pmd_dequeue_burst(void *queue_pair,
+ 	enum zuc_operation prev_zuc_op = ZUC_OP_NOT_SUPPORTED;
+ 	enum zuc_operation curr_zuc_op;
+ 	struct zuc_qp *qp = queue_pair;
+@@ -389,11 +389,11 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
@@ -50 +56 @@
-@@ -302,7 +303,7 @@ zuc_pmd_dequeue_burst(void *queue_pair,
+@@ -401,7 +401,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
@@ -56 +62,2 @@
- 						sessions, qp, burst_size);
+ 						sessions, qp, burst_size,
+ 						&enqueued_ops);
@@ -58,2 +65 @@
- 					burst_size = 0;
-@@ -316,7 +317,7 @@ zuc_pmd_dequeue_burst(void *queue_pair,
+@@ -416,7 +416,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
@@ -65 +71,2 @@
- 					sessions, qp, burst_size);
+ 					sessions, qp, burst_size,
+ 					&enqueued_ops);
@@ -67,2 +74 @@
- 				burst_size = 0;
-@@ -326,7 +327,7 @@ zuc_pmd_dequeue_burst(void *queue_pair,
+@@ -427,7 +427,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
@@ -77 +83 @@
-@@ -334,7 +335,7 @@ zuc_pmd_dequeue_burst(void *queue_pair,
+@@ -435,7 +435,7 @@ zuc_pmd_enqueue_burst(void *queue_pair, struct rte_crypto_op **ops,
@@ -83 +89,2 @@
- 				sessions, qp, burst_size);
+ 				sessions, qp, burst_size,
+ 				&enqueued_ops);
@@ -85 +91,0 @@
- 


More information about the stable mailing list