diff mbox series

[v5,4/7] test/event: use new API to set event crypto metadata

Message ID 20220512124527.2031321-5-gakhil@marvell.com (mailing list archive)
State Accepted
Delegated to: akhil goyal
Headers show
Series Add new cryptodev op for event metadata | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Akhil Goyal May 12, 2022, 12:45 p.m. UTC
Used the new API rte_cryptodev_set_session_event_mdata to set
event crypto metadata from the applications (app/test and
app/test-eventdev) instead of using session userdata.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Abhinandan Gujjar <Abhinandan.gujjar@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
---
 app/test-eventdev/test_perf_common.c |  8 ++++++--
 app/test/test_event_crypto_adapter.c | 12 ++++++++----
 2 files changed, 14 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 9d1f4a4567..0378607cda 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -835,8 +835,12 @@  perf_event_dev_port_setup(struct evt_test *test, struct evt_options *opt,
 					return -ENOMEM;
 
 				m_data.response_info.flow_id = flow_id;
-				rte_cryptodev_sym_session_set_user_data(
-					crypto_sess, &m_data, sizeof(m_data));
+				rte_cryptodev_session_event_mdata_set(cdev_id,
+						crypto_sess,
+						RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+						RTE_CRYPTO_OP_WITH_SESSION,
+						&m_data, sizeof(m_data));
+
 				p->ca.crypto_sess[flow_id] = crypto_sess;
 			}
 
diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c
index 688520db4e..9904206735 100644
--- a/app/test/test_event_crypto_adapter.c
+++ b/app/test/test_event_crypto_adapter.c
@@ -227,8 +227,10 @@  test_op_forward_mode(uint8_t session_less)
 			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));
+			rte_cryptodev_session_event_mdata_set(TEST_CDEV_ID,
+					sess, RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+					RTE_CRYPTO_OP_WITH_SESSION,
+					&m_data, sizeof(m_data));
 		}
 
 		rte_crypto_op_attach_sym_session(op, sess);
@@ -416,8 +418,10 @@  test_op_new_mode(uint8_t session_less)
 		if (cap & RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) {
 			/* Fill in private user data information */
 			m_data.response_info.event = response_info.event;
-			rte_cryptodev_sym_session_set_user_data(sess,
-						&m_data, sizeof(m_data));
+			rte_cryptodev_session_event_mdata_set(TEST_CDEV_ID,
+					sess, RTE_CRYPTO_OP_TYPE_SYMMETRIC,
+					RTE_CRYPTO_OP_WITH_SESSION,
+					&m_data, sizeof(m_data));
 		}
 		ret = rte_cryptodev_sym_session_init(TEST_CDEV_ID, sess,
 				&cipher_xform, params.session_priv_mpool);