diff mbox

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

Message ID 20180320211850.10090-17-jgg@ziepe.ca (mailing list archive)
State Not Applicable
Headers show

Commit Message

Jason Gunthorpe March 20, 2018, 9:18 p.m. UTC
From: Jason Gunthorpe <jgg@mellanox.com>

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

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

Patch

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 */