[dpdk-dev] [PATCH v4 06/10] compress/isal: support enqueue/dequeue api

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Thu May 3 23:46:29 CEST 2018



> -----Original Message-----
> From: Daly, Lee
> Sent: Saturday, April 28, 2018 12:38 AM
> To: dev at dpdk.org
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>; Tucker, Greg B
> <greg.b.tucker at intel.com>; Jain, Deepak K <deepak.k.jain at intel.com>; Trahe,
> Fiona <fiona.trahe at intel.com>; Daly, Lee <lee.daly at intel.com>
> Subject: [PATCH v4 06/10] compress/isal: support enqueue/dequeue api
> 
> This patchs adds support for the compressdev enqueue_burst and
> dequeue_burst API operations.
> 
> Signed-off-by: Lee Daly <lee.daly at intel.com>
> ---
>  drivers/compress/isal/isal_compress_pmd.c     | 64
> +++++++++++++++++++++++++++
>  drivers/compress/isal/isal_compress_pmd_ops.c |  2 +
>  2 files changed, 66 insertions(+)
> 
> diff --git a/drivers/compress/isal/isal_compress_pmd.c
> b/drivers/compress/isal/isal_compress_pmd.c
> index 325867b..b13822a 100644
> --- a/drivers/compress/isal/isal_compress_pmd.c
> +++ b/drivers/compress/isal/isal_compress_pmd.c
> @@ -208,6 +208,66 @@ isal_comp_set_priv_xform_parameters(struct
> isal_priv_xform *priv_xform,
>  	return 0;
>  }
> 
> +/* Process compression/decompression operation */ static int
> +process_op(struct isal_comp_qp *qp __rte_unused,
> +		struct rte_comp_op *op __rte_unused,
> +		struct isal_priv_xform *priv_xform)
> +{
> +	switch (priv_xform->type) {
> +	case RTE_COMP_COMPRESS:
> +		break;
> +	case RTE_COMP_DECOMPRESS:
> +		break;
> +	default:
> +		ISAL_PMD_LOG(ERR, "Operation Not Supported\n");
> +		return -ENOTSUP;
> +	}
> +	return 0;
> +}
> +
> +/* Enqueue burst */
> +static uint16_t
> +isal_comp_pmd_enqueue_burst(void *queue_pair, struct rte_comp_op **ops,
> +			uint16_t nb_ops)
> +{
> +	struct isal_comp_qp *qp = queue_pair;
> +	uint16_t i;
> +	int retval;
> +	int16_t num_enq = RTE_MIN(qp->num_free_elements, nb_ops);
> +
> +	for (i = 0; i < num_enq; i++) {

Before calling process_op, check if the operation is a stateless op, since
private_xform is only used with stateless ops and if not, set the status to error
and continue with the next op.


> +		retval = process_op(qp, ops[i], ops[i]->private_xform);



More information about the dev mailing list