> Implement enqueue and dequeue burst operations for stateful request
> support.
> 
> Signed-off-by: Nagadheeraj Rottela <rnagadhee...@marvell.com>
> ---
>  drivers/compress/nitrox/nitrox_comp.c        | 187 +++++--
>  drivers/compress/nitrox/nitrox_comp_reqmgr.c | 555 ++++++++++++++++---
>  drivers/compress/nitrox/nitrox_comp_reqmgr.h |  16 +-
>  3 files changed, 628 insertions(+), 130 deletions(-)
> 
> diff --git a/drivers/compress/nitrox/nitrox_comp.c
> b/drivers/compress/nitrox/nitrox_comp.c
> index cda0633929..ea7a43e432 100644
> --- a/drivers/compress/nitrox/nitrox_comp.c
> +++ b/drivers/compress/nitrox/nitrox_comp.c
> @@ -14,6 +14,8 @@
>  #include "nitrox_qp.h"
> 
>  #define COMPRESSDEV_NAME_NITROX_PMD  compress_nitrox
> +#define NITROX_COMP_WINDOW_SIZE_MIN 1
> +#define NITROX_COMP_WINDOW_SIZE_MAX 15
>  #define NITROX_COMP_LEVEL_LOWEST_START 1
>  #define NITROX_COMP_LEVEL_LOWEST_END 2
>  #define NITROX_COMP_LEVEL_LOWER_START 3
> @@ -49,10 +51,12 @@ static const struct rte_compressdev_capabilities
>                                     RTE_COMP_FF_SHAREABLE_PRIV_XFORM |
>                                     RTE_COMP_FF_OOP_SGL_IN_SGL_OUT |
>                                     RTE_COMP_FF_OOP_SGL_IN_LB_OUT |
> -                                   RTE_COMP_FF_OOP_LB_IN_SGL_OUT,
> +                                   RTE_COMP_FF_OOP_LB_IN_SGL_OUT |
> +                                   RTE_COMP_FF_STATEFUL_COMPRESSION |
> +
> RTE_COMP_FF_STATEFUL_DECOMPRESSION,
>               .window_size = {
> -                     .min = 1,
> -                     .max = 15,
> +                     .min = NITROX_COMP_WINDOW_SIZE_MIN,
> +                     .max = NITROX_COMP_WINDOW_SIZE_MAX,
>                       .increment = 1
>               },
>       },
> @@ -64,6 +68,8 @@ static int nitrox_comp_dev_configure(struct
> rte_compressdev *dev,
>  {
>       struct nitrox_comp_device *comp_dev = dev->data->dev_private;
>       struct nitrox_device *ndev = comp_dev->ndev;
> +     uint32_t xform_cnt;
> +     char name[RTE_MEMPOOL_NAMESIZE];
> 
>       if (config->nb_queue_pairs > ndev->nr_queues) {
>               NITROX_LOG(ERR, "Invalid queue pairs, max supported %d\n",
> @@ -71,21 +77,21 @@ static int nitrox_comp_dev_configure(struct
> rte_compressdev *dev,
>               return -EINVAL;
>       }
> 
> -     if (config->max_nb_priv_xforms) {
> -             char xform_name[RTE_MEMPOOL_NAMESIZE];
> -
> -             snprintf(xform_name, sizeof(xform_name), "%s_xform",
> -                      dev->data->name);
> -             comp_dev->xform_pool = rte_mempool_create(xform_name,
> -                             config->max_nb_priv_xforms,
> -                             sizeof(struct nitrox_comp_xform),
> -                             0, 0, NULL, NULL, NULL, NULL,
> -                             config->socket_id, 0);
> -             if (comp_dev->xform_pool == NULL) {
> -                     NITROX_LOG(ERR, "Failed to create xform pool, err
> %d\n",
> -                                rte_errno);
> -                     return -rte_errno;
> -             }
> +     xform_cnt = config->max_nb_priv_xforms + config->max_nb_streams;
> +     if (unlikely(xform_cnt == 0)) {
> +             NITROX_LOG(ERR, "Invalid configuration with 0 xforms\n");
> +             return -EINVAL;
> +     }
> +
> +     snprintf(name, sizeof(name), "%s_xform", dev->data->name);
> +     comp_dev->xform_pool = rte_mempool_create(name,
> +                     xform_cnt, sizeof(struct nitrox_comp_xform),
> +                     0, 0, NULL, NULL, NULL, NULL,
> +                     config->socket_id, 0);
> +     if (comp_dev->xform_pool == NULL) {
> +             NITROX_LOG(ERR, "Failed to create xform pool, err %d\n",
> +                        rte_errno);
> +             return -rte_errno;
>       }
> 
>       return 0;
> @@ -257,7 +263,7 @@ static int nitrox_comp_private_xform_create(struct
> rte_compressdev *dev,
>                                           void **private_xform)
>  {
>       struct nitrox_comp_device *comp_dev = dev->data->dev_private;
> -     struct nitrox_comp_xform *nitrox_xform;
> +     struct nitrox_comp_xform *nxform;

nitrox_xform is added in this patchset only.
It would be better to rename it in the original patch where it is introduced.
This would reduce the change in the subsequent patches.

Reply via email to