@@ -156,7 +156,7 @@ int ibv_cmd_query_device_ex(struct ibv_context *context,
return EINVAL;
IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size,
- QUERY_DEVICE_EX, resp, resp_core_size,
+ QUERY_DEVICE, resp, resp_core_size,
resp_size);
cmd->comp_mask = 0;
cmd->reserved = 0;
@@ -527,7 +527,7 @@ int ibv_cmd_create_cq_ex(struct ibv_context *context,
int err;
memset(cmd, 0, cmd_core_size);
- IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, CREATE_CQ_EX, resp,
+ IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, CREATE_CQ, resp,
resp_core_size, resp_size);
if (cq_attr->comp_mask & ~(IBV_CQ_INIT_ATTR_MASK_RESERVED - 1))
@@ -993,7 +993,7 @@ int ibv_cmd_create_qp_ex2(struct ibv_context *context,
memset(cmd, 0, cmd_core_size);
- IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, CREATE_QP_EX, resp,
+ IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, CREATE_QP, resp,
resp_core_size, resp_size);
err = create_qp_ex_common(qp, qp_attr, vxrcd, &cmd->base);
@@ -1389,7 +1389,7 @@ int ibv_cmd_modify_qp_ex(struct ibv_qp *qp, struct ibv_qp_attr *attr,
response_length) + sizeof(resp->response_length))
return EINVAL;
- IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, MODIFY_QP_EX,
+ IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, MODIFY_QP,
resp, resp_core_size, resp_size);
copy_modify_qp_fields(qp, attr, attr_mask, &cmd->base);
@@ -83,12 +83,20 @@ struct verbs_ex_private {
(cmd)->response = (uintptr_t) (out); \
} while (0)
+static inline uint32_t _cmd_ex(uint32_t cmd)
+{
+ return (IB_USER_VERBS_CMD_FLAG_EXTENDED
+ << IB_USER_VERBS_CMD_FLAGS_SHIFT) |
+ cmd;
+}
+
#define IBV_INIT_CMD_RESP_EX_V(cmd, cmd_size, size, opcode, out, resp_size,\
outsize) \
do { \
size_t c_size = cmd_size - sizeof(struct ex_hdr); \
if (abi_ver > 2) \
- (cmd)->hdr.command = IB_USER_VERBS_CMD_##opcode; \
+ (cmd)->hdr.command = \
+ _cmd_ex(IB_USER_VERBS_EX_CMD_##opcode); \
else \
(cmd)->hdr.command = \
IB_USER_VERBS_CMD_##opcode##_V2; \
@@ -53,32 +53,6 @@
#define IB_USER_VERBS_MIN_ABI_VERSION 3
#define IB_USER_VERBS_MAX_ABI_VERSION 6
-/* use this mask for creating extended commands */
-#define IB_USER_VERBS_CMD_EXTENDED_MASK \
- (IB_USER_VERBS_CMD_FLAG_EXTENDED << \
- IB_USER_VERBS_CMD_FLAGS_SHIFT)
-
-
-enum {
- IB_USER_VERBS_CMD_QUERY_DEVICE_EX = IB_USER_VERBS_CMD_EXTENDED_MASK |
- IB_USER_VERBS_CMD_QUERY_DEVICE,
- IB_USER_VERBS_CMD_CREATE_QP_EX = IB_USER_VERBS_CMD_EXTENDED_MASK |
- IB_USER_VERBS_CMD_CREATE_QP,
- IB_USER_VERBS_CMD_CREATE_CQ_EX = IB_USER_VERBS_CMD_EXTENDED_MASK |
- IB_USER_VERBS_CMD_CREATE_CQ,
- IB_USER_VERBS_CMD_MODIFY_QP_EX = IB_USER_VERBS_CMD_EXTENDED_MASK |
- IB_USER_VERBS_CMD_MODIFY_QP,
- IB_USER_VERBS_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_EXTENDED_MASK +
- IB_USER_VERBS_CMD_THRESHOLD,
- IB_USER_VERBS_CMD_DESTROY_FLOW,
- IB_USER_VERBS_CMD_CREATE_WQ,
- IB_USER_VERBS_CMD_MODIFY_WQ,
- IB_USER_VERBS_CMD_DESTROY_WQ,
- IB_USER_VERBS_CMD_CREATE_RWQ_IND_TBL,
- IB_USER_VERBS_CMD_DESTROY_RWQ_IND_TBL,
- IB_USER_VERBS_CMD_MODIFY_CQ,
-};
-
/*
* Make sure that all structs defined in this file remain laid out so
* that they pack the same way on 32-bit and 64-bit architectures (to