@@ -58,6 +58,7 @@ rdma_kernel_provider_abi(
rdma/ib_user_verbs.h
rdma/mlx4-abi.h
rdma/mlx5-abi.h
+ rdma/nes-abi.h
rdma/qedr-abi.h
rdma/rdma_user_rxe.h
)
@@ -36,66 +36,17 @@
#include <infiniband/kern-abi.h>
#include <rdma/nes-abi.h>
-
-struct nes_get_context {
- struct ibv_get_context cmd;
- __u32 reserved32;
- __u8 userspace_ver;
- __u8 reserved8[3];
-};
-
-
-struct nes_ualloc_ucontext_resp {
- struct ib_uverbs_get_context_resp ibv_resp;
- __u32 max_pds; /* maximum pds allowed for this user process */
- __u32 max_qps; /* maximum qps allowed for this user process */
- __u32 wq_size; /* defines the size of the WQs (sq+rq) allocated to the mmaped area */
- __u8 virtwq;
- __u8 kernel_ver;
- __u8 reserved[2];
-};
-
-struct nes_ualloc_pd_resp {
- struct ib_uverbs_alloc_pd_resp ibv_resp;
- __u32 pd_id;
- __u32 db_index;
-};
-
-struct nes_ucreate_cq {
- struct ibv_create_cq ibv_cmd;
- __u64 user_cq_buffer;
- __u32 mcrqf;
- __u8 reserved[4];
-};
-
-struct nes_ucreate_cq_resp {
- struct ib_uverbs_create_cq_resp ibv_resp;
- __u32 cq_id;
- __u32 cq_size;
- __u32 mmap_db_index;
- __u32 reserved;
-};
-
-struct nes_ureg_mr {
- struct ibv_reg_mr ibv_cmd;
- __u32 reg_type; /* indicates if id is memory, QP or CQ */
- __u32 reserved;
-};
-
-struct nes_ucreate_qp {
- struct ibv_create_qp ibv_cmd;
- __u64 user_sq_buffer;
- __u64 user_qp_buffer;
-};
-
-struct nes_ucreate_qp_resp {
- struct ib_uverbs_create_qp_resp ibv_resp;
- __u32 qp_id;
- __u32 actual_sq_size;
- __u32 actual_rq_size;
- __u32 mmap_sq_db_index;
- __u32 mmap_rq_db_index;
- __u32 nes_drv_opt;
-};
+#include <kernel-abi/nes-abi.h>
+
+DECLARE_DRV_CMD(nes_ualloc_pd, IB_USER_VERBS_CMD_ALLOC_PD,
+ empty, nes_alloc_pd_resp);
+DECLARE_DRV_CMD(nes_ucreate_cq, IB_USER_VERBS_CMD_CREATE_CQ,
+ nes_create_cq_req, nes_create_cq_resp);
+DECLARE_DRV_CMD(nes_ucreate_qp, IB_USER_VERBS_CMD_CREATE_QP,
+ nes_create_qp_req, nes_create_qp_resp);
+DECLARE_DRV_CMD(nes_get_context, IB_USER_VERBS_CMD_GET_CONTEXT,
+ nes_alloc_ucontext_req, nes_alloc_ucontext_resp);
+DECLARE_DRV_CMD(nes_ureg_mr, IB_USER_VERBS_CMD_REG_MR,
+ nes_mem_reg_req, empty);
#endif /* nes_ABI_H */
@@ -103,7 +103,7 @@ static struct verbs_context *nes_ualloc_context(struct ibv_device *ibdev,
struct ibv_pd *ibv_pd;
struct nes_uvcontext *nesvctx;
struct nes_get_context cmd;
- struct nes_ualloc_ucontext_resp resp;
+ struct nes_get_context_resp resp;
char value[16];
uint32_t nes_drv_opt = 0;
@@ -127,7 +127,7 @@ struct ibv_pd *nes_ualloc_pd(struct ibv_context *context)
return NULL;
}
nesupd->pd_id = resp.pd_id;
- nesupd->db_index = resp.db_index;
+ nesupd->db_index = resp.mmap_db_index;
nesupd->udoorbell = mmap(NULL, page_size, PROT_WRITE | PROT_READ, MAP_SHARED,
context->cmd_fd, nesupd->db_index * page_size);
@@ -967,7 +967,7 @@ static int nes_vmapped_qp(struct nes_uqp *nesuqp, struct ibv_pd *pd, struct ibv_
}
// So now the memory has been registered..
memset (&cmd, 0, sizeof(cmd) );
- cmd.user_sq_buffer = (__u64) ((uintptr_t) nesuqp->sq_vbase);
+ cmd.user_wqe_buffers = (__u64) ((uintptr_t) nesuqp->sq_vbase);
cmd.user_qp_buffer = (__u64) ((uintptr_t) nesuqp);
ret = ibv_cmd_create_qp(pd, &nesuqp->ibv_qp, attr, &cmd.ibv_cmd, sizeof cmd,
&resp->ibv_resp, sizeof (struct nes_ucreate_qp_resp) );