*/
#define IBV_DEVICE_LIBRARY_EXTENSION rdmav2
+enum verbs_xrcd_mask {
+ IBV_XRCD_HANDLE = 1 << 0,
+ IBV_XRCD_RESERVED = 1 << 1
+};
+
+struct verbs_xrcd {
+ struct ibv_xrcd xrcd;
+ uint64_t comp_mask;
+ uint32_t handle;
+};
+
typedef struct ibv_device *(*ibv_driver_init_func)(const char *uverbs_sys_path,
int abi_version);
struct ibv_alloc_pd *cmd, size_t cmd_size,
struct ibv_alloc_pd_resp *resp, size_t resp_size);
int ibv_cmd_dealloc_pd(struct ibv_pd *pd);
-int ibv_cmd_open_xrcd(struct ibv_context *context, struct ibv_xrcd *xrcd,
+int ibv_cmd_open_xrcd(struct verbs_context *context, struct verbs_xrcd *xrcd,
int fd, int oflags,
struct ibv_open_xrcd *cmd, size_t cmd_size,
struct ibv_open_xrcd_resp *resp, size_t resp_size);
-int ibv_cmd_close_xrcd(struct ibv_xrcd *xrcd);
+int ibv_cmd_close_xrcd(struct verbs_xrcd *xrcd);
#define IBV_CMD_REG_MR_HAS_RESP_PARAMS
int ibv_cmd_reg_mr(struct ibv_pd *pd, void *addr, size_t length,
uint64_t hca_va, int access,
uint32_t handle;
};
-enum ibv_xrcd_mask {
- IBV_XRCD_CONTEXT = 1 << 0,
- IBV_XRCD_HANDLE = 1 << 1,
- IBV_XRCD_RESERVED = 1 << 2
-};
-
struct ibv_xrcd {
- uint64_t comp_mask;
struct ibv_context *context;
- uint32_t handle;
};
enum ibv_rereg_mr_flags {
int (*drv_new_func1) (); new corresponding provider call of func1
int (*lib_new_func1) (); New library call func1
*/
- struct ibv_xrcd * (*open_xrcd)(struct ibv_context *context,
+ struct verbs_xrcd * (*open_xrcd)(struct verbs_context *context,
int fd, int oflags);
- int (*close_xrcd)(struct ibv_xrcd *xrcd);
+ int (*close_xrcd)(struct verbs_xrcd *xrcd);
size_t sz; /* Set by library on struct allocation,must be
* located right before struct ibv_context
*/
return 0;
}
-int ibv_cmd_open_xrcd(struct ibv_context *context, struct ibv_xrcd *xrcd,
+int ibv_cmd_open_xrcd(struct verbs_context *context, struct verbs_xrcd *xrcd,
int fd, int oflags,
struct ibv_open_xrcd *cmd, size_t cmd_size,
struct ibv_open_xrcd_resp *resp, size_t resp_size)
cmd->fd = fd;
cmd->oflags = oflags;
- if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
+ if (write(context->context.cmd_fd, cmd, cmd_size) != cmd_size)
return errno;
VALGRIND_MAKE_MEM_DEFINED(resp, resp_size);
- xrcd->comp_mask = IBV_XRCD_CONTEXT | IBV_XRCD_HANDLE;
- xrcd->context = context;
+ xrcd->xrcd.context = context;
+ xrcd->comp_mask = IBV_XRCD_HANDLE;
xrcd->handle = resp->xrcd_handle;
return 0;
}
-int ibv_cmd_close_xrcd(struct ibv_xrcd *xrcd)
+int ibv_cmd_close_xrcd(struct verbs_xrcd *xrcd)
{
struct ibv_close_xrcd cmd;
IBV_INIT_CMD(&cmd, sizeof cmd, CLOSE_XRCD);
cmd.xrcd_handle = xrcd->handle;
- if (write(xrcd->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
+ if (write(xrcd->xrcd.context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
return errno;
return 0;