Message ID | 1520069370-129426-5-git-send-email-oulijun@huawei.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
diff --git a/providers/hns/hns_roce_u_hw_v1.c b/providers/hns/hns_roce_u_hw_v1.c index 013a2b4..1d256aa 100644 --- a/providers/hns/hns_roce_u_hw_v1.c +++ b/providers/hns/hns_roce_u_hw_v1.c @@ -411,7 +411,7 @@ static int hns_roce_u_v1_poll_cq(struct ibv_cq *ibvcq, int ne, if (npolled) { if (dev->hw_version == HNS_ROCE_HW_VER1) { - *cq->set_ci_db = (unsigned short)(cq->cons_index & + *cq->set_ci_db = (cq->cons_index & ((cq->cq_depth << 1) - 1)); mmio_ordered_writes_hack(); }
The use of short type causes the value is truncated when configured CQ ci, as a result, the hardware get the different value and the CQ overflow. Signed-off-by: Lijun Ou <oulijun@huawei.com> --- providers/hns/hns_roce_u_hw_v1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)