Inflight count calculation is updated to cover wrap around cases where
head can become smaller than tail.
Fixes: fd390896f4a3 ("crypto/cnxk: allow different cores in pending queue")
Cc: stable@dpdk.org
Reported-by: Kiran Kumar K <kirankumark@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
static __rte_always_inline uint64_t
pending_queue_infl_cnt(uint64_t head, uint64_t tail, const uint64_t mask)
{
- return (head - tail) & mask;
+ /*
+ * Mask is nb_desc - 1. Add nb_desc to head and mask to account for
+ * cases when tail > head, which happens during wrap around.
+ */
+ return ((head + mask + 1) - tail) & mask;
}
static __rte_always_inline uint64_t