提交 324b5bec 编写于 作者: X Xi Wang 提交者: Xie XiuQi

RDMA/hns: fix mtr search failure when wqe offset is invalid

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

Currently, the rq offset is invalid when the rq depth is zero
and sq depth not zero, this will lead the mtr searching fail.

This patch fixes it by adding the invalid wqe offset checking
when an empty mtt is found.

Fixes: 5c42b537063d ("RDMA/hns:Fix bug when wqe num is larger than 16384")

Feature or Bugfix:Bugfix
Signed-off-by: Nwangxi <wangxi11@huawei.com>
Signed-off-by: NXi Wang <wangxi11@huawei.com>
Reviewed-by: Noulijun <oulijun@huawei.com>
Reviewed-by: Nliuyixian <liuyixian@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 0873f54e
......@@ -3987,6 +3987,9 @@ static bool check_wqe_rq_mtt_count(struct hns_roce_dev *hr_dev,
{
struct device *dev = hr_dev->dev;
if (hr_qp->rq.wqe_cnt < 1)
return true;
if (mtt_cnt < 1) {
dev_err(dev, "qp(0x%lx) rqwqe buf ba find failed\n",
hr_qp->qpn);
......@@ -4268,7 +4271,7 @@ static int modify_qp_rtr_to_rts(struct ib_qp *ibqp,
return -EINVAL;
}
if (hr_qp->sge.offset) {
if (hr_qp->sge.sge_cnt > 0) {
page_size = 1 << (hr_dev->caps.mtt_buf_pg_sz + PAGE_SHIFT);
count = hns_roce_mtr_find(hr_dev, &hr_qp->mtr,
hr_qp->sge.offset / page_size,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册