[dpdk-stable] patch 'test/event_crypto: fix event crypto metadata write' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:30:01 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

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/12/21. 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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/cd24395f653ffd99abc1a5fc544e96a50708079e

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From cd24395f653ffd99abc1a5fc544e96a50708079e Mon Sep 17 00:00:00 2001
From: Shijith Thotton <sthotton at marvell.com>
Date: Mon, 27 Sep 2021 20:59:13 +0530
Subject: [PATCH] test/event_crypto: fix event crypto metadata write
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 67c8baecaee2ef312330102544b1f1e892a95502 ]

Using memcpy to update event crypto metadata fields (request/response)
will result in one overwriting the other. To avoid this, fields of each
structure should be updated one by one.

Fixes: 3c2c535ecfc0 ("test: add event crypto adapter auto-test")

Signed-off-by: Shijith Thotton <sthotton at marvell.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar at intel.com>
---
 app/test/test_event_crypto_adapter.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 71b58fcbb8..c7517e215c 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -208,10 +208,10 @@ test_op_forward_mode(uint8_t session_less)
 
 		if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
 			/* Fill in private user data information */
-			rte_memcpy(&m_data.response_info, &response_info,
-				sizeof(response_info));
-			rte_memcpy(&m_data.request_info, &request_info,
-				sizeof(request_info));
+			m_data.request_info.cdev_id = request_info.cdev_id;
+			m_data.request_info.queue_pair_id =
+				request_info.queue_pair_id;
+			m_data.response_info.event = response_info.event;
 			rte_cryptodev_sym_session_set_user_data(sess,
 						&m_data, sizeof(m_data));
 		}
@@ -227,10 +227,9 @@ test_op_forward_mode(uint8_t session_less)
 		uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH;
 		op->private_data_offset = len;
 		/* Fill in private data information */
-		rte_memcpy(&m_data.response_info, &response_info,
-			   sizeof(response_info));
-		rte_memcpy(&m_data.request_info, &request_info,
-			   sizeof(request_info));
+		m_data.request_info.cdev_id = request_info.cdev_id;
+		m_data.request_info.queue_pair_id = request_info.queue_pair_id;
+		m_data.response_info.event = response_info.event;
 		rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
 	}
 
@@ -401,8 +400,7 @@ test_op_new_mode(uint8_t session_less)
 
 		if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
 			/* Fill in private user data information */
-			rte_memcpy(&m_data.response_info, &response_info,
-				   sizeof(m_data));
+			m_data.response_info.event = response_info.event;
 			rte_cryptodev_sym_session_set_user_data(sess,
 						&m_data, sizeof(m_data));
 		}
@@ -421,8 +419,7 @@ test_op_new_mode(uint8_t session_less)
 		uint32_t len = IV_OFFSET + MAXIMUM_IV_LENGTH;
 		op->private_data_offset = len;
 		/* Fill in private data information */
-		rte_memcpy(&m_data.response_info, &response_info,
-			   sizeof(m_data));
+		m_data.response_info.event = response_info.event;
 		rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data));
 	}
 
-- 
2.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:07.181933373 +0800
+++ 0117-test-event_crypto-fix-event-crypto-metadata-write.patch	2021-11-10 14:17:01.880746009 +0800
@@ -1 +1 @@
-From 67c8baecaee2ef312330102544b1f1e892a95502 Mon Sep 17 00:00:00 2001
+From cd24395f653ffd99abc1a5fc544e96a50708079e Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 67c8baecaee2ef312330102544b1f1e892a95502 ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
-index 3ad20921e2..0c7ebe6981 100644
+index 71b58fcbb8..c7517e215c 100644
@@ -23 +25 @@
-@@ -212,10 +212,10 @@ test_op_forward_mode(uint8_t session_less)
+@@ -208,10 +208,10 @@ test_op_forward_mode(uint8_t session_less)
@@ -38 +40 @@
-@@ -231,10 +231,9 @@ test_op_forward_mode(uint8_t session_less)
+@@ -227,10 +227,9 @@ test_op_forward_mode(uint8_t session_less)
@@ -52 +54 @@
-@@ -405,8 +404,7 @@ test_op_new_mode(uint8_t session_less)
+@@ -401,8 +400,7 @@ test_op_new_mode(uint8_t session_less)
@@ -62 +64 @@
-@@ -425,8 +423,7 @@ test_op_new_mode(uint8_t session_less)
+@@ -421,8 +419,7 @@ test_op_new_mode(uint8_t session_less)


More information about the stable mailing list