Lines Matching refs:cmd

47 int ibv_cmd_get_context(struct ibv_context *context, struct ibv_get_context *cmd,
54 IBV_INIT_CMD_RESP(cmd, cmd_size, GET_CONTEXT, resp, resp_size);
56 if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
116 struct ibv_query_device *cmd, size_t cmd_size)
120 IBV_INIT_CMD_RESP(cmd, cmd_size, QUERY_DEVICE, &resp, sizeof resp);
122 if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
137 struct ibv_query_device_ex *cmd,
158 IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size,
161 cmd->comp_mask = 0;
162 cmd->reserved = 0;
165 err = write(context->cmd_fd, cmd, cmd_size);
246 struct ibv_query_port *cmd, size_t cmd_size)
250 IBV_INIT_CMD_RESP(cmd, cmd_size, QUERY_PORT, &resp, sizeof resp);
251 cmd->port_num = port_num;
252 memset(cmd->reserved, 0, sizeof cmd->reserved);
254 if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
284 struct ibv_alloc_pd *cmd, size_t cmd_size,
287 IBV_INIT_CMD_RESP(cmd, cmd_size, ALLOC_PD, resp, resp_size);
289 if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
302 struct ibv_dealloc_pd cmd;
304 IBV_INIT_CMD(&cmd, sizeof cmd, DEALLOC_PD);
305 cmd.pd_handle = pd->handle;
307 if (write(pd->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
316 struct ibv_open_xrcd *cmd, size_t cmd_size,
319 IBV_INIT_CMD_RESP(cmd, cmd_size, OPEN_XRCD, resp, resp_size);
328 cmd->fd = attr->fd;
329 cmd->oflags = attr->oflags;
330 if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
347 struct ibv_close_xrcd cmd;
349 IBV_INIT_CMD(&cmd, sizeof cmd, CLOSE_XRCD);
350 cmd.xrcd_handle = xrcd->handle;
352 if (write(xrcd->xrcd.context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
360 struct ibv_mr *mr, struct ibv_reg_mr *cmd,
365 IBV_INIT_CMD_RESP(cmd, cmd_size, REG_MR, resp, resp_size);
367 cmd->start = (uintptr_t) addr;
368 cmd->length = length;
369 cmd->hca_va = hca_va;
370 cmd->pd_handle = pd->handle;
371 cmd->access_flags = access;
373 if (write(pd->context->cmd_fd, cmd, cmd_size) != cmd_size)
388 struct ibv_pd *pd, struct ibv_rereg_mr *cmd,
392 IBV_INIT_CMD_RESP(cmd, cmd_sz, REREG_MR, resp, resp_sz);
394 cmd->mr_handle = mr->handle;
395 cmd->flags = flags;
396 cmd->start = (uintptr_t)addr;
397 cmd->length = length;
398 cmd->hca_va = hca_va;
399 cmd->pd_handle = (flags & IBV_REREG_MR_CHANGE_PD) ? pd->handle : 0;
400 cmd->access_flags = access;
402 if (write(mr->context->cmd_fd, cmd, cmd_sz) != cmd_sz)
417 struct ibv_dereg_mr cmd;
419 IBV_INIT_CMD(&cmd, sizeof cmd, DEREG_MR);
420 cmd.mr_handle = mr->handle;
422 if (write(mr->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
429 struct ibv_mw *mw, struct ibv_alloc_mw *cmd,
433 IBV_INIT_CMD_RESP(cmd, cmd_size, ALLOC_MW, resp, resp_size);
434 cmd->pd_handle = pd->handle;
435 cmd->mw_type = type;
436 memset(cmd->reserved, 0, sizeof(cmd->reserved));
438 if (write(pd->context->cmd_fd, cmd, cmd_size) != cmd_size)
453 struct ibv_dealloc_mw *cmd, size_t cmd_size)
455 IBV_INIT_CMD(cmd, cmd_size, DEALLOC_MW);
456 cmd->mw_handle = mw->handle;
457 cmd->reserved = 0;
459 if (write(mw->context->cmd_fd, cmd, cmd_size) != cmd_size)
468 struct ibv_create_cq *cmd, size_t cmd_size,
471 IBV_INIT_CMD_RESP(cmd, cmd_size, CREATE_CQ, resp, resp_size);
472 cmd->user_handle = (uintptr_t) cq;
473 cmd->cqe = cqe;
474 cmd->comp_vector = comp_vector;
475 cmd->comp_channel = channel ? channel->fd : -1;
476 cmd->reserved = 0;
478 if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
493 struct ibv_create_cq_ex *cmd,
502 memset(cmd, 0, cmd_core_size);
503 IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, CREATE_CQ_EX, resp,
509 cmd->user_handle = (uintptr_t)cq;
510 cmd->cqe = cq_attr->cqe;
511 cmd->comp_vector = cq_attr->comp_vector;
512 cmd->comp_channel = cq_attr->channel ? cq_attr->channel->fd : -1;
513 cmd->comp_mask = 0;
516 sizeof(cmd->flags)) {
522 cmd->flags |= IBV_CREATE_CQ_EX_KERNEL_FLAG_COMPLETION_TIMESTAMP;
525 err = write(context->cmd_fd, cmd, cmd_size);
540 struct ibv_poll_cq cmd;
551 IBV_INIT_CMD_RESP(&cmd, sizeof cmd, POLL_CQ, resp, rsize);
552 cmd.cq_handle = ibcq->handle;
553 cmd.ne = ne;
555 if (write(ibcq->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd) {
587 struct ibv_req_notify_cq cmd;
589 IBV_INIT_CMD(&cmd, sizeof cmd, REQ_NOTIFY_CQ);
590 cmd.cq_handle = ibcq->handle;
591 cmd.solicited = !!solicited_only;
593 if (write(ibcq->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
600 struct ibv_resize_cq *cmd, size_t cmd_size,
603 IBV_INIT_CMD_RESP(cmd, cmd_size, RESIZE_CQ, resp, resp_size);
604 cmd->cq_handle = cq->handle;
605 cmd->cqe = cqe;
607 if (write(cq->context->cmd_fd, cmd, cmd_size) != cmd_size)
619 struct ibv_destroy_cq cmd;
622 IBV_INIT_CMD_RESP(&cmd, sizeof cmd, DESTROY_CQ, &resp, sizeof resp);
623 cmd.cq_handle = cq->handle;
624 cmd.reserved = 0;
626 if (write(cq->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
642 struct ibv_create_srq *cmd, size_t cmd_size,
645 IBV_INIT_CMD_RESP(cmd, cmd_size, CREATE_SRQ, resp, resp_size);
646 cmd->user_handle = (uintptr_t) srq;
647 cmd->pd_handle = pd->handle;
648 cmd->max_wr = attr->attr.max_wr;
649 cmd->max_sge = attr->attr.max_sge;
650 cmd->srq_limit = attr->attr.srq_limit;
652 if (write(pd->context->cmd_fd, cmd, cmd_size) != cmd_size)
678 struct ibv_create_xsrq *cmd, size_t cmd_size,
683 IBV_INIT_CMD_RESP(cmd, cmd_size, CREATE_XSRQ, resp, resp_size);
691 cmd->user_handle = (uintptr_t) srq;
692 cmd->pd_handle = attr_ex->pd->handle;
693 cmd->max_wr = attr_ex->attr.max_wr;
694 cmd->max_sge = attr_ex->attr.max_sge;
695 cmd->srq_limit = attr_ex->attr.srq_limit;
697 cmd->srq_type = (attr_ex->comp_mask & IBV_SRQ_INIT_ATTR_TYPE) ?
704 cmd->xrcd_handle = vxrcd->handle;
705 cmd->cq_handle = attr_ex->cq->handle;
708 if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
756 struct ibv_modify_srq_v3 *cmd;
759 cmd_size = sizeof *cmd + new_cmd_size - sizeof *new_cmd;
760 cmd = alloca(cmd_size);
761 memcpy(cmd->driver_data, new_cmd->driver_data, new_cmd_size - sizeof *new_cmd);
763 IBV_INIT_CMD(cmd, cmd_size, MODIFY_SRQ);
765 cmd->srq_handle = srq->handle;
766 cmd->attr_mask = srq_attr_mask;
767 cmd->max_wr = srq_attr->max_wr;
768 cmd->srq_limit = srq_attr->srq_limit;
769 cmd->max_sge = 0;
770 cmd->reserved = 0;
772 if (write(srq->context->cmd_fd, cmd, cmd_size) != cmd_size)
781 struct ibv_modify_srq *cmd, size_t cmd_size)
785 cmd, cmd_size);
787 IBV_INIT_CMD(cmd, cmd_size, MODIFY_SRQ);
789 cmd->srq_handle = srq->handle;
790 cmd->attr_mask = srq_attr_mask;
791 cmd->max_wr = srq_attr->max_wr;
792 cmd->srq_limit = srq_attr->srq_limit;
794 if (write(srq->context->cmd_fd, cmd, cmd_size) != cmd_size)
801 struct ibv_query_srq *cmd, size_t cmd_size)
805 IBV_INIT_CMD_RESP(cmd, cmd_size, QUERY_SRQ, &resp, sizeof resp);
806 cmd->srq_handle = srq->handle;
807 cmd->reserved = 0;
809 if (write(srq->context->cmd_fd, cmd, cmd_size) != cmd_size)
823 struct ibv_destroy_srq cmd;
826 IBV_INIT_CMD_RESP(&cmd, sizeof cmd, DESTROY_SRQ, &resp, sizeof resp);
827 cmd.srq_handle = srq->handle;
828 cmd.reserved = 0;
830 if (write(srq->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
846 struct ibv_create_qp_common *cmd)
848 cmd->user_handle = (uintptr_t)qp;
852 cmd->pd_handle = vxrcd->handle;
857 cmd->pd_handle = qp_attr->pd->handle;
859 if (cmd->max_recv_wr || cmd->max_recv_sge ||
860 cmd->recv_cq_handle || qp_attr->srq)
865 cmd->send_cq_handle = qp_attr->send_cq->handle;
867 cmd->send_cq_handle = qp_attr->send_cq->handle;
870 cmd->recv_cq_handle = qp_attr->recv_cq->handle;
871 cmd->srq_handle = qp_attr->srq ? qp_attr->srq->handle :
877 cmd->max_send_wr = qp_attr->cap.max_send_wr;
878 cmd->max_recv_wr = qp_attr->cap.max_recv_wr;
879 cmd->max_send_sge = qp_attr->cap.max_send_sge;
880 cmd->max_recv_sge = qp_attr->cap.max_recv_sge;
881 cmd->max_inline_data = qp_attr->cap.max_inline_data;
882 cmd->sq_sig_all = qp_attr->sq_sig_all;
883 cmd->qp_type = qp_attr->qp_type;
884 cmd->is_srq = !!qp_attr->srq;
885 cmd->reserved = 0;
936 struct ibv_create_qp_ex *cmd,
954 memset(cmd, 0, cmd_core_size);
956 IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, CREATE_QP_EX, resp,
959 err = create_qp_ex_common(qp, qp_attr, vxrcd, &cmd->base);
969 cmd->create_flags = qp_attr->create_flags;
974 sizeof(cmd->ind_tbl_handle))
976 cmd->ind_tbl_handle = qp_attr->rwq_ind_tbl->ind_tbl_handle;
977 cmd->comp_mask = IBV_CREATE_QP_EX_KERNEL_MASK_IND_TABLE;
980 err = write(context->cmd_fd, cmd, cmd_size);
995 struct ibv_create_qp *cmd, size_t cmd_size,
1001 IBV_INIT_CMD_RESP(cmd, cmd_size, CREATE_QP, resp, resp_size);
1007 (struct ibv_create_qp_common *)&cmd->user_handle);
1011 if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
1039 struct ibv_create_qp *cmd, size_t cmd_size,
1042 IBV_INIT_CMD_RESP(cmd, cmd_size, CREATE_QP, resp, resp_size);
1044 cmd->user_handle = (uintptr_t) qp;
1045 cmd->pd_handle = pd->handle;
1046 cmd->send_cq_handle = attr->send_cq->handle;
1047 cmd->recv_cq_handle = attr->recv_cq->handle;
1048 cmd->srq_handle = attr->srq ? attr->srq->handle : 0;
1049 cmd->max_send_wr = attr->cap.max_send_wr;
1050 cmd->max_recv_wr = attr->cap.max_recv_wr;
1051 cmd->max_send_sge = attr->cap.max_send_sge;
1052 cmd->max_recv_sge = attr->cap.max_recv_sge;
1053 cmd->max_inline_data = attr->cap.max_inline_data;
1054 cmd->sq_sig_all = attr->sq_sig_all;
1055 cmd->qp_type = attr->qp_type;
1056 cmd->is_srq = !!attr->srq;
1057 cmd->reserved = 0;
1059 if (write(pd->context->cmd_fd, cmd, cmd_size) != cmd_size)
1098 struct ibv_open_qp *cmd, size_t cmd_size,
1102 IBV_INIT_CMD_RESP(cmd, cmd_size, OPEN_QP, resp, resp_size);
1113 cmd->user_handle = (uintptr_t) qp;
1114 cmd->pd_handle = xrcd->handle;
1115 cmd->qpn = attr->qp_num;
1116 cmd->qp_type = attr->qp_type;
1118 if (write(context->cmd_fd, cmd, cmd_size) != cmd_size)
1148 struct ibv_query_qp *cmd, size_t cmd_size)
1159 IBV_INIT_CMD_RESP(cmd, cmd_size, QUERY_QP, &resp, sizeof resp);
1160 cmd->qp_handle = qp->handle;
1161 cmd->attr_mask = attr_mask;
1163 if (write(qp->context->cmd_fd, cmd, cmd_size) != cmd_size)
1236 struct ibv_modify_qp_common *cmd)
1238 cmd->qp_handle = qp->handle;
1239 cmd->attr_mask = attr_mask;
1242 cmd->qp_state = attr->qp_state;
1244 cmd->cur_qp_state = attr->cur_qp_state;
1246 cmd->en_sqd_async_notify = attr->en_sqd_async_notify;
1248 cmd->qp_access_flags = attr->qp_access_flags;
1250 cmd->pkey_index = attr->pkey_index;
1252 cmd->port_num = attr->port_num;
1254 cmd->qkey = attr->qkey;
1257 memcpy(cmd->dest.dgid, attr->ah_attr.grh.dgid.raw, 16);
1258 cmd->dest.flow_label = attr->ah_attr.grh.flow_label;
1259 cmd->dest.dlid = attr->ah_attr.dlid;
1260 cmd->dest.reserved = 0;
1261 cmd->dest.sgid_index = attr->ah_attr.grh.sgid_index;
1262 cmd->dest.hop_limit = attr->ah_attr.grh.hop_limit;
1263 cmd->dest.traffic_class = attr->ah_attr.grh.traffic_class;
1264 cmd->dest.sl = attr->ah_attr.sl;
1265 cmd->dest.src_path_bits = attr->ah_attr.src_path_bits;
1266 cmd->dest.static_rate = attr->ah_attr.static_rate;
1267 cmd->dest.is_global = attr->ah_attr.is_global;
1268 cmd->dest.port_num = attr->ah_attr.port_num;
1272 cmd->path_mtu = attr->path_mtu;
1274 cmd->timeout = attr->timeout;
1276 cmd->retry_cnt = attr->retry_cnt;
1278 cmd->rnr_retry = attr->rnr_retry;
1280 cmd->rq_psn = attr->rq_psn;
1282 cmd->max_rd_atomic = attr->max_rd_atomic;
1285 cmd->alt_pkey_index = attr->alt_pkey_index;
1286 cmd->alt_port_num = attr->alt_port_num;
1287 cmd->alt_timeout = attr->alt_timeout;
1289 memcpy(cmd->alt_dest.dgid, attr->alt_ah_attr.grh.dgid.raw, 16);
1290 cmd->alt_dest.flow_label = attr->alt_ah_attr.grh.flow_label;
1291 cmd->alt_dest.dlid = attr->alt_ah_attr.dlid;
1292 cmd->alt_dest.reserved = 0;
1293 cmd->alt_dest.sgid_index = attr->alt_ah_attr.grh.sgid_index;
1294 cmd->alt_dest.hop_limit = attr->alt_ah_attr.grh.hop_limit;
1295 cmd->alt_dest.traffic_class =
1297 cmd->alt_dest.sl = attr->alt_ah_attr.sl;
1298 cmd->alt_dest.src_path_bits = attr->alt_ah_attr.src_path_bits;
1299 cmd->alt_dest.static_rate = attr->alt_ah_attr.static_rate;
1300 cmd->alt_dest.is_global = attr->alt_ah_attr.is_global;
1301 cmd->alt_dest.port_num = attr->alt_ah_attr.port_num;
1305 cmd->min_rnr_timer = attr->min_rnr_timer;
1307 cmd->sq_psn = attr->sq_psn;
1309 cmd->max_dest_rd_atomic = attr->max_dest_rd_atomic;
1311 cmd->path_mig_state = attr->path_mig_state;
1313 cmd->dest_qp_num = attr->dest_qp_num;
1315 cmd->reserved[0] = cmd->reserved[1] = 0;
1320 struct ibv_modify_qp *cmd, size_t cmd_size)
1329 IBV_INIT_CMD(cmd, cmd_size, MODIFY_QP);
1331 copy_modify_qp_fields(qp, attr, attr_mask, &cmd->base);
1333 if (write(qp->context->cmd_fd, cmd, cmd_size) != cmd_size)
1340 int attr_mask, struct ibv_modify_qp_ex *cmd,
1349 IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, MODIFY_QP_EX,
1352 copy_modify_qp_fields(qp, attr, attr_mask, &cmd->base);
1356 sizeof(cmd->rate_limit))
1357 cmd->rate_limit = attr->rate_limit;
1362 if (write(qp->context->cmd_fd, cmd, cmd_size) != cmd_size)
1373 struct ibv_post_send *cmd;
1388 cmd_size = sizeof *cmd + wr_count * sizeof *n + sge_count * sizeof *s;
1389 cmd = alloca(cmd_size);
1391 IBV_INIT_CMD_RESP(cmd, cmd_size, POST_SEND, &resp, sizeof resp);
1392 cmd->qp_handle = ibqp->handle;
1393 cmd->wr_count = wr_count;
1394 cmd->sge_count = sge_count;
1395 cmd->wqe_size = sizeof *n;
1397 n = (struct ibv_kern_send_wr *) ((void *) cmd + sizeof *cmd);
1443 if (write(ibqp->context->cmd_fd, cmd, cmd_size) != cmd_size)
1463 struct ibv_post_recv *cmd;
1478 cmd_size = sizeof *cmd + wr_count * sizeof *n + sge_count * sizeof *s;
1479 cmd = alloca(cmd_size);
1481 IBV_INIT_CMD_RESP(cmd, cmd_size, POST_RECV, &resp, sizeof resp);
1482 cmd->qp_handle = ibqp->handle;
1483 cmd->wr_count = wr_count;
1484 cmd->sge_count = sge_count;
1485 cmd->wqe_size = sizeof *n;
1487 n = (struct ibv_kern_recv_wr *) ((void *) cmd + sizeof *cmd);
1504 if (write(ibqp->context->cmd_fd, cmd, cmd_size) != cmd_size)
1524 struct ibv_post_srq_recv *cmd;
1539 cmd_size = sizeof *cmd + wr_count * sizeof *n + sge_count * sizeof *s;
1540 cmd = alloca(cmd_size);
1542 IBV_INIT_CMD_RESP(cmd, cmd_size, POST_SRQ_RECV, &resp, sizeof resp);
1543 cmd->srq_handle = srq->handle;
1544 cmd->wr_count = wr_count;
1545 cmd->sge_count = sge_count;
1546 cmd->wqe_size = sizeof *n;
1548 n = (struct ibv_kern_recv_wr *) ((void *) cmd + sizeof *cmd);
1565 if (write(srq->context->cmd_fd, cmd, cmd_size) != cmd_size)
1587 struct ibv_create_ah cmd;
1589 IBV_INIT_CMD_RESP(&cmd, sizeof cmd, CREATE_AH, resp, resp_size);
1590 cmd.user_handle = (uintptr_t) ah;
1591 cmd.pd_handle = pd->handle;
1592 cmd.attr.dlid = attr->dlid;
1593 cmd.attr.sl = attr->sl;
1594 cmd.attr.src_path_bits = attr->src_path_bits;
1595 cmd.attr.static_rate = attr->static_rate;
1596 cmd.attr.is_global = attr->is_global;
1597 cmd.attr.port_num = attr->port_num;
1598 cmd.attr.grh.flow_label = attr->grh.flow_label;
1599 cmd.attr.grh.sgid_index = attr->grh.sgid_index;
1600 cmd.attr.grh.hop_limit = attr->grh.hop_limit;
1601 cmd.attr.grh.traffic_class = attr->grh.traffic_class;
1602 memcpy(cmd.attr.grh.dgid, attr->grh.dgid.raw, 16);
1604 if (write(pd->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
1617 struct ibv_destroy_ah cmd;
1619 IBV_INIT_CMD(&cmd, sizeof cmd, DESTROY_AH);
1620 cmd.ah_handle = ah->handle;
1622 if (write(ah->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
1630 struct ibv_destroy_qp cmd;
1633 IBV_INIT_CMD_RESP(&cmd, sizeof cmd, DESTROY_QP, &resp, sizeof resp);
1634 cmd.qp_handle = qp->handle;
1635 cmd.reserved = 0;
1637 if (write(qp->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
1652 struct ibv_attach_mcast cmd;
1654 IBV_INIT_CMD(&cmd, sizeof cmd, ATTACH_MCAST);
1655 memcpy(cmd.gid, gid->raw, sizeof cmd.gid);
1656 cmd.qp_handle = qp->handle;
1657 cmd.mlid = lid;
1658 cmd.reserved = 0;
1660 if (write(qp->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
1668 struct ibv_detach_mcast cmd;
1670 IBV_INIT_CMD(&cmd, sizeof cmd, DETACH_MCAST);
1671 memcpy(cmd.gid, gid->raw, sizeof cmd.gid);
1672 cmd.qp_handle = qp->handle;
1673 cmd.mlid = lid;
1674 cmd.reserved = 0;
1676 if (write(qp->context->cmd_fd, &cmd, sizeof cmd) != sizeof cmd)
1838 struct ibv_create_flow *cmd;
1847 cmd_size = sizeof(*cmd) + (flow_attr->num_of_specs *
1849 cmd = alloca(cmd_size);
1853 memset(cmd, 0, cmd_size);
1855 cmd->qp_handle = qp->handle;
1857 cmd->flow_attr.type = flow_attr->type;
1858 cmd->flow_attr.priority = flow_attr->priority;
1859 cmd->flow_attr.num_of_specs = flow_attr->num_of_specs;
1860 cmd->flow_attr.port = flow_attr->port;
1861 cmd->flow_attr.flags = flow_attr->flags;
1863 kern_spec = cmd + 1;
1871 cmd->flow_attr.size +=
1877 written_size = sizeof(*cmd) + cmd->flow_attr.size;
1878 IBV_INIT_CMD_RESP_EX_VCMD(cmd, written_size, written_size, CREATE_FLOW,
1880 if (write(qp->context->cmd_fd, cmd, written_size) != written_size)
1895 struct ibv_destroy_flow cmd;
1898 memset(&cmd, 0, sizeof(cmd));
1899 IBV_INIT_CMD_EX(&cmd, sizeof(cmd), DESTROY_FLOW);
1900 cmd.flow_handle = flow_id->handle;
1902 if (write(flow_id->context->cmd_fd, &cmd, sizeof(cmd)) != sizeof(cmd))
1911 struct ibv_create_wq *cmd,
1923 IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size,
1927 cmd->user_handle = (uintptr_t)wq;
1928 cmd->pd_handle = wq_init_attr->pd->handle;
1929 cmd->cq_handle = wq_init_attr->cq->handle;
1930 cmd->wq_type = wq_init_attr->wq_type;
1931 cmd->max_sge = wq_init_attr->max_sge;
1932 cmd->max_wr = wq_init_attr->max_wr;
1933 cmd->comp_mask = 0;
1936 sizeof(cmd->create_flags)) {
1940 cmd->create_flags = wq_init_attr->create_flags;
1944 err = write(context->cmd_fd, cmd, cmd_size);
1966 struct ibv_modify_wq *cmd, size_t cmd_core_size,
1972 memset(cmd, 0, cmd_core_size);
1973 IBV_INIT_CMD_EX(cmd, cmd_size, MODIFY_WQ);
1975 cmd->curr_wq_state = attr->curr_wq_state;
1976 cmd->wq_state = attr->wq_state;
1978 sizeof(cmd->flags_mask)) {
1982 cmd->flags = attr->flags;
1983 cmd->flags_mask = attr->flags_mask;
1986 cmd->wq_handle = wq->handle;
1987 cmd->attr_mask = attr->attr_mask;
1989 if (write(wq->context->cmd_fd, cmd, cmd_size) != cmd_size)
2000 struct ibv_destroy_wq cmd;
2004 memset(&cmd, 0, sizeof(cmd));
2007 IBV_INIT_CMD_RESP_EX(&cmd, sizeof(cmd), DESTROY_WQ, &resp, sizeof(resp));
2008 cmd.wq_handle = wq->handle;
2010 if (write(wq->context->cmd_fd, &cmd, sizeof(cmd)) != sizeof(cmd))
2027 struct ibv_create_rwq_ind_table *cmd,
2042 alloc_tbl_size = cmd_core_size - sizeof(*cmd);
2052 tbl_start = (uint32_t *)((uint8_t *)cmd + sizeof(*cmd));
2056 IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size,
2059 cmd->log_ind_tbl_size = init_attr->log_ind_tbl_size;
2060 cmd->comp_mask = 0;
2062 err = write(context->cmd_fd, cmd, cmd_size);
2079 struct ibv_destroy_rwq_ind_table cmd;
2082 memset(&cmd, 0, sizeof(cmd));
2083 IBV_INIT_CMD_EX(&cmd, sizeof(cmd), DESTROY_RWQ_IND_TBL);
2084 cmd.ind_tbl_handle = rwq_ind_table->ind_tbl_handle;
2086 if (write(rwq_ind_table->context->cmd_fd, &cmd, sizeof(cmd)) != sizeof(cmd))