regex/mlx5: fix overrun on enqueueing
authorYuval Avnery <yuvalav@mellanox.com>
Wed, 29 Jul 2020 02:14:51 +0000 (02:14 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 29 Jul 2020 14:49:58 +0000 (16:49 +0200)
commit76e821a303fd566c937f8e60c03a4f5803cc00ed
treed71c68d097938e37768e0f095159d62833052844
parent52c9a533b4179e9d16dfdc03410440c39b61e5af
regex/mlx5: fix overrun on enqueueing

When enqueueing a buffer the PMD check if there is room
in its send queue (SQ).
The current implementation did not take into account that
queue indices are wrapping around, which may result in
consumer index (sq->ci) can have bigger value than than
the producer index (sq->pi).

Fixes: 4d4e245ad637 ("regex/mlx5: support enqueue")

Signed-off-by: Yuval Avnery <yuvalav@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
drivers/regex/mlx5/mlx5_regex_fastpath.c