Skip to content

Commit

Permalink
RDMA/hns: Fix QP's resp incomplete assignment
Browse files Browse the repository at this point in the history
[ Upstream commit d2e0ccf ]

The resp passed to the user space represents the enable flag of qp,
incomplete assignment will cause some features of the user space to be
disabled.

Fixes: 90ae0b5 ("RDMA/hns: Combine enable flags of qp")
Fixes: aba457c ("RDMA/hns: Support owner mode doorbell")
Link: https://lore.kernel.org/r/1629985056-57004-3-git-send-email-liangwenpeng@huawei.com
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Wenpeng Liang authored and gregkh committed Sep 18, 2021
1 parent 6103546 commit bc533ea
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/infiniband/hw/hns/hns_roce_qp.c
Expand Up @@ -835,7 +835,6 @@ static int alloc_qp_db(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp,
goto err_out;
}
hr_qp->en_flags |= HNS_ROCE_QP_CAP_SQ_RECORD_DB;
resp->cap_flags |= HNS_ROCE_QP_CAP_SQ_RECORD_DB;
}

if (user_qp_has_rdb(hr_dev, init_attr, udata, resp)) {
Expand All @@ -848,7 +847,6 @@ static int alloc_qp_db(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp,
goto err_sdb;
}
hr_qp->en_flags |= HNS_ROCE_QP_CAP_RQ_RECORD_DB;
resp->cap_flags |= HNS_ROCE_QP_CAP_RQ_RECORD_DB;
}
} else {
if (hr_dev->pci_dev->revision >= PCI_REVISION_ID_HIP09)
Expand Down Expand Up @@ -1060,6 +1058,7 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev,
}

if (udata) {
resp.cap_flags = hr_qp->en_flags;
ret = ib_copy_to_udata(udata, &resp,
min(udata->outlen, sizeof(resp)));
if (ret) {
Expand Down

0 comments on commit bc533ea

Please sign in to comment.