Skip to content

Commit b4849e2

Browse files
Wenpeng Lianggregkh
authored andcommitted
RDMA/hns: Fix QP's resp incomplete assignment
[ 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>
1 parent e91077c commit b4849e2

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎drivers/infiniband/hw/hns/hns_roce_qp.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,6 @@ static int alloc_qp_db(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp,
740740
goto err_out;
741741
}
742742
hr_qp->en_flags |= HNS_ROCE_QP_CAP_SQ_RECORD_DB;
743-
resp->cap_flags |= HNS_ROCE_QP_CAP_SQ_RECORD_DB;
744743
}
745744

746745
if (user_qp_has_rdb(hr_dev, init_attr, udata, resp)) {
@@ -752,7 +751,6 @@ static int alloc_qp_db(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp,
752751
goto err_sdb;
753752
}
754753
hr_qp->en_flags |= HNS_ROCE_QP_CAP_RQ_RECORD_DB;
755-
resp->cap_flags |= HNS_ROCE_QP_CAP_RQ_RECORD_DB;
756754
}
757755
} else {
758756
/* QP doorbell register address */
@@ -959,6 +957,7 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev,
959957
}
960958

961959
if (udata) {
960+
resp.cap_flags = hr_qp->en_flags;
962961
ret = ib_copy_to_udata(udata, &resp,
963962
min(udata->outlen, sizeof(resp)));
964963
if (ret) {

0 commit comments

Comments
 (0)