[PATCH rdma-core 16/20] hns: Move hns to exclusively use the kernel uapi headers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>

Using the driver support macros we can now directly create the
required driver structs automatically.

Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
---
 kernel-headers/CMakeLists.txt  |  1 +
 providers/hns/hns_roce_u_abi.h | 44 +++++++++++-------------------------------
 2 files changed, 12 insertions(+), 33 deletions(-)

diff --git a/kernel-headers/CMakeLists.txt b/kernel-headers/CMakeLists.txt
index 46147f5827c490..8f41b6e98b54f5 100644
--- a/kernel-headers/CMakeLists.txt
+++ b/kernel-headers/CMakeLists.txt
@@ -56,6 +56,7 @@ endfunction()
 # Transform the kernel ABIs used by the providers
 rdma_kernel_provider_abi(
   rdma/cxgb4-abi.h
+  rdma/hns-abi.h
   rdma/ib_user_verbs.h
   rdma/mlx4-abi.h
   rdma/mlx5-abi.h
diff --git a/providers/hns/hns_roce_u_abi.h b/providers/hns/hns_roce_u_abi.h
index 251a5c920a3557..09a920ec71ec1e 100644
--- a/providers/hns/hns_roce_u_abi.h
+++ b/providers/hns/hns_roce_u_abi.h
@@ -34,38 +34,16 @@
 #define _HNS_ROCE_U_ABI_H
 
 #include <infiniband/kern-abi.h>
-
-struct hns_roce_alloc_ucontext_resp {
-	struct ib_uverbs_get_context_resp	ibv_resp;
-	__u32				qp_tab_size;
-};
-
-struct hns_roce_alloc_pd_resp {
-	struct ib_uverbs_alloc_pd_resp	ibv_resp;
-	__u32				pdn;
-	__u32				reserved;
-};
-
-struct hns_roce_create_cq {
-	struct ibv_create_cq		ibv_cmd;
-	__u64				buf_addr;
-	__u64				db_addr;
-};
-
-struct hns_roce_create_cq_resp {
-	struct ib_uverbs_create_cq_resp	ibv_resp;
-	__u32				cqn;
-	__u32				reserved;
-};
-
-struct hns_roce_create_qp {
-	struct ibv_create_qp		ibv_cmd;
-	__u64				buf_addr;
-	__u64				db_addr;
-	__u8				log_sq_bb_count;
-	__u8				log_sq_stride;
-	__u8				sq_no_prefetch;
-	__u8				reserved[5];
-};
+#include <rdma/hns-abi.h>
+#include <kernel-abi/hns-abi.h>
+
+DECLARE_DRV_CMD(hns_roce_alloc_pd, IB_USER_VERBS_CMD_ALLOC_PD,
+		empty, hns_roce_ib_alloc_pd_resp);
+DECLARE_DRV_CMD(hns_roce_create_cq, IB_USER_VERBS_CMD_CREATE_CQ,
+		hns_roce_ib_create_cq, hns_roce_ib_create_cq_resp);
+DECLARE_DRV_CMD(hns_roce_create_qp, IB_USER_VERBS_CMD_CREATE_QP,
+		hns_roce_ib_create_qp, empty);
+DECLARE_DRV_CMD(hns_roce_alloc_ucontext, IB_USER_VERBS_CMD_GET_CONTEXT,
+		empty, hns_roce_ib_alloc_ucontext_resp);
 
 #endif /* _HNS_ROCE_U_ABI_H */
-- 
2.16.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux