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

Message ID 20220421143720.1583062-5-gakhil@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series Add new cryptodev op for event metadata |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Akhil Goyal April 21, 2022, 2:37 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>
---
 app/test-eventdev/test_perf_common.c |  8 ++++++--
 app/test/test_event_crypto_adapter.c | 12 ++++++++----
 2 files changed, 14 insertions(+), 6 deletions(-)
  

Comments

Fan Zhang April 27, 2022, 3:39 p.m. UTC | #1
> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Thursday, April 21, 2022 3:37 PM
> To: dev@dpdk.org
> Cc: anoobj@marvell.com; jerinj@marvell.com; Gujjar, Abhinandan S
> <abhinandan.gujjar@intel.com>; Jayatheerthan, Jay
> <jay.jayatheerthan@intel.com>; Vangati, Narender
> <narender.vangati@intel.com>; vfialko@marvell.com; Akhil Goyal
> <gakhil@marvell.com>
> Subject: [PATCH v3 4/7] test/event: use new API to set event crypto
> metadata
> 
> 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>
  
Gujjar, Abhinandan S April 28, 2022, 2:47 p.m. UTC | #2
Acked-by: Abhinandan Gujjar <Abhinandan.gujjar@intel.com>

> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Thursday, April 21, 2022 8:07 PM
> To: dev@dpdk.org
> Cc: anoobj@marvell.com; jerinj@marvell.com; Gujjar, Abhinandan S
> <abhinandan.gujjar@intel.com>; Jayatheerthan, Jay
> <jay.jayatheerthan@intel.com>; Vangati, Narender
> <narender.vangati@intel.com>; vfialko@marvell.com; Akhil Goyal
> <gakhil@marvell.com>
> Subject: [PATCH v3 4/7] test/event: use new API to set event crypto metadata
> 
> 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>
> ---
>  app/test-eventdev/test_perf_common.c |  8 ++++++--
> app/test/test_event_crypto_adapter.c | 12 ++++++++----
>  2 files changed, 14 insertions(+), 6 deletions(-)
> 
> 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);
> --
> 2.25.1
  

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);