diff mbox series

[v5,3/7] crypto/octeontx: use new API for event metadata

Message ID 20220512124527.2031321-4-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
For getting event crypto metadata from crypto_op,
the new API rte_cryptodev_get_session_event_mdata can be used
directly instead of getting userdata inside PMD.

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>
---
 drivers/crypto/octeontx/otx_cryptodev_ops.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)
diff mbox series

Patch

diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c
index ddb1266c3c..d5851d9987 100644
--- a/drivers/crypto/octeontx/otx_cryptodev_ops.c
+++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c
@@ -684,24 +684,6 @@  submit_request_to_sso(struct ssows *ws, uintptr_t req,
 	ssovf_store_pair(add_work, req, ws->grps[rsp_info->queue_id]);
 }
 
-static inline union rte_event_crypto_metadata *
-get_event_crypto_mdata(struct rte_crypto_op *op)
-{
-	union rte_event_crypto_metadata *ec_mdata;
-
-	if (op->sess_type == RTE_CRYPTO_OP_WITH_SESSION)
-		ec_mdata = rte_cryptodev_sym_session_get_user_data(
-							   op->sym->session);
-	else if (op->sess_type == RTE_CRYPTO_OP_SESSIONLESS &&
-		 op->private_data_offset)
-		ec_mdata = (union rte_event_crypto_metadata *)
-			((uint8_t *)op + op->private_data_offset);
-	else
-		return NULL;
-
-	return ec_mdata;
-}
-
 uint16_t __rte_hot
 otx_crypto_adapter_enqueue(void *port, struct rte_crypto_op *op)
 {
@@ -712,7 +694,7 @@  otx_crypto_adapter_enqueue(void *port, struct rte_crypto_op *op)
 	uint8_t op_type, cdev_id;
 	uint16_t qp_id;
 
-	ec_mdata = get_event_crypto_mdata(op);
+	ec_mdata = rte_cryptodev_session_event_mdata_get(op);
 	if (unlikely(ec_mdata == NULL)) {
 		rte_errno = EINVAL;
 		return 0;