From d9856486f90476cf24d2b8ef655aeb264e28880c Mon Sep 17 00:00:00 2001 From: Xi Wang Date: Mon, 15 Apr 2019 20:10:30 +0800 Subject: [PATCH] RDMA/hns: Fix srq initialization failure problem driver inclusion category: bugfix bugzilla: NA CVE: NA Currently, when the qp use the srq, the rq mtt count checking will fail. This patch fixes this issue by ignoring the rq mtt count checking. Fixes: 5c42b537063d ("RDMA/hns:Fix bug when wqe num is larger than 16384") Signed-off-by: wangxi Signed-off-by: Xi Wang Reviewed-by: oulijun Reviewed-by: liuyixian Reviewed-by: Xie XiuQi Signed-off-by: Yang Yingliang --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 5 +++-- 1 file changed, 3 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 4de48ba4629f..38ca817f6f63 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -3989,8 +3989,9 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp, count = hns_roce_mtr_find(hr_dev, &hr_qp->mtr, hr_qp->rq.offset / page_size, mtts, MTT_MIN_COUNT, &wqe_sge_ba); - if (!check_wqe_rq_mtt_count(hr_dev, hr_qp, count, page_size)) - return -EINVAL; + if (!ibqp->srq) + if (!check_wqe_rq_mtt_count(hr_dev, hr_qp, count, page_size)) + return -EINVAL; /* Search IRRL's mtts */ mtts_2 = hns_roce_table_find(hr_dev, &hr_dev->qp_table.irrl_table, -- GitLab