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

Message ID 20220421143720.1583062-4-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
  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>
---
 drivers/crypto/octeontx/otx_cryptodev_ops.c | 20 +-------------------
 1 file changed, 1 insertion(+), 19 deletions(-)
  

Comments

Fan Zhang April 27, 2022, 3:38 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 3/7] crypto/octeontx: use new API for event metadata
> 
> 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>
  
Gujjar, Abhinandan S May 1, 2022, 1:18 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 3/7] crypto/octeontx: use new API for event metadata
> 
> 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>
> ---
>  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
  

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;