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 <gak...@marvell.com>
Acked-by: Fan Zhang <roy.fan.zh...@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.guj...@intel.com>
Acked-by: Anoob Joseph <ano...@marvell.com>
---
 drivers/crypto/octeontx/otx_cryptodev_ops.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)

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

Reply via email to