diff mbox

[rdma-core,09/20] nes: Use kernel uapi headers

Message ID 20180320211850.10090-10-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>

Remove duplicated loose definitions and one un-used struct

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
---
 providers/nes/nes-abi.h    | 17 +----------------
 providers/nes/nes_uverbs.c |  6 +++---
 2 files changed, 4 insertions(+), 19 deletions(-)
diff mbox

Patch

diff --git a/providers/nes/nes-abi.h b/providers/nes/nes-abi.h
index 3c3362a2ec5faf..54e8708cbf6471 100644
--- a/providers/nes/nes-abi.h
+++ b/providers/nes/nes-abi.h
@@ -35,9 +35,7 @@ 
 #define nes_ABI_H
 
 #include <infiniband/kern-abi.h>
-
-#define NES_ABI_USERSPACE_VER 2
-#define NES_ABI_KERNEL_VER 2
+#include <rdma/nes-abi.h>
 
 struct nes_get_context {
 	struct ibv_get_context cmd;
@@ -78,12 +76,6 @@  struct nes_ucreate_cq_resp {
 	__u32 reserved;
 };
 
-enum nes_umemreg_type {
-	NES_UMEMREG_TYPE_MEM = 0x0000,
-	NES_UMEMREG_TYPE_QP = 0x0001,
-	NES_UMEMREG_TYPE_CQ = 0x0002,
-};
-
 struct nes_ureg_mr {
 	struct ibv_reg_mr ibv_cmd;
 	__u32 reg_type;	/* indicates if id is memory, QP or CQ */
@@ -106,11 +98,4 @@  struct nes_ucreate_qp_resp {
 	__u32 nes_drv_opt;
 };
 
-struct nes_cqe {
-	__u32 header;
-	__u32 len;
-	__u32 wrid_hi_stag;
-	__u32 wrid_low_msn;
-};
-
 #endif			/* nes_ABI_H */
diff --git a/providers/nes/nes_uverbs.c b/providers/nes/nes_uverbs.c
index a3bd65f6c743f6..be3b057c5bf7b4 100644
--- a/providers/nes/nes_uverbs.c
+++ b/providers/nes/nes_uverbs.c
@@ -176,7 +176,7 @@  struct ibv_mr *nes_ureg_mr(struct ibv_pd *pd, void *addr,
 	if (!mr)
 		return NULL;
 
-	cmd.reg_type = NES_UMEMREG_TYPE_MEM;
+	cmd.reg_type = IWNES_MEMREG_TYPE_MEM;
 	if (ibv_cmd_reg_mr(pd, addr, length, (uintptr_t) addr,
 			access, mr, &cmd.ibv_cmd, sizeof cmd,
 			&resp, sizeof resp)) {
@@ -239,7 +239,7 @@  struct ibv_cq *nes_ucreate_cq(struct ibv_context *context, int cqe,
 		goto err;
 
 	/* Register the memory for the CQ */
-	reg_mr_cmd.reg_type = NES_UMEMREG_TYPE_CQ;
+	reg_mr_cmd.reg_type = IWNES_MEMREG_TYPE_CQ;
 
 	ret = ibv_cmd_reg_mr(&nesvctx->nesupd->ibv_pd, (void *)nesucq->cqes,
 			(nesucq->size*sizeof(struct nes_hw_cqe)),
@@ -951,7 +951,7 @@  static int nes_vmapped_qp(struct nes_uqp *nesuqp, struct ibv_pd *pd, struct ibv_
 	nesuqp->rq_vbase = (struct nes_hw_qp_wqe *) (((char *) nesuqp->sq_vbase) +
 			   (nesuqp->sq_size * sizeof(struct nes_hw_qp_wqe)));
 
-	reg_mr_cmd.reg_type = NES_UMEMREG_TYPE_QP;
+	reg_mr_cmd.reg_type = IWNES_MEMREG_TYPE_QP;
 
 	//fprintf(stderr, PFX "qp_rq_vbase = %p qp_sq_vbase=%p reg_mr = %p\n",
 	//		nesuqp->rq_vbase, nesuqp->sq_vbase, &nesuqp->mr);