> -----Original Message-----
> From: Shally Verma [mailto:shally.ve...@caviumnetworks.com]
> Sent: Tuesday, June 5, 2018 11:35 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.gua...@intel.com>
> Cc: Trahe, Fiona <fiona.tr...@intel.com>; dev@dpdk.org;
> pathr...@caviumnetworks.com; mcha...@caviumnetworks.com; Ashish Gupta
> <ashish.gu...@caviumnetworks.com>; Sunila Sahu
> <sunila.s...@caviumnetworks.com>
> Subject: [PATCH v1 2/7] compress/octeontx: add device setup PMD ops
>
> implement device configure and PMD ops.
> setup stream resource memory pool
> setup and enable hardware queue
>
> Signed-off-by: Ashish Gupta <ashish.gu...@caviumnetworks.com>
> Signed-off-by: Shally Verma <shally.ve...@caviumnetworks.com>
> Signed-off-by: Sunila Sahu <sunila.s...@caviumnetworks.com>
> ---
> drivers/compress/octeontx/include/zip_regs.h | 721
> +++++++++++++++++++++++++++
> drivers/compress/octeontx/zip_pmd.c | 269 ++++++++++
> drivers/compress/octeontx/zipvf.c | 81 +++
> drivers/compress/octeontx/zipvf.h | 103 ++++
> 4 files changed, 1174 insertions(+)
..
> diff --git a/drivers/compress/octeontx/zip_pmd.c
> b/drivers/compress/octeontx/zip_pmd.c
> index 1181bed19..3bb7f6896 100644
> --- a/drivers/compress/octeontx/zip_pmd.c
> +++ b/drivers/compress/octeontx/zip_pmd.c
...
> +
> +/** Start device */
> +static int
> +zip_pmd_start(struct rte_compressdev *dev) {
> + if (dev == NULL)
> + return -1;
> + return 0;
> +}
Dev cannot be NULL at this stage, so no need to have this check.
> +
> +/** Stop device */
> +static void
> +zip_pmd_stop(__rte_unused struct rte_compressdev *dev) {
> +
> +}
> +
> +/** Close device */
> +static int
> +zip_pmd_close(struct rte_compressdev *dev) {
> + if (dev == NULL)
> + return -1;
Same as above.
> +
> + struct zip_vf *vf = (struct zip_vf *)dev->data->dev_private;
> +
> + for (int i = 0; dev->data->nb_queue_pairs; i++) {
> + if (dev->data->queue_pairs[i] != NULL)
> + /* qp not released, return error */
> + return -1;
All queue pairs should be released at this point, so not sure this check is
required.
If it is, don't forget the indentation.
> + }
> +
> + rte_mempool_free(vf->zip_mp);
> + return 0;
> +}
> +
>