diff options
author | Weihang Li <liweihang@huawei.com> | 2020-05-08 17:45:54 +0800 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2020-05-19 20:54:58 -0300 |
commit | 6968aeb5aa64a46175f408fa91e49c19e9558428 (patch) | |
tree | 195da79ad247f4b5128d052739da9730f14baa16 /drivers/infiniband/hw/hns | |
parent | 053c0acf52edf97cae7d53c9f249f7c2eb565ed9 (diff) | |
download | lwn-6968aeb5aa64a46175f408fa91e49c19e9558428.tar.gz lwn-6968aeb5aa64a46175f408fa91e49c19e9558428.zip |
RDMA/hns: Fix wrong assignment of SRQ's max_wr
srq's attribute max_wr should be 1 less than the total count of wqe.
Fixes: ffb1308b88b6 ("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>
Diffstat (limited to 'drivers/infiniband/hw/hns')
-rw-r--r-- | drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 96a5ff565b2f..155c658ed3eb 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -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)); |