> -----Original Message-----
> From: Francis Kelly <fke...@nvidia.com>
> Sent: Friday, October 22, 2021 6:46 PM
> Subject: [PATCH 09/10] regex/mlx5: prevent QP double setup
> 
> From: Ady Agbarih <adypodo...@gmail.com>
> 
> When mlx5_regex_qp_setup() is called make sure
>  the provided QP is not already setup.
> 
> Signed-off-by: Ady Agbarih <adypodo...@gmail.com>
> ---
>  drivers/regex/mlx5/mlx5_regex_control.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/regex/mlx5/mlx5_regex_control.c 
> b/drivers/regex/mlx5/mlx5_regex_control.c
> index 52f66ecce8..17573c2e74 100644
> --- a/drivers/regex/mlx5/mlx5_regex_control.c
> +++ b/drivers/regex/mlx5/mlx5_regex_control.c
> @@ -207,6 +207,12 @@ mlx5_regex_qp_setup(struct rte_regexdev *dev, uint16_t 
> qp_ind,
>       uint16_t log_desc;
> 
>       qp = &priv->qps[qp_ind];
> +     if (qp->jobs) {
> +             DRV_LOG(ERR, "Attempting to setup QP a second time.");
> +             rte_errno = EINVAL;
> +             return -rte_errno;
> +     }
> +
>       qp->flags = cfg->qp_conf_flags;
>       log_desc = rte_log2_u32(cfg->nb_desc);
>       /*
> --
> 2.25.1

Acked-by: Ori Kam <or...@nvidia.com>
Best,
Ori


Reply via email to