patch 'eventdev/crypto: fix enqueueing' has been queued to stable release 22.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Mar 14 01:09:05 CET 2024


Hi,

FYI, your patch has been queued to stable release 22.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/16/24. 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/85bd236b258a30cd41dcf01634af52ef48e5fda7

Thanks.

Luca Boccassi

---
>From 85bd236b258a30cd41dcf01634af52ef48e5fda7 Mon Sep 17 00:00:00 2001
From: Ganapati Kundapura <ganapati.kundapura at intel.com>
Date: Wed, 28 Feb 2024 04:39:19 -0600
Subject: [PATCH] eventdev/crypto: fix enqueueing

[ upstream commit f5d48ed52da03d5d3b68889e844bab59b2ffb4f0 ]

When tail pointer of circular buffer rolls over as the circular buffer
becomes full, crypto adapter is enqueueing ops beyond the size of the
circular buffer leading to segfault due to invalid ops access.

Fixed by enqueueing ops from head pointer to (size-head) number of ops
when circular buffer becomes full and the remaining ops will be flushed
in next iteration.

Fixes: 6c3c888656fc ("eventdev/crypto: fix circular buffer full case")

Signed-off-by: Ganapati Kundapura <ganapati.kundapura at intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar at intel.com>
---
 lib/eventdev/rte_event_crypto_adapter.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index c31b2b4021..a25316a43a 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -237,20 +237,28 @@ eca_circular_buffer_flush_to_cdev(struct crypto_ops_circular_buffer *bufp,
 	struct rte_crypto_op **ops = bufp->op_buffer;
 
 	if (*tailp > *headp)
+		/* Flush ops from head pointer to (tail - head) OPs */
 		n = *tailp - *headp;
 	else if (*tailp < *headp)
+		/* Circ buffer - Rollover.
+		 * Flush OPs from head to max size of buffer.
+		 * Rest of the OPs will be flushed in next iteration.
+		 */
 		n = bufp->size - *headp;
 	else { /* head == tail case */
 		/* when head == tail,
 		 * circ buff is either full(tail pointer roll over) or empty
 		 */
 		if (bufp->count != 0) {
-			/* circ buffer is full */
-			n = bufp->count;
+			/* Circ buffer - FULL.
+			 * Flush OPs from head to max size of buffer.
+			 * Rest of the OPS will be flushed in next iteration.
+			 */
+			n = bufp->size - *headp;
 		} else {
-			/* circ buffer is empty */
+			/* Circ buffer - Empty */
 			*nb_ops_flushed = 0;
-			return 0;  /* buffer empty */
+			return 0;
 		}
 	}
 
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-14 00:09:21.218040234 +0000
+++ 0009-eventdev-crypto-fix-enqueueing.patch	2024-03-14 00:09:20.573614427 +0000
@@ -1 +1 @@
-From f5d48ed52da03d5d3b68889e844bab59b2ffb4f0 Mon Sep 17 00:00:00 2001
+From 85bd236b258a30cd41dcf01634af52ef48e5fda7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f5d48ed52da03d5d3b68889e844bab59b2ffb4f0 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -24 +25 @@
-index d46595d190..9903f96695 100644
+index c31b2b4021..a25316a43a 100644
@@ -27 +28 @@
-@@ -245,20 +245,28 @@ eca_circular_buffer_flush_to_cdev(struct crypto_ops_circular_buffer *bufp,
+@@ -237,20 +237,28 @@ eca_circular_buffer_flush_to_cdev(struct crypto_ops_circular_buffer *bufp,


More information about the stable mailing list