Commit d2e0ccff authored by Wenpeng Liang's avatar Wenpeng Liang Committed by Jason Gunthorpe

RDMA/hns: Fix QP's resp incomplete assignment

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: 90ae0b57 ("RDMA/hns: Combine enable flags of qp")
Fixes: aba457ca ("RDMA/hns: Support owner mode doorbell")
Link: https://lore.kernel.org/r/1629985056-57004-3-git-send-email-liangwenpeng@huawei.comSigned-off-by: default avatarWenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent e788a3cd
...@@ -848,7 +848,6 @@ static int alloc_qp_db(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp, ...@@ -848,7 +848,6 @@ static int alloc_qp_db(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp,
goto err_out; goto err_out;
} }
hr_qp->en_flags |= HNS_ROCE_QP_CAP_SQ_RECORD_DB; 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)) { if (user_qp_has_rdb(hr_dev, init_attr, udata, resp)) {
...@@ -861,7 +860,6 @@ static int alloc_qp_db(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp, ...@@ -861,7 +860,6 @@ static int alloc_qp_db(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp,
goto err_sdb; goto err_sdb;
} }
hr_qp->en_flags |= HNS_ROCE_QP_CAP_RQ_RECORD_DB; hr_qp->en_flags |= HNS_ROCE_QP_CAP_RQ_RECORD_DB;
resp->cap_flags |= HNS_ROCE_QP_CAP_RQ_RECORD_DB;
} }
} else { } else {
if (hr_dev->pci_dev->revision >= PCI_REVISION_ID_HIP09) if (hr_dev->pci_dev->revision >= PCI_REVISION_ID_HIP09)
...@@ -1071,6 +1069,7 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev, ...@@ -1071,6 +1069,7 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev,
} }
if (udata) { if (udata) {
resp.cap_flags = hr_qp->en_flags;
ret = ib_copy_to_udata(udata, &resp, ret = ib_copy_to_udata(udata, &resp,
min(udata->outlen, sizeof(resp))); min(udata->outlen, sizeof(resp)));
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment