[dpdk-dev] [PATCH v2 2/6] compress/octeontx: add device setup PMD ops

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Sat Jul 14 00:21:36 CEST 2018



> -----Original Message-----
> From: Shally Verma [mailto:shally.verma at caviumnetworks.com]
> Sent: Monday, July 2, 2018 5:55 PM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch at intel.com>
> Cc: dev at dpdk.org; pathreya at caviumnetworks.com;
> mchalla at caviumnetworks.com; Sunila Sahu
> <sunila.sahu at caviumnetworks.com>; Ashish Gupta
> <ashish.gupta at caviumnetworks.com>
> Subject: [PATCH v2 2/6] compress/octeontx: add device setup PMD ops
> 
> From: Sunila Sahu <sunila.sahu at caviumnetworks.com>
> 
> implement device configure and PMD ops.
> setup stream resource memory pool
> setup and enable hardware queue
> 
> Signed-off-by: Ashish Gupta <ashish.gupta at caviumnetworks.com>
> Signed-off-by: Shally Verma <shally.verma at caviumnetworks.com>
> Signed-off-by: Sunila Sahu <sunila.sahu at caviumnetworks.com>
> ---
>  drivers/compress/octeontx/zip_pmd.c | 251
> ++++++++++++++++++++++++++++++++++++
>  drivers/compress/octeontx/zipvf.c   |  73 +++++++++++
>  drivers/compress/octeontx/zipvf.h   |  56 +++++++-
>  3 files changed, 378 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/compress/octeontx/zip_pmd.c
> b/drivers/compress/octeontx/zip_pmd.c
> index 2011db37e..44c271e1a 100644
> --- a/drivers/compress/octeontx/zip_pmd.c
> +++ b/drivers/compress/octeontx/zip_pmd.c
> @@ -9,8 +9,259 @@
>  #include <rte_cpuflags.h>
>  #include <rte_malloc.h>
> 
> +static const struct rte_compressdev_capabilities
> +				octtx_zip_pmd_capabilities[] = {
> +	{	.algo = RTE_COMP_ALGO_DEFLATE,
> +		/* Deflate */
> +		.comp_feature_flags = 0,

Need to add at least Fixed feature flag here.

> +		/* Non sharable Priv XFORM and Stateless */
> +		.window_size = {
> +				.min = 1,
> +				.max = 14,
> +				.increment = 1
> +				/* size supported 2^1 to 2^14 */
> +		},
> +	},
> +	RTE_COMP_END_OF_CAPABILITIES_LIST()
> +};
> +

...

> +
> +/** Release queue pair */
> +static int
> +zip_pmd_qp_release(struct rte_compressdev *dev, uint16_t qp_id) {
> +	struct zipvf_qp *qp = dev->data->queue_pairs[qp_id];
> +	struct rte_ring *r = NULL;
> +
> +	if (qp != NULL) {
> +		zipvf_q_term(qp);
> +		r = rte_ring_lookup(qp->name);

You can use qp->processed_pkts.

> +		if (r)
> +			rte_ring_free(r);
> +		rte_free(qp);
> +		dev->data->queue_pairs[qp_id] = NULL;
> +	}
> +	return 0;
> +}
> +

...

> +qp_setup_cleanup:
> +	if (qp->processed_pkts) {
> +		rte_ring_free(qp->processed_pkts);
> +		qp->processed_pkts = NULL;
> +	}
> +	if (qp) {
> +		rte_free(qp);
> +		qp = NULL;
> +	

No need to set NULL these two last pointers.




More information about the dev mailing list