Skip to content

Commit d2e0ccf

Browse files
Wenpeng Liangjgunthorpe
authored andcommitted
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: 90ae0b5 ("RDMA/hns: Combine enable flags of qp") Fixes: aba457c ("RDMA/hns: Support owner mode doorbell") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wenpeng Liang <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent e788a3c commit d2e0ccf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/infiniband/hw/hns/hns_roce_qp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,6 @@ static int alloc_qp_db(struct hns_roce_dev *hr_dev, struct hns_roce_qp *hr_qp,
848848
goto err_out;
849849
}
850850
hr_qp->en_flags |= HNS_ROCE_QP_CAP_SQ_RECORD_DB;
851-
resp->cap_flags |= HNS_ROCE_QP_CAP_SQ_RECORD_DB;
852851
}
853852

854853
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,
861860
goto err_sdb;
862861
}
863862
hr_qp->en_flags |= HNS_ROCE_QP_CAP_RQ_RECORD_DB;
864-
resp->cap_flags |= HNS_ROCE_QP_CAP_RQ_RECORD_DB;
865863
}
866864
} else {
867865
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,
10711069
}
10721070

10731071
if (udata) {
1072+
resp.cap_flags = hr_qp->en_flags;
10741073
ret = ib_copy_to_udata(udata, &resp,
10751074
min(udata->outlen, sizeof(resp)));
10761075
if (ret) {

0 commit comments

Comments
 (0)