Lines Matching refs:ret
171 int ret;
173 ret = rdma_create_id(NULL, &id, NULL, RDMA_PS_IB);
174 if (ret)
182 ret = rdma_bind_addr(id, (struct sockaddr *) &sib);
183 af_ib_support = !ret;
191 int i, ret, dev_cnt;
204 ret = check_abi_version();
205 if (ret)
210 ret = ERR(ENODEV);
215 ret = ERR(ENODEV);
221 ret = ERR(ENOMEM);
239 return ret;
268 int i, ret;
277 ret = ibv_query_device(cma_dev->verbs, &attr);
278 if (ret) {
279 ret = ERR(ret);
285 ret = ERR(ENOMEM);
306 return ret;
311 int i, ret = 0;
314 ret = ucma_init();
315 if (ret)
316 return ret;
324 ret = ucma_init_device(&cma_dev_array[i]);
325 if (ret)
329 return ret;
388 int i, ret;
399 if ((ret = ucma_init_device(cma_dev)))
406 ret = ERR(ENOMEM);
415 return ret;
522 int ret;
524 ret = ucma_init();
525 if (ret)
526 return ret;
537 ret = write(id_priv->id.channel->fd, &cmd, sizeof cmd);
538 if (ret != sizeof cmd)
549 return ret;
567 int ret;
572 ret = write(fd, &cmd, sizeof cmd);
573 if (ret != sizeof cmd)
574 return (ret >= 0) ? ERR(ENODATA) : -1;
584 int ret;
587 ret = ucma_destroy_kern_id(id->channel->fd, id_priv->handle);
588 if (ret < 0)
589 return ret;
595 while (id_priv->events_completed < ret)
625 int ret;
632 ret = write(id->channel->fd, &cmd, sizeof cmd);
633 if (ret != sizeof cmd)
634 return (ret >= 0) ? ERR(ENODATA) : -1;
642 ret = ucma_get_device(id_priv, resp.node_guid);
643 if (ret)
644 return ret;
658 int ret;
665 ret = write(id->channel->fd, &cmd, sizeof cmd);
666 if (ret != sizeof cmd)
667 return (ret >= 0) ? ERR(ENODATA) : -1;
717 int ret, i, size;
726 ret = write(id->channel->fd, &cmd, sizeof cmd);
727 if (ret != sizeof cmd)
728 return (ret >= 0) ? ERR(ENODATA) : -1;
751 int ret, i;
757 ret = write(id->channel->fd, &cmd, sizeof cmd);
758 if (ret != sizeof cmd)
759 return (ret >= 0) ? ERR(ENODATA) : -1;
786 ret = ucma_get_device(id_priv, resp.node_guid);
787 if (ret)
788 return ret;
800 int ret;
808 ret = write(id->channel->fd, &cmd, sizeof cmd);
809 if (ret != sizeof cmd)
810 return (ret >= 0) ? ERR(ENODATA) : -1;
812 ret = ucma_query_addr(id);
813 if (!ret)
814 ret = ucma_query_gid(id);
815 return ret;
822 int ret, addrlen;
836 ret = write(id->channel->fd, &cmd, sizeof cmd);
837 if (ret != sizeof cmd)
838 return (ret >= 0) ? ERR(ENODATA) : -1;
846 int ret;
857 ret = rdma_get_cm_event(id_priv->id.channel, &id_priv->id.event);
858 if (ret)
859 return ret;
863 ret = ERR(ECONNREFUSED);
865 ret = ERR(-id_priv->id.event->status);
867 ret = ERR(-id_priv->id.event->status);
869 return ret;
878 int ret;
889 ret = write(id->channel->fd, &cmd, sizeof cmd);
890 if (ret != sizeof cmd)
891 return (ret >= 0) ? ERR(ENODATA) : -1;
902 int ret, dst_len, src_len;
924 ret = write(id->channel->fd, &cmd, sizeof cmd);
925 if (ret != sizeof cmd)
926 return (ret >= 0) ? ERR(ENODATA) : -1;
935 int ret;
945 ret = rdma_getaddrinfo(NULL, NULL, &hint, &rai);
946 if (ret)
947 return ret;
950 ret = rdma_set_option(id, RDMA_OPTION_IB, RDMA_OPTION_IB_PATH,
953 ret = -1;
956 return ret;
963 int ret;
967 ret = ucma_set_ib_route(id);
968 if (!ret)
976 ret = write(id->channel->fd, &cmd, sizeof cmd);
977 if (ret != sizeof cmd)
978 return (ret >= 0) ? ERR(ENODATA) : -1;
995 int ret;
1002 ret = write(id->channel->fd, &cmd, sizeof cmd);
1003 if (ret != sizeof cmd)
1004 return (ret >= 0) ? ERR(ENODATA) : -1;
1017 int qp_attr_mask, ret;
1025 ret = rdma_init_qp_attr(id, &qp_attr, &qp_attr_mask);
1026 if (ret)
1027 return ret;
1029 ret = ibv_modify_qp(id->qp, &qp_attr, qp_attr_mask);
1030 if (ret)
1031 return ERR(ret);
1034 ret = rdma_init_qp_attr(id, &qp_attr, &qp_attr_mask);
1035 if (ret)
1036 return ret;
1056 int qp_attr_mask, ret;
1059 ret = rdma_init_qp_attr(id, &qp_attr, &qp_attr_mask);
1060 if (ret)
1061 return ret;
1093 int ret, i;
1096 for (i = 0, ret = 0; !ret; i++) {
1097 ret = ibv_query_pkey(cma_dev->verbs, port_num, i, &chk_pkey);
1098 if (!ret && pkey == chk_pkey) {
1109 int ret;
1111 ret = ucma_find_pkey(id_priv->cma_dev, id_priv->id.port_num,
1114 if (ret)
1115 return ret;
1121 ret = ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE | IBV_QP_ACCESS_FLAGS |
1123 return rdma_seterrno(ret);
1129 int qp_attr_mask, ret;
1135 ret = rdma_init_qp_attr(&id_priv->id, &qp_attr, &qp_attr_mask);
1136 if (ret)
1137 return ret;
1145 int ret;
1147 ret = ucma_find_pkey(id_priv->cma_dev, id_priv->id.port_num,
1150 if (ret)
1151 return ret;
1157 ret = ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE | IBV_QP_QKEY |
1159 if (ret)
1160 return ERR(ret);
1163 ret = ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE);
1164 if (ret)
1165 return ERR(ret);
1169 ret = ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE | IBV_QP_SQ_PSN);
1170 return rdma_seterrno(ret);
1176 int qp_attr_mask, ret;
1182 ret = rdma_init_qp_attr(&id_priv->id, &qp_attr, &qp_attr_mask);
1183 if (ret)
1184 return ret;
1186 ret = ibv_modify_qp(qp, &qp_attr, qp_attr_mask);
1187 if (ret)
1188 return ERR(ret);
1191 ret = ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE);
1192 if (ret)
1193 return ERR(ret);
1197 ret = ibv_modify_qp(qp, &qp_attr, IBV_QP_STATE | IBV_QP_SQ_PSN);
1198 return rdma_seterrno(ret);
1259 int ret;
1277 ret = ucma_create_cqs(id, 0, attr->attr.max_wr);
1278 if (ret)
1279 return ret;
1287 ret = -1;
1297 return ret;
1304 int ret;
1314 ret = rdma_create_srq_ex(id, &attr_ex);
1316 return ret;
1331 int ret;
1356 ret = ucma_create_cqs(id, attr->send_cq || id->send_cq ? 0 : attr->cap.max_send_wr,
1358 if (ret)
1359 return ret;
1369 ret = ERR(ENOMEM);
1374 ret = ucma_init_ud_qp(id_priv, qp);
1376 ret = ucma_init_conn_qp(id_priv, qp);
1377 if (ret)
1387 return ret;
1394 int ret;
1399 ret = rdma_create_qp_ex(id, &attr_ex);
1401 return ret;
1472 int ret;
1475 ret = ucma_valid_param(id_priv, conn_param);
1476 if (ret)
1477 return ret;
1503 ret = write(id->channel->fd, &cmd, sizeof cmd);
1504 if (ret != sizeof cmd)
1505 return (ret >= 0) ? ERR(ENODATA) : -1;
1519 int ret;
1526 ret = write(id->channel->fd, &cmd, sizeof cmd);
1527 if (ret != sizeof cmd)
1528 return (ret >= 0) ? ERR(ENODATA) : -1;
1540 int ret;
1551 ret = rdma_get_cm_event(listen->channel, &event);
1552 if (ret)
1553 return ret;
1556 ret = ERR(event->status);
1561 ret = ERR(EINVAL);
1569 ret = rdma_create_qp(event->id, listen->pd, &attr);
1570 if (ret)
1580 return ret;
1587 int ret;
1590 ret = ucma_valid_param(id_priv, conn_param);
1591 if (ret)
1592 return ret;
1608 ret = ucma_modify_qp_rtr(id, id_priv->responder_resources);
1609 if (ret)
1610 return ret;
1612 ret = ucma_modify_qp_rts(id, id_priv->initiator_depth);
1613 if (ret)
1614 return ret;
1629 ret = write(id->channel->fd, &cmd, sizeof cmd);
1630 if (ret != sizeof cmd) {
1632 return (ret >= 0) ? ERR(ENODATA) : -1;
1646 int ret;
1657 ret = write(id->channel->fd, &cmd, sizeof cmd);
1658 if (ret != sizeof cmd)
1659 return (ret >= 0) ? ERR(ENODATA) : -1;
1668 int ret;
1675 ret = write(id->channel->fd, &cmd, sizeof cmd);
1676 if (ret != sizeof cmd)
1677 return (ret >= 0) ? ERR(ENODATA) : -1;
1698 int ret;
1700 ret = ucma_shutdown(id);
1701 if (ret)
1702 return ret;
1708 ret = write(id->channel->fd, &cmd, sizeof cmd);
1709 if (ret != sizeof cmd)
1710 return (ret >= 0) ? ERR(ENODATA) : -1;
1721 int ret;
1732 ret = -1;
1751 ret = write(id->channel->fd, &cmd, sizeof cmd);
1752 if (ret != sizeof cmd) {
1753 ret = (ret >= 0) ? ERR(ENODATA) : -1;
1764 ret = write(id->channel->fd, &cmd, sizeof cmd);
1765 if (ret != sizeof cmd) {
1766 ret = (ret >= 0) ? ERR(ENODATA) : -1;
1784 return ret;
1805 int ret, addrlen;
1830 ret = write(id->channel->fd, &cmd, sizeof cmd);
1831 if (ret != sizeof cmd) {
1832 ret = (ret >= 0) ? ERR(ENODATA) : -1;
1843 ret = 0;
1846 return ret;
1915 int ret;
1920 ret = ucma_query_addr(id);
1921 if (ret)
1922 return ret;
1924 ret = ucma_query_gid(id);
1925 if (ret)
1926 return ret;
1928 ret = ucma_query_path(id);
1929 if (ret)
1930 return ret;
1939 int ret;
1946 ret = ERR(ENOMEM);
1958 ret = rdma_migrate_id(&id_priv->id, NULL);
1959 if (ret)
1963 ret = ucma_query_req_info(&id_priv->id);
1964 if (ret)
1973 return ret;
1979 int ret;
1981 ret = ucma_modify_qp_rtr(&id_priv->id, RDMA_MAX_RESP_RES);
1982 if (ret)
1985 ret = ucma_modify_qp_rts(&id_priv->id, RDMA_MAX_INIT_DEPTH);
1986 if (ret)
1992 ret = write(id_priv->id.channel->fd, &cmd, sizeof cmd);
1993 if (ret != sizeof cmd) {
1994 ret = (ret >= 0) ? ERR(ENODATA) : -1;
2001 return ret;
2060 int ret;
2062 ret = ucma_init();
2063 if (ret)
2064 return ret;
2076 ret = write(channel->fd, &cmd, sizeof cmd);
2077 if (ret != sizeof cmd) {
2079 return (ret >= 0) ? ERR(ENODATA) : -1;
2124 ret = ucma_process_conn_req(evt, resp.id);
2125 if (ret)
2237 int ret;
2247 ret = write(id->channel->fd, &cmd, sizeof cmd);
2248 if (ret != sizeof cmd)
2249 return (ret >= 0) ? ERR(ENODATA) : -1;
2259 int ret, sync;
2275 ret = write(channel->fd, &cmd, sizeof cmd);
2276 if (ret != sizeof cmd) {
2279 return (ret >= 0) ? ERR(ENODATA) : -1;
2313 int ret;
2316 ret = rdma_bind_addr2(id, res->ai_src_addr, res->ai_src_len);
2318 ret = rdma_bind_addr(id, res->ai_src_addr);
2319 if (ret)
2320 return ret;
2343 int ret;
2345 ret = rdma_create_id2(NULL, &cm_id, NULL, res->ai_port_space, res->ai_qp_type);
2346 if (ret)
2347 return ret;
2350 ret = ucma_passive_ep(cm_id, res, pd, qp_init_attr);
2351 if (ret)
2357 ret = rdma_resolve_addr2(cm_id, res->ai_src_addr, res->ai_src_len,
2360 ret = rdma_resolve_addr(cm_id, res->ai_src_addr, res->ai_dst_addr, 2000);
2361 if (ret)
2365 ret = rdma_set_option(cm_id, RDMA_OPTION_IB, RDMA_OPTION_IB_PATH,
2367 if (!ret)
2368 ret = ucma_complete(cm_id);
2370 ret = rdma_resolve_route(cm_id, 2000);
2372 if (ret)
2377 ret = rdma_create_qp(cm_id, pd, qp_init_attr);
2378 if (ret)
2386 ret = ERR(ENOMEM);
2399 return ret;