[dpdk-dev] [PATCH] cryptodev: API change to rte_crypto_op bursts

Trahe, Fiona fiona.trahe at intel.com
Mon Feb 8 18:50:27 CET 2016



> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Declan Doherty
> Sent: Saturday, January 30, 2016 1:07 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH] cryptodev: API change to rte_crypto_op bursts
> 
> This patch modifies the crypto burst enqueue/dequeue APIs to operate on bursts
> rte_crypto_op's rather than the current implementation which operates on
> rte_mbuf bursts which simplifies the burst processing in the crypto PMDs and the
> use of crypto operations in general.
> 
> The changes also separates the symmetric operation parameters from the more
> general operation parameters, this will  simplify the integration of
> asymmetric crypto operations in the future.
> 
> As well as the changes to the crypto APIs this patch adds  function for managing
> rte_crypto_op pools to the cryptodev API. It modifies the existing PMDs, unit
> tests and sample application to work with the modified APIs and finally
> removes the now unused rte_mbuf_offload library.
> 
> Signed-off-by: Declan Doherty <declan.doherty at intel.com>
> ---

//snip//
> +
> +/**
> + * Reset the fields of a symmetric operation to their default values.
>   *
>   * @param	op	The crypto operation to be reset.
>   */
>  static inline void
> -__rte_crypto_op_reset(struct rte_crypto_op *op)
> +__rte_crypto_sym_op_reset(struct rte_crypto_sym_op *op)
>  {
>  	op->type = RTE_CRYPTO_OP_SESSIONLESS;

Maybe rename the type param in struct rte_crypto_sym_op to session_type 
and op param in this fn to sym_op?
To avoid confusion with op->type in function below.

> -	op->dst.m = NULL;
> -	op->dst.offset = 0;
> +
> +	op->m_src = NULL;
> +	op->m_dst = NULL;
> +}
> +
> +/**
> + * Reset the fields of a crypto operation to their default values.
> + *
> + * @param	op	The crypto operation to be reset.
> + * @param	type	The crypto operation type.
> + */
> +static inline void
> +__rte_crypto_op_reset(struct rte_crypto_op *op, enum rte_crypto_op_type
> type)
> +{
> +	op->status = RTE_CRYPTO_OP_STATUS_NOT_SUBMITTED;
> +
> +	if (type == RTE_CRYPTO_OP_TYPE_SYMMETRIC) {
> +		op->type = type;
> +		__rte_crypto_sym_op_reset(&op->sym);
> +	}
>  }
> 



More information about the dev mailing list