patch 'crypto/virtio: fix cipher data source length' has been queued to stable release 22.11.9

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Jun 12 23:06:32 CEST 2025


Hi,

FYI, your patch has been queued to stable release 22.11.9

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

Thanks.

Luca Boccassi

---
>From c468e5df1c05e5923ec00aa8f9fb447df4afd959 Mon Sep 17 00:00:00 2001
From: Rajesh Mudimadugula <rmudimadugul at marvell.com>
Date: Thu, 3 Apr 2025 12:26:03 +0000
Subject: [PATCH] crypto/virtio: fix cipher data source length

[ upstream commit fcb4d1f48e4aecb6be4ef7a4f6f25df24fee0ea2 ]

In symmetric algorithm chaining, we need to consider both
cipher and auth data length for cipher source.

Fixes: 82adb12a1fce ("crypto/virtio: support burst enqueue/dequeue")

Signed-off-by: Rajesh Mudimadugula <rmudimadugul at marvell.com>
Acked-by: Akhil Goyal <gakhil at marvell.com>
---
 drivers/crypto/virtio/virtio_rxtx.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/crypto/virtio/virtio_rxtx.c b/drivers/crypto/virtio/virtio_rxtx.c
index d02486661f..01977c7ec4 100644
--- a/drivers/crypto/virtio/virtio_rxtx.c
+++ b/drivers/crypto/virtio/virtio_rxtx.c
@@ -157,8 +157,10 @@ virtqueue_crypto_sym_pkt_header_arrange(
 		req_data->u.sym_req.u.chain.para.aad_len = session->aad.length;
 
 		req_data->u.sym_req.u.chain.para.src_data_len =
-			(sym_op->cipher.data.length +
-				sym_op->cipher.data.offset);
+			RTE_MAX((sym_op->cipher.data.length +
+				 sym_op->cipher.data.offset),
+				(sym_op->auth.data.length +
+				 sym_op->auth.data.offset));
 		req_data->u.sym_req.u.chain.para.dst_data_len =
 			req_data->u.sym_req.u.chain.para.src_data_len;
 		req_data->u.sym_req.u.chain.para.cipher_start_src_offset =
@@ -212,6 +214,7 @@ virtqueue_crypto_sym_enqueue_xmit(
 	uint32_t hash_result_len = 0;
 	struct virtio_crypto_op_cookie *crypto_op_cookie;
 	struct virtio_crypto_alg_chain_session_para *para;
+	uint32_t src_len;
 
 	if (unlikely(sym_op->m_src->nb_segs != 1))
 		return -EMSGSIZE;
@@ -285,21 +288,22 @@ virtqueue_crypto_sym_enqueue_xmit(
 		desc[idx++].flags = VRING_DESC_F_NEXT;
 	}
 
+	src_len = RTE_MAX((sym_op->cipher.data.offset +
+			   sym_op->cipher.data.length),
+			  (sym_op->auth.data.length +
+			   sym_op->auth.data.offset));
 	/* indirect vring: src data */
 	desc[idx].addr = rte_pktmbuf_iova_offset(sym_op->m_src, 0);
-	desc[idx].len = (sym_op->cipher.data.offset
-		+ sym_op->cipher.data.length);
+	desc[idx].len = src_len;
 	desc[idx++].flags = VRING_DESC_F_NEXT;
 
 	/* indirect vring: dst data */
 	if (sym_op->m_dst) {
 		desc[idx].addr = rte_pktmbuf_iova_offset(sym_op->m_dst, 0);
-		desc[idx].len = (sym_op->cipher.data.offset
-			+ sym_op->cipher.data.length);
+		desc[idx].len = src_len;
 	} else {
 		desc[idx].addr = rte_pktmbuf_iova_offset(sym_op->m_src, 0);
-		desc[idx].len = (sym_op->cipher.data.offset
-			+ sym_op->cipher.data.length);
+		desc[idx].len = src_len;
 	}
 	desc[idx++].flags = VRING_DESC_F_WRITE | VRING_DESC_F_NEXT;
 
-- 
2.47.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-06-12 22:06:24.457060847 +0100
+++ 0015-crypto-virtio-fix-cipher-data-source-length.patch	2025-06-12 22:06:23.806043286 +0100
@@ -1 +1 @@
-From fcb4d1f48e4aecb6be4ef7a4f6f25df24fee0ea2 Mon Sep 17 00:00:00 2001
+From c468e5df1c05e5923ec00aa8f9fb447df4afd959 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit fcb4d1f48e4aecb6be4ef7a4f6f25df24fee0ea2 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
-index 0cc904485c..a7f1bd9753 100644
+index d02486661f..01977c7ec4 100644
@@ -22 +23 @@
-@@ -243,8 +243,10 @@ virtqueue_crypto_sym_pkt_header_arrange(
+@@ -157,8 +157,10 @@ virtqueue_crypto_sym_pkt_header_arrange(
@@ -35 +36 @@
-@@ -298,6 +300,7 @@ virtqueue_crypto_sym_enqueue_xmit_split(
+@@ -212,6 +214,7 @@ virtqueue_crypto_sym_enqueue_xmit(
@@ -43 +44 @@
-@@ -371,21 +374,22 @@ virtqueue_crypto_sym_enqueue_xmit_split(
+@@ -285,21 +288,22 @@ virtqueue_crypto_sym_enqueue_xmit(


More information about the stable mailing list