crypto/mlx5: fix queue indexing
authorTal Shnaiderman <talshn@nvidia.com>
Mon, 13 Sep 2021 14:02:24 +0000 (17:02 +0300)
committerAkhil Goyal <gakhil@marvell.com>
Tue, 28 Sep 2021 06:43:57 +0000 (08:43 +0200)
commit427ec3346d2902ae8f3c5ad5f39c10fe07a66ffb
tree7d41bca86377fc744eaec22e8d3363ca2058d88a
parentc9902a15bd005b6d4fe072cf7b60fe4ee679155f
crypto/mlx5: fix queue indexing

The crypto QP consumer (ci) and producer (pi) indexes are increased
with each successful enqueue/dequeue operations.

However the QP pi index is calculated with a wraparound the number
of elements while the QP ci does not.

This is causing incorrect engine calculation for encqueued WQ values
(wq->pi - wq->ci) and eventually the device stops accepting new enqueue
operations.

Fixed by removing the wraparound on QP pi and using a temp calculation
where wraparound values are needed.

Fixes: 8e196c08ab53 ("crypto/mlx5: support enqueue/dequeue operations")
Cc: stable@dpdk.org
Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
drivers/crypto/mlx5/mlx5_crypto.c