rdma: fix rx CQ mask to calculate right next_cqe_index 56/38556/2
authorJieqiang Wang <jieqiang.wang@arm.com>
Wed, 22 Mar 2023 13:27:23 +0000 (21:27 +0800)
committerBeno�t Ganne <bganne@cisco.com>
Fri, 21 Apr 2023 09:13:43 +0000 (09:13 +0000)
Set the mask of calculating the next cqe index to the corresponding CQ
size instead of rxq size.

Type: fix
Signed-off-by: Jieqiang Wang <jieqiang.wang@arm.com>
Change-Id: I67494f029967af64051f51452eba1fd699984cd9

src/plugins/rdma/format.c

index e2bf225..b477c11 100644 (file)
@@ -281,7 +281,7 @@ format_rdma_rxq (u8 * s, va_list * args)
 
   if (rd->flags & RDMA_DEVICE_F_MLX5DV)
     {
-      u32 next_cqe_index = rxq->cq_ci & (rxq->size - 1);
+      u32 next_cqe_index = rxq->cq_ci & ((1 << rxq->log2_cq_size) - 1);
       s = format (s, "\n%Uwq: stride %u wqe-cnt %u",
                  format_white_space, indent + 2, rxq->wq_stride,
                  rxq->wqe_cnt);