> -----Original Message----- > From: Daly, Lee > Sent: Saturday, April 28, 2018 12:38 AM > To: dev@dpdk.org > Cc: De Lara Guarch, Pablo <pablo.de.lara.gua...@intel.com>; Tucker, Greg B > <greg.b.tuc...@intel.com>; Jain, Deepak K <deepak.k.j...@intel.com>; Trahe, > Fiona <fiona.tr...@intel.com>; Daly, Lee <lee.d...@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.d...@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);