Skip to content

Commit

Permalink
RDMA/hns: Fix wrong assignment of SRQ's max_wr
Browse files Browse the repository at this point in the history
srq's attribute max_wr should be 1 less than the total count of wqe.

Fixes: ffb1308 ("RDMA/hns: Move SRQ code to the reasonable place")
Link: https://lore.kernel.org/r/1588931159-56875-5-git-send-email-liweihang@huawei.com
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Weihang Li authored and Jason Gunthorpe committed May 19, 2020
1 parent 053c0ac commit 6968aeb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/hns/hns_roce_hw_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -5044,8 +5044,8 @@ static int hns_roce_v2_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *attr)
SRQC_BYTE_8_SRQ_LIMIT_WL_S);

attr->srq_limit = limit_wl;
attr->max_wr = srq->wqe_cnt;
attr->max_sge = srq->max_gs;
attr->max_wr = srq->wqe_cnt - 1;
attr->max_sge = srq->max_gs;

memcpy(srq_context, mailbox->buf, sizeof(*srq_context));

Expand Down

0 comments on commit 6968aeb

Please sign in to comment.