diff mbox series

[for-next,1/4] RDMA/hns: Export hardware capability flags to userspace

Message ID 1597668344-48575-2-git-send-email-liweihang@huawei.com (mailing list archive)
State Superseded
Headers show
Series RDMA/hns: Extend some capabilities for HIP09 | expand

Commit Message

Weihang Li Aug. 17, 2020, 12:45 p.m. UTC
From: Xi Wang <wangxi11@huawei.com>

The libhns in userspace for HIP09 will use the hardware's capability to
enable some features. So export the hardware capablility flags to userspace
by reusing the reserved fields in structure
"hns_roce_ib_alloc_ucontext_resp".

Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
---
 drivers/infiniband/hw/hns/hns_roce_main.c | 1 +
 include/uapi/rdma/hns-abi.h               | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
index 5907cfd..98945df 100644
--- a/drivers/infiniband/hw/hns/hns_roce_main.c
+++ b/drivers/infiniband/hw/hns/hns_roce_main.c
@@ -313,6 +313,7 @@  static int hns_roce_alloc_ucontext(struct ib_ucontext *uctx,
 		return -EAGAIN;
 
 	resp.qp_tab_size = hr_dev->caps.num_qps;
+	resp.cap_flags = (u32)hr_dev->caps.flags;
 
 	ret = hns_roce_uar_alloc(hr_dev, &context->uar);
 	if (ret)
diff --git a/include/uapi/rdma/hns-abi.h b/include/uapi/rdma/hns-abi.h
index eb76b38..5c38758 100644
--- a/include/uapi/rdma/hns-abi.h
+++ b/include/uapi/rdma/hns-abi.h
@@ -73,7 +73,7 @@  struct hns_roce_ib_create_qp_resp {
 
 struct hns_roce_ib_alloc_ucontext_resp {
 	__u32	qp_tab_size;
-	__u32	reserved;
+	__u32	cap_flags;
 };
 
 struct hns_roce_ib_alloc_pd_resp {