There is a bug here, will send another version
> -----Original Message-----
> From: Yuval Avnery <yuva...@mellanox.com>
> Sent: Tuesday, July 28, 2020 10:55 AM
> To: Ori Kam <or...@mellanox.com>
> Cc: Thomas Monjalon <tho...@monjalon.net>; dev@dpdk.org; Yuval
> Avnery <yuva...@mellanox.com>
> Subject: [PATCH v1] regex/mlx5: fix sq free check on enqueue
>
> Free sq check had a bug, causing jobs to overwrite.
>
> Fixes: 8740ba5fe57f ("regex/mlx5: add enqueue implementation")
> Signed-off-by: Yuval Avnery <yuva...@mellanox.com>
> Acked-by: Ori Kam <or...@mellanox.com>
> ---
> drivers/regex/mlx5/mlx5_regex_fastpath.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/regex/mlx5/mlx5_regex_fastpath.c
> b/drivers/regex/mlx5/mlx5_regex_fastpath.c
> index fc5a7fc..8dfa72c 100644
> --- a/drivers/regex/mlx5/mlx5_regex_fastpath.c
> +++ b/drivers/regex/mlx5/mlx5_regex_fastpath.c
> @@ -152,10 +152,7 @@ struct mlx5_regex_job {
>
> static inline int
> can_send(struct mlx5_regex_sq *sq) {
> - return unlikely(sq->ci > sq->pi) ?
> - MLX5_REGEX_MAX_WQE_INDEX + sq->pi - sq->ci <
> - sq_size_get(sq) :
> - sq->pi - sq->ci < sq_size_get(sq);
> + return ((sq->ci - sq->pi) & (sq_size_get(sq) - 1)) != 1;
> }
>
> static inline uint32_t
> --
> 1.8.3.1