[PATCH rdma-core 12/20] cxgb4: Move cxgb4 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/cxgb4/cxgb4-abi.h   | 80 +++++++++++++++----------------------------
 providers/cxgb4/verbs.c       |  2 +-
 3 files changed, 30 insertions(+), 53 deletions(-)

diff --git a/kernel-headers/CMakeLists.txt b/kernel-headers/CMakeLists.txt
index b884e68b1f20a0..035bc60b35dee5 100644
--- a/kernel-headers/CMakeLists.txt
+++ b/kernel-headers/CMakeLists.txt
@@ -55,6 +55,7 @@ endfunction()
 
 # Transform the kernel ABIs used by the providers
 rdma_kernel_provider_abi(
+  rdma/cxgb4-abi.h
   rdma/ib_user_verbs.h
   rdma/mlx4-abi.h
   rdma/mlx5-abi.h
diff --git a/providers/cxgb4/cxgb4-abi.h b/providers/cxgb4/cxgb4-abi.h
index f69894f73481e6..14fe8febc8e1c7 100644
--- a/providers/cxgb4/cxgb4-abi.h
+++ b/providers/cxgb4/cxgb4-abi.h
@@ -35,59 +35,35 @@
 #include <stdint.h>
 #include <infiniband/kern-abi.h>
 #include <rdma/cxgb4-abi.h>
+#include <kernel-abi/cxgb4-abi.h>
 
-struct uc4iw_alloc_ucontext_resp {
-	struct ib_uverbs_get_context_resp ibv_resp;
-	__u64 status_page_key;
-	__u32 status_page_size;
-	__u32 reserved;
-};
+/* compat for ABI version 0 */
+#define _c4iw_create_qp_resp_v0                                                \
+	{                                                                      \
+		__u64 sq_key;                                                  \
+		__u64 rq_key;                                                  \
+		__u64 sq_db_gts_key;                                           \
+		__u64 rq_db_gts_key;                                           \
+		__u64 sq_memsize;                                              \
+		__u64 rq_memsize;                                              \
+		__u32 sqid;                                                    \
+		__u32 rqid;                                                    \
+		__u32 sq_size;                                                 \
+		__u32 rq_size;                                                 \
+		__u32 qid_mask;                                                \
+	};
+struct c4iw_create_qp_resp_v0 _c4iw_create_qp_resp_v0;
+#define _STRUCT_c4iw_create_qp_resp_v0 struct _c4iw_create_qp_resp_v0
 
-struct uc4iw_alloc_pd_resp {
-	struct ib_uverbs_alloc_pd_resp ibv_resp;
-	uint32_t pdid;
-};
+DECLARE_DRV_CMD(uc4iw_alloc_pd, IB_USER_VERBS_CMD_ALLOC_PD,
+		empty, c4iw_alloc_pd_resp);
+DECLARE_DRV_CMD(uc4iw_create_cq, IB_USER_VERBS_CMD_CREATE_CQ,
+		empty, c4iw_create_cq_resp);
+DECLARE_DRV_CMD(uc4iw_create_qp, IB_USER_VERBS_CMD_CREATE_QP,
+		empty, c4iw_create_qp_resp);
+DECLARE_DRV_CMD(uc4iw_create_qp_v0, IB_USER_VERBS_CMD_CREATE_QP,
+		empty, c4iw_create_qp_resp_v0);
+DECLARE_DRV_CMD(uc4iw_alloc_ucontext, IB_USER_VERBS_CMD_GET_CONTEXT,
+		empty, c4iw_alloc_ucontext_resp);
 
-struct uc4iw_create_cq_resp {
-	struct ib_uverbs_create_cq_resp ibv_resp;
-	__u64 key;
-	__u64 gts_key;
-	__u64 memsize;
-	__u32 cqid;
-	__u32 size;
-	__u32 qid_mask;
-	__u32 reserved;
-};
-
-struct uc4iw_create_qp_resp_v0 {
-	struct ib_uverbs_create_qp_resp ibv_resp;
-	__u64 sq_key;
-	__u64 rq_key;
-	__u64 sq_db_gts_key;
-	__u64 rq_db_gts_key;
-	__u64 sq_memsize;
-	__u64 rq_memsize;
-	__u32 sqid;
-	__u32 rqid;
-	__u32 sq_size;
-	__u32 rq_size;
-	__u32 qid_mask;
-};
-
-struct uc4iw_create_qp_resp {
-	struct ib_uverbs_create_qp_resp ibv_resp;
-	__u64 ma_sync_key;
-	__u64 sq_key;
-	__u64 rq_key;
-	__u64 sq_db_gts_key;
-	__u64 rq_db_gts_key;
-	__u64 sq_memsize;
-	__u64 rq_memsize;
-	__u32 sqid;
-	__u32 rqid;
-	__u32 sq_size;
-	__u32 rq_size;
-	__u32 qid_mask;
-	__u32 flags;
-};
 #endif				/* IWCH_ABI_H */
diff --git a/providers/cxgb4/verbs.c b/providers/cxgb4/verbs.c
index b50a37b2771090..3c493697321b6b 100644
--- a/providers/cxgb4/verbs.c
+++ b/providers/cxgb4/verbs.c
@@ -303,7 +303,7 @@ static struct ibv_qp *create_qp_v0(struct ibv_pd *pd,
 				   struct ibv_qp_init_attr *attr)
 {
 	struct ibv_create_qp cmd;
-	struct uc4iw_create_qp_resp_v0 resp;
+	struct uc4iw_create_qp_v0_resp resp;
 	struct c4iw_qp *qhp;
 	struct c4iw_dev *dev = to_c4iw_dev(pd->context->device);
 	int ret;
-- 
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