Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
RDMA/cma: Save PID of ID's owner
RDMA/cma: Add support for netlink statistics export
RDMA/cma: Pass QP type into rdma_create_id()
RDMA: Update exported headers list
RDMA/cma: Export enum cma_state in <rdma/rdma_cm.h>
RDMA/nes: Add a check for strict_strtoul()
RDMA/cxgb3: Don't post zero-byte read if endpoint is going away
RDMA/cxgb4: Use completion objects for event blocking
IB/srp: Fix integer -> pointer cast warnings
IB: Add devnode methods to cm_class and umad_class
IB/mad: Return EPROTONOSUPPORT when an RDMA device lacks the QP required
IB/uverbs: Add devnode method to set path/mode
RDMA/ucma: Add .nodename/.mode to tell userspace where to create device node
RDMA: Add netlink infrastructure
RDMA: Add error handling to ib_core_init()

+633 -159
+1
drivers/infiniband/Kconfig
··· 2 2 tristate "InfiniBand support" 3 3 depends on PCI || BROKEN 4 4 depends on HAS_IOMEM 5 + depends on NET 5 6 ---help--- 6 7 Core support for InfiniBand (IB). Make sure to also select 7 8 any protocols you wish to use as well as drivers for your
+1 -1
drivers/infiniband/core/Makefile
··· 8 8 $(user_access-y) 9 9 10 10 ib_core-y := packer.o ud_header.o verbs.o sysfs.o \ 11 - device.o fmr_pool.o cache.o 11 + device.o fmr_pool.o cache.o netlink.o 12 12 ib_core-$(CONFIG_INFINIBAND_USER_MEM) += umem.o 13 13 14 14 ib_mad-y := mad.o smi.o agent.o mad_rmpp.o
+8
drivers/infiniband/core/cm.c
··· 3639 3639 .release = cm_release_port_obj 3640 3640 }; 3641 3641 3642 + static char *cm_devnode(struct device *dev, mode_t *mode) 3643 + { 3644 + *mode = 0666; 3645 + return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev)); 3646 + } 3647 + 3642 3648 struct class cm_class = { 3649 + .owner = THIS_MODULE, 3643 3650 .name = "infiniband_cm", 3651 + .devnode = cm_devnode, 3644 3652 }; 3645 3653 EXPORT_SYMBOL(cm_class); 3646 3654
+200 -108
drivers/infiniband/core/cma.c
··· 47 47 48 48 #include <rdma/rdma_cm.h> 49 49 #include <rdma/rdma_cm_ib.h> 50 + #include <rdma/rdma_netlink.h> 50 51 #include <rdma/ib_cache.h> 51 52 #include <rdma/ib_cm.h> 52 53 #include <rdma/ib_sa.h> ··· 90 89 struct list_head id_list; 91 90 }; 92 91 93 - enum cma_state { 94 - CMA_IDLE, 95 - CMA_ADDR_QUERY, 96 - CMA_ADDR_RESOLVED, 97 - CMA_ROUTE_QUERY, 98 - CMA_ROUTE_RESOLVED, 99 - CMA_CONNECT, 100 - CMA_DISCONNECT, 101 - CMA_ADDR_BOUND, 102 - CMA_LISTEN, 103 - CMA_DEVICE_REMOVAL, 104 - CMA_DESTROYING 105 - }; 106 - 107 92 struct rdma_bind_list { 108 93 struct idr *ps; 109 94 struct hlist_head owners; ··· 113 126 struct list_head mc_list; 114 127 115 128 int internal_id; 116 - enum cma_state state; 129 + enum rdma_cm_state state; 117 130 spinlock_t lock; 118 131 struct mutex qp_mutex; 119 132 ··· 133 146 u32 seq_num; 134 147 u32 qkey; 135 148 u32 qp_num; 149 + pid_t owner; 136 150 u8 srq; 137 151 u8 tos; 138 152 u8 reuseaddr; ··· 153 165 struct cma_work { 154 166 struct work_struct work; 155 167 struct rdma_id_private *id; 156 - enum cma_state old_state; 157 - enum cma_state new_state; 168 + enum rdma_cm_state old_state; 169 + enum rdma_cm_state new_state; 158 170 struct rdma_cm_event event; 159 171 }; 160 172 ··· 205 217 #define CMA_VERSION 0x00 206 218 #define SDP_MAJ_VERSION 0x2 207 219 208 - static int cma_comp(struct rdma_id_private *id_priv, enum cma_state comp) 220 + static int cma_comp(struct rdma_id_private *id_priv, enum rdma_cm_state comp) 209 221 { 210 222 unsigned long flags; 211 223 int ret; ··· 217 229 } 218 230 219 231 static int cma_comp_exch(struct rdma_id_private *id_priv, 220 - enum cma_state comp, enum cma_state exch) 232 + enum rdma_cm_state comp, enum rdma_cm_state exch) 221 233 { 222 234 unsigned long flags; 223 235 int ret; ··· 229 241 return ret; 230 242 } 231 243 232 - static enum cma_state cma_exch(struct rdma_id_private *id_priv, 233 - enum cma_state exch) 244 + static enum rdma_cm_state cma_exch(struct rdma_id_private *id_priv, 245 + enum rdma_cm_state exch) 234 246 { 235 247 unsigned long flags; 236 - enum cma_state old; 248 + enum rdma_cm_state old; 237 249 238 250 spin_lock_irqsave(&id_priv->lock, flags); 239 251 old = id_priv->state; ··· 265 277 static inline void sdp_set_ip_ver(struct sdp_hh *hh, u8 ip_ver) 266 278 { 267 279 hh->ip_version = (ip_ver << 4) | (hh->ip_version & 0xF); 268 - } 269 - 270 - static inline int cma_is_ud_ps(enum rdma_port_space ps) 271 - { 272 - return (ps == RDMA_PS_UDP || ps == RDMA_PS_IPOIB); 273 280 } 274 281 275 282 static void cma_attach_to_dev(struct rdma_id_private *id_priv, ··· 396 413 } 397 414 398 415 static int cma_disable_callback(struct rdma_id_private *id_priv, 399 - enum cma_state state) 416 + enum rdma_cm_state state) 400 417 { 401 418 mutex_lock(&id_priv->handler_mutex); 402 419 if (id_priv->state != state) { ··· 412 429 } 413 430 414 431 struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler, 415 - void *context, enum rdma_port_space ps) 432 + void *context, enum rdma_port_space ps, 433 + enum ib_qp_type qp_type) 416 434 { 417 435 struct rdma_id_private *id_priv; 418 436 ··· 421 437 if (!id_priv) 422 438 return ERR_PTR(-ENOMEM); 423 439 424 - id_priv->state = CMA_IDLE; 440 + id_priv->owner = task_pid_nr(current); 441 + id_priv->state = RDMA_CM_IDLE; 425 442 id_priv->id.context = context; 426 443 id_priv->id.event_handler = event_handler; 427 444 id_priv->id.ps = ps; 445 + id_priv->id.qp_type = qp_type; 428 446 spin_lock_init(&id_priv->lock); 429 447 mutex_init(&id_priv->qp_mutex); 430 448 init_completion(&id_priv->comp); ··· 494 508 if (IS_ERR(qp)) 495 509 return PTR_ERR(qp); 496 510 497 - if (cma_is_ud_ps(id_priv->id.ps)) 511 + if (id->qp_type == IB_QPT_UD) 498 512 ret = cma_init_ud_qp(id_priv, qp); 499 513 else 500 514 ret = cma_init_conn_qp(id_priv, qp); ··· 622 636 qp_attr->port_num = id_priv->id.port_num; 623 637 *qp_attr_mask = IB_QP_STATE | IB_QP_PKEY_INDEX | IB_QP_PORT; 624 638 625 - if (cma_is_ud_ps(id_priv->id.ps)) { 639 + if (id_priv->id.qp_type == IB_QPT_UD) { 626 640 ret = cma_set_qkey(id_priv); 627 641 if (ret) 628 642 return ret; ··· 645 659 id_priv = container_of(id, struct rdma_id_private, id); 646 660 switch (rdma_node_get_transport(id_priv->id.device->node_type)) { 647 661 case RDMA_TRANSPORT_IB: 648 - if (!id_priv->cm_id.ib || cma_is_ud_ps(id_priv->id.ps)) 662 + if (!id_priv->cm_id.ib || (id_priv->id.qp_type == IB_QPT_UD)) 649 663 ret = cma_ib_init_qp_attr(id_priv, qp_attr, qp_attr_mask); 650 664 else 651 665 ret = ib_cm_init_qp_attr(id_priv->cm_id.ib, qp_attr, ··· 844 858 } 845 859 846 860 static void cma_cancel_operation(struct rdma_id_private *id_priv, 847 - enum cma_state state) 861 + enum rdma_cm_state state) 848 862 { 849 863 switch (state) { 850 - case CMA_ADDR_QUERY: 864 + case RDMA_CM_ADDR_QUERY: 851 865 rdma_addr_cancel(&id_priv->id.route.addr.dev_addr); 852 866 break; 853 - case CMA_ROUTE_QUERY: 867 + case RDMA_CM_ROUTE_QUERY: 854 868 cma_cancel_route(id_priv); 855 869 break; 856 - case CMA_LISTEN: 870 + case RDMA_CM_LISTEN: 857 871 if (cma_any_addr((struct sockaddr *) &id_priv->id.route.addr.src_addr) 858 872 && !id_priv->cma_dev) 859 873 cma_cancel_listens(id_priv); ··· 904 918 void rdma_destroy_id(struct rdma_cm_id *id) 905 919 { 906 920 struct rdma_id_private *id_priv; 907 - enum cma_state state; 921 + enum rdma_cm_state state; 908 922 909 923 id_priv = container_of(id, struct rdma_id_private, id); 910 - state = cma_exch(id_priv, CMA_DESTROYING); 924 + state = cma_exch(id_priv, RDMA_CM_DESTROYING); 911 925 cma_cancel_operation(id_priv, state); 912 926 913 927 /* ··· 1001 1015 int ret = 0; 1002 1016 1003 1017 if ((ib_event->event != IB_CM_TIMEWAIT_EXIT && 1004 - cma_disable_callback(id_priv, CMA_CONNECT)) || 1018 + cma_disable_callback(id_priv, RDMA_CM_CONNECT)) || 1005 1019 (ib_event->event == IB_CM_TIMEWAIT_EXIT && 1006 - cma_disable_callback(id_priv, CMA_DISCONNECT))) 1020 + cma_disable_callback(id_priv, RDMA_CM_DISCONNECT))) 1007 1021 return 0; 1008 1022 1009 1023 memset(&event, 0, sizeof event); ··· 1034 1048 event.status = -ETIMEDOUT; /* fall through */ 1035 1049 case IB_CM_DREQ_RECEIVED: 1036 1050 case IB_CM_DREP_RECEIVED: 1037 - if (!cma_comp_exch(id_priv, CMA_CONNECT, CMA_DISCONNECT)) 1051 + if (!cma_comp_exch(id_priv, RDMA_CM_CONNECT, 1052 + RDMA_CM_DISCONNECT)) 1038 1053 goto out; 1039 1054 event.event = RDMA_CM_EVENT_DISCONNECTED; 1040 1055 break; ··· 1062 1075 if (ret) { 1063 1076 /* Destroy the CM ID by returning a non-zero value. */ 1064 1077 id_priv->cm_id.ib = NULL; 1065 - cma_exch(id_priv, CMA_DESTROYING); 1078 + cma_exch(id_priv, RDMA_CM_DESTROYING); 1066 1079 mutex_unlock(&id_priv->handler_mutex); 1067 1080 rdma_destroy_id(&id_priv->id); 1068 1081 return ret; ··· 1088 1101 goto err; 1089 1102 1090 1103 id = rdma_create_id(listen_id->event_handler, listen_id->context, 1091 - listen_id->ps); 1104 + listen_id->ps, ib_event->param.req_rcvd.qp_type); 1092 1105 if (IS_ERR(id)) 1093 1106 goto err; 1094 1107 ··· 1119 1132 rdma_addr_set_dgid(&rt->addr.dev_addr, &rt->path_rec[0].dgid); 1120 1133 1121 1134 id_priv = container_of(id, struct rdma_id_private, id); 1122 - id_priv->state = CMA_CONNECT; 1135 + id_priv->state = RDMA_CM_CONNECT; 1123 1136 return id_priv; 1124 1137 1125 1138 destroy_id: ··· 1139 1152 int ret; 1140 1153 1141 1154 id = rdma_create_id(listen_id->event_handler, listen_id->context, 1142 - listen_id->ps); 1155 + listen_id->ps, IB_QPT_UD); 1143 1156 if (IS_ERR(id)) 1144 1157 return NULL; 1145 1158 ··· 1159 1172 } 1160 1173 1161 1174 id_priv = container_of(id, struct rdma_id_private, id); 1162 - id_priv->state = CMA_CONNECT; 1175 + id_priv->state = RDMA_CM_CONNECT; 1163 1176 return id_priv; 1164 1177 err: 1165 1178 rdma_destroy_id(id); ··· 1188 1201 int offset, ret; 1189 1202 1190 1203 listen_id = cm_id->context; 1191 - if (cma_disable_callback(listen_id, CMA_LISTEN)) 1204 + if (cma_disable_callback(listen_id, RDMA_CM_LISTEN)) 1192 1205 return -ECONNABORTED; 1193 1206 1194 1207 memset(&event, 0, sizeof event); 1195 1208 offset = cma_user_data_offset(listen_id->id.ps); 1196 1209 event.event = RDMA_CM_EVENT_CONNECT_REQUEST; 1197 - if (cma_is_ud_ps(listen_id->id.ps)) { 1210 + if (listen_id->id.qp_type == IB_QPT_UD) { 1198 1211 conn_id = cma_new_udp_id(&listen_id->id, ib_event); 1199 1212 event.param.ud.private_data = ib_event->private_data + offset; 1200 1213 event.param.ud.private_data_len = ··· 1230 1243 * while we're accessing the cm_id. 1231 1244 */ 1232 1245 mutex_lock(&lock); 1233 - if (cma_comp(conn_id, CMA_CONNECT) && 1234 - !cma_is_ud_ps(conn_id->id.ps)) 1246 + if (cma_comp(conn_id, RDMA_CM_CONNECT) && (conn_id->id.qp_type != IB_QPT_UD)) 1235 1247 ib_send_cm_mra(cm_id, CMA_CM_MRA_SETTING, NULL, 0); 1236 1248 mutex_unlock(&lock); 1237 1249 mutex_unlock(&conn_id->handler_mutex); ··· 1243 1257 conn_id->cm_id.ib = NULL; 1244 1258 1245 1259 release_conn_id: 1246 - cma_exch(conn_id, CMA_DESTROYING); 1260 + cma_exch(conn_id, RDMA_CM_DESTROYING); 1247 1261 mutex_unlock(&conn_id->handler_mutex); 1248 1262 rdma_destroy_id(&conn_id->id); 1249 1263 ··· 1314 1328 struct sockaddr_in *sin; 1315 1329 int ret = 0; 1316 1330 1317 - if (cma_disable_callback(id_priv, CMA_CONNECT)) 1331 + if (cma_disable_callback(id_priv, RDMA_CM_CONNECT)) 1318 1332 return 0; 1319 1333 1320 1334 memset(&event, 0, sizeof event); ··· 1357 1371 if (ret) { 1358 1372 /* Destroy the CM ID by returning a non-zero value. */ 1359 1373 id_priv->cm_id.iw = NULL; 1360 - cma_exch(id_priv, CMA_DESTROYING); 1374 + cma_exch(id_priv, RDMA_CM_DESTROYING); 1361 1375 mutex_unlock(&id_priv->handler_mutex); 1362 1376 rdma_destroy_id(&id_priv->id); 1363 1377 return ret; ··· 1379 1393 struct ib_device_attr attr; 1380 1394 1381 1395 listen_id = cm_id->context; 1382 - if (cma_disable_callback(listen_id, CMA_LISTEN)) 1396 + if (cma_disable_callback(listen_id, RDMA_CM_LISTEN)) 1383 1397 return -ECONNABORTED; 1384 1398 1385 1399 /* Create a new RDMA id for the new IW CM ID */ 1386 1400 new_cm_id = rdma_create_id(listen_id->id.event_handler, 1387 1401 listen_id->id.context, 1388 - RDMA_PS_TCP); 1402 + RDMA_PS_TCP, IB_QPT_RC); 1389 1403 if (IS_ERR(new_cm_id)) { 1390 1404 ret = -ENOMEM; 1391 1405 goto out; 1392 1406 } 1393 1407 conn_id = container_of(new_cm_id, struct rdma_id_private, id); 1394 1408 mutex_lock_nested(&conn_id->handler_mutex, SINGLE_DEPTH_NESTING); 1395 - conn_id->state = CMA_CONNECT; 1409 + conn_id->state = RDMA_CM_CONNECT; 1396 1410 1397 1411 dev = ip_dev_find(&init_net, iw_event->local_addr.sin_addr.s_addr); 1398 1412 if (!dev) { ··· 1447 1461 if (ret) { 1448 1462 /* User wants to destroy the CM ID */ 1449 1463 conn_id->cm_id.iw = NULL; 1450 - cma_exch(conn_id, CMA_DESTROYING); 1464 + cma_exch(conn_id, RDMA_CM_DESTROYING); 1451 1465 mutex_unlock(&conn_id->handler_mutex); 1452 1466 cma_deref_id(conn_id); 1453 1467 rdma_destroy_id(&conn_id->id); ··· 1534 1548 struct rdma_cm_id *id; 1535 1549 int ret; 1536 1550 1537 - id = rdma_create_id(cma_listen_handler, id_priv, id_priv->id.ps); 1551 + id = rdma_create_id(cma_listen_handler, id_priv, id_priv->id.ps, 1552 + id_priv->id.qp_type); 1538 1553 if (IS_ERR(id)) 1539 1554 return; 1540 1555 1541 1556 dev_id_priv = container_of(id, struct rdma_id_private, id); 1542 1557 1543 - dev_id_priv->state = CMA_ADDR_BOUND; 1558 + dev_id_priv->state = RDMA_CM_ADDR_BOUND; 1544 1559 memcpy(&id->route.addr.src_addr, &id_priv->id.route.addr.src_addr, 1545 1560 ip_addr_size((struct sockaddr *) &id_priv->id.route.addr.src_addr)); 1546 1561 ··· 1588 1601 route->num_paths = 1; 1589 1602 *route->path_rec = *path_rec; 1590 1603 } else { 1591 - work->old_state = CMA_ROUTE_QUERY; 1592 - work->new_state = CMA_ADDR_RESOLVED; 1604 + work->old_state = RDMA_CM_ROUTE_QUERY; 1605 + work->new_state = RDMA_CM_ADDR_RESOLVED; 1593 1606 work->event.event = RDMA_CM_EVENT_ROUTE_ERROR; 1594 1607 work->event.status = status; 1595 1608 } ··· 1647 1660 goto out; 1648 1661 1649 1662 if (id_priv->id.event_handler(&id_priv->id, &work->event)) { 1650 - cma_exch(id_priv, CMA_DESTROYING); 1663 + cma_exch(id_priv, RDMA_CM_DESTROYING); 1651 1664 destroy = 1; 1652 1665 } 1653 1666 out: ··· 1665 1678 int destroy = 0; 1666 1679 1667 1680 mutex_lock(&id_priv->handler_mutex); 1668 - if (id_priv->state == CMA_DESTROYING || 1669 - id_priv->state == CMA_DEVICE_REMOVAL) 1681 + if (id_priv->state == RDMA_CM_DESTROYING || 1682 + id_priv->state == RDMA_CM_DEVICE_REMOVAL) 1670 1683 goto out; 1671 1684 1672 1685 if (id_priv->id.event_handler(&id_priv->id, &work->event)) { 1673 - cma_exch(id_priv, CMA_DESTROYING); 1686 + cma_exch(id_priv, RDMA_CM_DESTROYING); 1674 1687 destroy = 1; 1675 1688 } 1676 1689 ··· 1694 1707 1695 1708 work->id = id_priv; 1696 1709 INIT_WORK(&work->work, cma_work_handler); 1697 - work->old_state = CMA_ROUTE_QUERY; 1698 - work->new_state = CMA_ROUTE_RESOLVED; 1710 + work->old_state = RDMA_CM_ROUTE_QUERY; 1711 + work->new_state = RDMA_CM_ROUTE_RESOLVED; 1699 1712 work->event.event = RDMA_CM_EVENT_ROUTE_RESOLVED; 1700 1713 1701 1714 route->path_rec = kmalloc(sizeof *route->path_rec, GFP_KERNEL); ··· 1724 1737 int ret; 1725 1738 1726 1739 id_priv = container_of(id, struct rdma_id_private, id); 1727 - if (!cma_comp_exch(id_priv, CMA_ADDR_RESOLVED, CMA_ROUTE_RESOLVED)) 1740 + if (!cma_comp_exch(id_priv, RDMA_CM_ADDR_RESOLVED, 1741 + RDMA_CM_ROUTE_RESOLVED)) 1728 1742 return -EINVAL; 1729 1743 1730 1744 id->route.path_rec = kmemdup(path_rec, sizeof *path_rec * num_paths, ··· 1738 1750 id->route.num_paths = num_paths; 1739 1751 return 0; 1740 1752 err: 1741 - cma_comp_exch(id_priv, CMA_ROUTE_RESOLVED, CMA_ADDR_RESOLVED); 1753 + cma_comp_exch(id_priv, RDMA_CM_ROUTE_RESOLVED, RDMA_CM_ADDR_RESOLVED); 1742 1754 return ret; 1743 1755 } 1744 1756 EXPORT_SYMBOL(rdma_set_ib_paths); ··· 1753 1765 1754 1766 work->id = id_priv; 1755 1767 INIT_WORK(&work->work, cma_work_handler); 1756 - work->old_state = CMA_ROUTE_QUERY; 1757 - work->new_state = CMA_ROUTE_RESOLVED; 1768 + work->old_state = RDMA_CM_ROUTE_QUERY; 1769 + work->new_state = RDMA_CM_ROUTE_RESOLVED; 1758 1770 work->event.event = RDMA_CM_EVENT_ROUTE_RESOLVED; 1759 1771 queue_work(cma_wq, &work->work); 1760 1772 return 0; ··· 1818 1830 goto err2; 1819 1831 } 1820 1832 1821 - work->old_state = CMA_ROUTE_QUERY; 1822 - work->new_state = CMA_ROUTE_RESOLVED; 1833 + work->old_state = RDMA_CM_ROUTE_QUERY; 1834 + work->new_state = RDMA_CM_ROUTE_RESOLVED; 1823 1835 work->event.event = RDMA_CM_EVENT_ROUTE_RESOLVED; 1824 1836 work->event.status = 0; 1825 1837 ··· 1841 1853 int ret; 1842 1854 1843 1855 id_priv = container_of(id, struct rdma_id_private, id); 1844 - if (!cma_comp_exch(id_priv, CMA_ADDR_RESOLVED, CMA_ROUTE_QUERY)) 1856 + if (!cma_comp_exch(id_priv, RDMA_CM_ADDR_RESOLVED, RDMA_CM_ROUTE_QUERY)) 1845 1857 return -EINVAL; 1846 1858 1847 1859 atomic_inc(&id_priv->refcount); ··· 1870 1882 1871 1883 return 0; 1872 1884 err: 1873 - cma_comp_exch(id_priv, CMA_ROUTE_QUERY, CMA_ADDR_RESOLVED); 1885 + cma_comp_exch(id_priv, RDMA_CM_ROUTE_QUERY, RDMA_CM_ADDR_RESOLVED); 1874 1886 cma_deref_id(id_priv); 1875 1887 return ret; 1876 1888 } ··· 1929 1941 1930 1942 memset(&event, 0, sizeof event); 1931 1943 mutex_lock(&id_priv->handler_mutex); 1932 - if (!cma_comp_exch(id_priv, CMA_ADDR_QUERY, CMA_ADDR_RESOLVED)) 1944 + if (!cma_comp_exch(id_priv, RDMA_CM_ADDR_QUERY, 1945 + RDMA_CM_ADDR_RESOLVED)) 1933 1946 goto out; 1934 1947 1935 1948 if (!status && !id_priv->cma_dev) 1936 1949 status = cma_acquire_dev(id_priv); 1937 1950 1938 1951 if (status) { 1939 - if (!cma_comp_exch(id_priv, CMA_ADDR_RESOLVED, CMA_ADDR_BOUND)) 1952 + if (!cma_comp_exch(id_priv, RDMA_CM_ADDR_RESOLVED, 1953 + RDMA_CM_ADDR_BOUND)) 1940 1954 goto out; 1941 1955 event.event = RDMA_CM_EVENT_ADDR_ERROR; 1942 1956 event.status = status; ··· 1949 1959 } 1950 1960 1951 1961 if (id_priv->id.event_handler(&id_priv->id, &event)) { 1952 - cma_exch(id_priv, CMA_DESTROYING); 1962 + cma_exch(id_priv, RDMA_CM_DESTROYING); 1953 1963 mutex_unlock(&id_priv->handler_mutex); 1954 1964 cma_deref_id(id_priv); 1955 1965 rdma_destroy_id(&id_priv->id); ··· 1994 2004 1995 2005 work->id = id_priv; 1996 2006 INIT_WORK(&work->work, cma_work_handler); 1997 - work->old_state = CMA_ADDR_QUERY; 1998 - work->new_state = CMA_ADDR_RESOLVED; 2007 + work->old_state = RDMA_CM_ADDR_QUERY; 2008 + work->new_state = RDMA_CM_ADDR_RESOLVED; 1999 2009 work->event.event = RDMA_CM_EVENT_ADDR_RESOLVED; 2000 2010 queue_work(cma_wq, &work->work); 2001 2011 return 0; ··· 2024 2034 int ret; 2025 2035 2026 2036 id_priv = container_of(id, struct rdma_id_private, id); 2027 - if (id_priv->state == CMA_IDLE) { 2037 + if (id_priv->state == RDMA_CM_IDLE) { 2028 2038 ret = cma_bind_addr(id, src_addr, dst_addr); 2029 2039 if (ret) 2030 2040 return ret; 2031 2041 } 2032 2042 2033 - if (!cma_comp_exch(id_priv, CMA_ADDR_BOUND, CMA_ADDR_QUERY)) 2043 + if (!cma_comp_exch(id_priv, RDMA_CM_ADDR_BOUND, RDMA_CM_ADDR_QUERY)) 2034 2044 return -EINVAL; 2035 2045 2036 2046 atomic_inc(&id_priv->refcount); ··· 2046 2056 2047 2057 return 0; 2048 2058 err: 2049 - cma_comp_exch(id_priv, CMA_ADDR_QUERY, CMA_ADDR_BOUND); 2059 + cma_comp_exch(id_priv, RDMA_CM_ADDR_QUERY, RDMA_CM_ADDR_BOUND); 2050 2060 cma_deref_id(id_priv); 2051 2061 return ret; 2052 2062 } ··· 2060 2070 2061 2071 id_priv = container_of(id, struct rdma_id_private, id); 2062 2072 spin_lock_irqsave(&id_priv->lock, flags); 2063 - if (id_priv->state == CMA_IDLE) { 2073 + if (id_priv->state == RDMA_CM_IDLE) { 2064 2074 id_priv->reuseaddr = reuse; 2065 2075 ret = 0; 2066 2076 } else { ··· 2167 2177 if (id_priv == cur_id) 2168 2178 continue; 2169 2179 2170 - if ((cur_id->state == CMA_LISTEN) || 2180 + if ((cur_id->state == RDMA_CM_LISTEN) || 2171 2181 !reuseaddr || !cur_id->reuseaddr) { 2172 2182 cur_addr = (struct sockaddr *) &cur_id->id.route.addr.src_addr; 2173 2183 if (cma_any_addr(cur_addr)) ··· 2270 2280 int ret; 2271 2281 2272 2282 id_priv = container_of(id, struct rdma_id_private, id); 2273 - if (id_priv->state == CMA_IDLE) { 2283 + if (id_priv->state == RDMA_CM_IDLE) { 2274 2284 ((struct sockaddr *) &id->route.addr.src_addr)->sa_family = AF_INET; 2275 2285 ret = rdma_bind_addr(id, (struct sockaddr *) &id->route.addr.src_addr); 2276 2286 if (ret) 2277 2287 return ret; 2278 2288 } 2279 2289 2280 - if (!cma_comp_exch(id_priv, CMA_ADDR_BOUND, CMA_LISTEN)) 2290 + if (!cma_comp_exch(id_priv, RDMA_CM_ADDR_BOUND, RDMA_CM_LISTEN)) 2281 2291 return -EINVAL; 2282 2292 2283 2293 if (id_priv->reuseaddr) { ··· 2309 2319 return 0; 2310 2320 err: 2311 2321 id_priv->backlog = 0; 2312 - cma_comp_exch(id_priv, CMA_LISTEN, CMA_ADDR_BOUND); 2322 + cma_comp_exch(id_priv, RDMA_CM_LISTEN, RDMA_CM_ADDR_BOUND); 2313 2323 return ret; 2314 2324 } 2315 2325 EXPORT_SYMBOL(rdma_listen); ··· 2323 2333 return -EAFNOSUPPORT; 2324 2334 2325 2335 id_priv = container_of(id, struct rdma_id_private, id); 2326 - if (!cma_comp_exch(id_priv, CMA_IDLE, CMA_ADDR_BOUND)) 2336 + if (!cma_comp_exch(id_priv, RDMA_CM_IDLE, RDMA_CM_ADDR_BOUND)) 2327 2337 return -EINVAL; 2328 2338 2329 2339 ret = cma_check_linklocal(&id->route.addr.dev_addr, addr); ··· 2350 2360 if (id_priv->cma_dev) 2351 2361 cma_release_dev(id_priv); 2352 2362 err1: 2353 - cma_comp_exch(id_priv, CMA_ADDR_BOUND, CMA_IDLE); 2363 + cma_comp_exch(id_priv, RDMA_CM_ADDR_BOUND, RDMA_CM_IDLE); 2354 2364 return ret; 2355 2365 } 2356 2366 EXPORT_SYMBOL(rdma_bind_addr); ··· 2423 2433 struct ib_cm_sidr_rep_event_param *rep = &ib_event->param.sidr_rep_rcvd; 2424 2434 int ret = 0; 2425 2435 2426 - if (cma_disable_callback(id_priv, CMA_CONNECT)) 2436 + if (cma_disable_callback(id_priv, RDMA_CM_CONNECT)) 2427 2437 return 0; 2428 2438 2429 2439 memset(&event, 0, sizeof event); ··· 2469 2479 if (ret) { 2470 2480 /* Destroy the CM ID by returning a non-zero value. */ 2471 2481 id_priv->cm_id.ib = NULL; 2472 - cma_exch(id_priv, CMA_DESTROYING); 2482 + cma_exch(id_priv, RDMA_CM_DESTROYING); 2473 2483 mutex_unlock(&id_priv->handler_mutex); 2474 2484 rdma_destroy_id(&id_priv->id); 2475 2485 return ret; ··· 2635 2645 int ret; 2636 2646 2637 2647 id_priv = container_of(id, struct rdma_id_private, id); 2638 - if (!cma_comp_exch(id_priv, CMA_ROUTE_RESOLVED, CMA_CONNECT)) 2648 + if (!cma_comp_exch(id_priv, RDMA_CM_ROUTE_RESOLVED, RDMA_CM_CONNECT)) 2639 2649 return -EINVAL; 2640 2650 2641 2651 if (!id->qp) { ··· 2645 2655 2646 2656 switch (rdma_node_get_transport(id->device->node_type)) { 2647 2657 case RDMA_TRANSPORT_IB: 2648 - if (cma_is_ud_ps(id->ps)) 2658 + if (id->qp_type == IB_QPT_UD) 2649 2659 ret = cma_resolve_ib_udp(id_priv, conn_param); 2650 2660 else 2651 2661 ret = cma_connect_ib(id_priv, conn_param); ··· 2662 2672 2663 2673 return 0; 2664 2674 err: 2665 - cma_comp_exch(id_priv, CMA_CONNECT, CMA_ROUTE_RESOLVED); 2675 + cma_comp_exch(id_priv, RDMA_CM_CONNECT, RDMA_CM_ROUTE_RESOLVED); 2666 2676 return ret; 2667 2677 } 2668 2678 EXPORT_SYMBOL(rdma_connect); ··· 2748 2758 int ret; 2749 2759 2750 2760 id_priv = container_of(id, struct rdma_id_private, id); 2751 - if (!cma_comp(id_priv, CMA_CONNECT)) 2761 + 2762 + id_priv->owner = task_pid_nr(current); 2763 + 2764 + if (!cma_comp(id_priv, RDMA_CM_CONNECT)) 2752 2765 return -EINVAL; 2753 2766 2754 2767 if (!id->qp && conn_param) { ··· 2761 2768 2762 2769 switch (rdma_node_get_transport(id->device->node_type)) { 2763 2770 case RDMA_TRANSPORT_IB: 2764 - if (cma_is_ud_ps(id->ps)) 2771 + if (id->qp_type == IB_QPT_UD) 2765 2772 ret = cma_send_sidr_rep(id_priv, IB_SIDR_SUCCESS, 2766 2773 conn_param->private_data, 2767 2774 conn_param->private_data_len); ··· 2822 2829 2823 2830 switch (rdma_node_get_transport(id->device->node_type)) { 2824 2831 case RDMA_TRANSPORT_IB: 2825 - if (cma_is_ud_ps(id->ps)) 2832 + if (id->qp_type == IB_QPT_UD) 2826 2833 ret = cma_send_sidr_rep(id_priv, IB_SIDR_REJECT, 2827 2834 private_data, private_data_len); 2828 2835 else ··· 2880 2887 int ret; 2881 2888 2882 2889 id_priv = mc->id_priv; 2883 - if (cma_disable_callback(id_priv, CMA_ADDR_BOUND) && 2884 - cma_disable_callback(id_priv, CMA_ADDR_RESOLVED)) 2890 + if (cma_disable_callback(id_priv, RDMA_CM_ADDR_BOUND) && 2891 + cma_disable_callback(id_priv, RDMA_CM_ADDR_RESOLVED)) 2885 2892 return 0; 2886 2893 2887 2894 mutex_lock(&id_priv->qp_mutex); ··· 2905 2912 2906 2913 ret = id_priv->id.event_handler(&id_priv->id, &event); 2907 2914 if (ret) { 2908 - cma_exch(id_priv, CMA_DESTROYING); 2915 + cma_exch(id_priv, RDMA_CM_DESTROYING); 2909 2916 mutex_unlock(&id_priv->handler_mutex); 2910 2917 rdma_destroy_id(&id_priv->id); 2911 2918 return 0; ··· 3088 3095 int ret; 3089 3096 3090 3097 id_priv = container_of(id, struct rdma_id_private, id); 3091 - if (!cma_comp(id_priv, CMA_ADDR_BOUND) && 3092 - !cma_comp(id_priv, CMA_ADDR_RESOLVED)) 3098 + if (!cma_comp(id_priv, RDMA_CM_ADDR_BOUND) && 3099 + !cma_comp(id_priv, RDMA_CM_ADDR_RESOLVED)) 3093 3100 return -EINVAL; 3094 3101 3095 3102 mc = kmalloc(sizeof *mc, GFP_KERNEL); ··· 3254 3261 static int cma_remove_id_dev(struct rdma_id_private *id_priv) 3255 3262 { 3256 3263 struct rdma_cm_event event; 3257 - enum cma_state state; 3264 + enum rdma_cm_state state; 3258 3265 int ret = 0; 3259 3266 3260 3267 /* Record that we want to remove the device */ 3261 - state = cma_exch(id_priv, CMA_DEVICE_REMOVAL); 3262 - if (state == CMA_DESTROYING) 3268 + state = cma_exch(id_priv, RDMA_CM_DEVICE_REMOVAL); 3269 + if (state == RDMA_CM_DESTROYING) 3263 3270 return 0; 3264 3271 3265 3272 cma_cancel_operation(id_priv, state); 3266 3273 mutex_lock(&id_priv->handler_mutex); 3267 3274 3268 3275 /* Check for destruction from another callback. */ 3269 - if (!cma_comp(id_priv, CMA_DEVICE_REMOVAL)) 3276 + if (!cma_comp(id_priv, RDMA_CM_DEVICE_REMOVAL)) 3270 3277 goto out; 3271 3278 3272 3279 memset(&event, 0, sizeof event); ··· 3321 3328 kfree(cma_dev); 3322 3329 } 3323 3330 3331 + static int cma_get_id_stats(struct sk_buff *skb, struct netlink_callback *cb) 3332 + { 3333 + struct nlmsghdr *nlh; 3334 + struct rdma_cm_id_stats *id_stats; 3335 + struct rdma_id_private *id_priv; 3336 + struct rdma_cm_id *id = NULL; 3337 + struct cma_device *cma_dev; 3338 + int i_dev = 0, i_id = 0; 3339 + 3340 + /* 3341 + * We export all of the IDs as a sequence of messages. Each 3342 + * ID gets its own netlink message. 3343 + */ 3344 + mutex_lock(&lock); 3345 + 3346 + list_for_each_entry(cma_dev, &dev_list, list) { 3347 + if (i_dev < cb->args[0]) { 3348 + i_dev++; 3349 + continue; 3350 + } 3351 + 3352 + i_id = 0; 3353 + list_for_each_entry(id_priv, &cma_dev->id_list, list) { 3354 + if (i_id < cb->args[1]) { 3355 + i_id++; 3356 + continue; 3357 + } 3358 + 3359 + id_stats = ibnl_put_msg(skb, &nlh, cb->nlh->nlmsg_seq, 3360 + sizeof *id_stats, RDMA_NL_RDMA_CM, 3361 + RDMA_NL_RDMA_CM_ID_STATS); 3362 + if (!id_stats) 3363 + goto out; 3364 + 3365 + memset(id_stats, 0, sizeof *id_stats); 3366 + id = &id_priv->id; 3367 + id_stats->node_type = id->route.addr.dev_addr.dev_type; 3368 + id_stats->port_num = id->port_num; 3369 + id_stats->bound_dev_if = 3370 + id->route.addr.dev_addr.bound_dev_if; 3371 + 3372 + if (id->route.addr.src_addr.ss_family == AF_INET) { 3373 + if (ibnl_put_attr(skb, nlh, 3374 + sizeof(struct sockaddr_in), 3375 + &id->route.addr.src_addr, 3376 + RDMA_NL_RDMA_CM_ATTR_SRC_ADDR)) { 3377 + goto out; 3378 + } 3379 + if (ibnl_put_attr(skb, nlh, 3380 + sizeof(struct sockaddr_in), 3381 + &id->route.addr.dst_addr, 3382 + RDMA_NL_RDMA_CM_ATTR_DST_ADDR)) { 3383 + goto out; 3384 + } 3385 + } else if (id->route.addr.src_addr.ss_family == AF_INET6) { 3386 + if (ibnl_put_attr(skb, nlh, 3387 + sizeof(struct sockaddr_in6), 3388 + &id->route.addr.src_addr, 3389 + RDMA_NL_RDMA_CM_ATTR_SRC_ADDR)) { 3390 + goto out; 3391 + } 3392 + if (ibnl_put_attr(skb, nlh, 3393 + sizeof(struct sockaddr_in6), 3394 + &id->route.addr.dst_addr, 3395 + RDMA_NL_RDMA_CM_ATTR_DST_ADDR)) { 3396 + goto out; 3397 + } 3398 + } 3399 + 3400 + id_stats->pid = id_priv->owner; 3401 + id_stats->port_space = id->ps; 3402 + id_stats->cm_state = id_priv->state; 3403 + id_stats->qp_num = id_priv->qp_num; 3404 + id_stats->qp_type = id->qp_type; 3405 + 3406 + i_id++; 3407 + } 3408 + 3409 + cb->args[1] = 0; 3410 + i_dev++; 3411 + } 3412 + 3413 + out: 3414 + mutex_unlock(&lock); 3415 + cb->args[0] = i_dev; 3416 + cb->args[1] = i_id; 3417 + 3418 + return skb->len; 3419 + } 3420 + 3421 + static const struct ibnl_client_cbs cma_cb_table[] = { 3422 + [RDMA_NL_RDMA_CM_ID_STATS] = { .dump = cma_get_id_stats }, 3423 + }; 3424 + 3324 3425 static int __init cma_init(void) 3325 3426 { 3326 3427 int ret; ··· 3430 3343 ret = ib_register_client(&cma_client); 3431 3344 if (ret) 3432 3345 goto err; 3346 + 3347 + if (ibnl_add_client(RDMA_NL_RDMA_CM, RDMA_NL_RDMA_CM_NUM_OPS, cma_cb_table)) 3348 + printk(KERN_WARNING "RDMA CMA: failed to add netlink callback\n"); 3349 + 3433 3350 return 0; 3434 3351 3435 3352 err: ··· 3446 3355 3447 3356 static void __exit cma_cleanup(void) 3448 3357 { 3358 + ibnl_remove_client(RDMA_NL_RDMA_CM); 3449 3359 ib_unregister_client(&cma_client); 3450 3360 unregister_netdevice_notifier(&cma_nb); 3451 3361 rdma_addr_unregister_client(&addr_client);
+22 -3
drivers/infiniband/core/device.c
··· 38 38 #include <linux/slab.h> 39 39 #include <linux/init.h> 40 40 #include <linux/mutex.h> 41 + #include <rdma/rdma_netlink.h> 41 42 42 43 #include "core_priv.h" 43 44 ··· 726 725 return -ENOMEM; 727 726 728 727 ret = ib_sysfs_setup(); 729 - if (ret) 728 + if (ret) { 730 729 printk(KERN_WARNING "Couldn't create InfiniBand device class\n"); 730 + goto err; 731 + } 732 + 733 + ret = ibnl_init(); 734 + if (ret) { 735 + printk(KERN_WARNING "Couldn't init IB netlink interface\n"); 736 + goto err_sysfs; 737 + } 731 738 732 739 ret = ib_cache_setup(); 733 740 if (ret) { 734 741 printk(KERN_WARNING "Couldn't set up InfiniBand P_Key/GID cache\n"); 735 - ib_sysfs_cleanup(); 736 - destroy_workqueue(ib_wq); 742 + goto err_nl; 737 743 } 738 744 745 + return 0; 746 + 747 + err_nl: 748 + ibnl_cleanup(); 749 + 750 + err_sysfs: 751 + ib_sysfs_cleanup(); 752 + 753 + err: 754 + destroy_workqueue(ib_wq); 739 755 return ret; 740 756 } 741 757 742 758 static void __exit ib_core_cleanup(void) 743 759 { 744 760 ib_cache_cleanup(); 761 + ibnl_cleanup(); 745 762 ib_sysfs_cleanup(); 746 763 /* Make sure that any pending umem accounting work is done. */ 747 764 destroy_workqueue(ib_wq);
+7
drivers/infiniband/core/mad.c
··· 276 276 goto error1; 277 277 } 278 278 279 + /* Verify the QP requested is supported. For example, Ethernet devices 280 + * will not have QP0 */ 281 + if (!port_priv->qp_info[qpn].qp) { 282 + ret = ERR_PTR(-EPROTONOSUPPORT); 283 + goto error1; 284 + } 285 + 279 286 /* Allocate structures */ 280 287 mad_agent_priv = kzalloc(sizeof *mad_agent_priv, GFP_KERNEL); 281 288 if (!mad_agent_priv) {
+190
drivers/infiniband/core/netlink.c
··· 1 + /* 2 + * Copyright (c) 2010 Voltaire Inc. All rights reserved. 3 + * 4 + * This software is available to you under a choice of one of two 5 + * licenses. You may choose to be licensed under the terms of the GNU 6 + * General Public License (GPL) Version 2, available from the file 7 + * COPYING in the main directory of this source tree, or the 8 + * OpenIB.org BSD license below: 9 + * 10 + * Redistribution and use in source and binary forms, with or 11 + * without modification, are permitted provided that the following 12 + * conditions are met: 13 + * 14 + * - Redistributions of source code must retain the above 15 + * copyright notice, this list of conditions and the following 16 + * disclaimer. 17 + * 18 + * - Redistributions in binary form must reproduce the above 19 + * copyright notice, this list of conditions and the following 20 + * disclaimer in the documentation and/or other materials 21 + * provided with the distribution. 22 + * 23 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 27 + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 28 + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 29 + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 + * SOFTWARE. 31 + */ 32 + 33 + #define pr_fmt(fmt) "%s:%s: " fmt, KBUILD_MODNAME, __func__ 34 + 35 + #include <net/netlink.h> 36 + #include <net/net_namespace.h> 37 + #include <net/sock.h> 38 + #include <rdma/rdma_netlink.h> 39 + 40 + struct ibnl_client { 41 + struct list_head list; 42 + int index; 43 + int nops; 44 + const struct ibnl_client_cbs *cb_table; 45 + }; 46 + 47 + static DEFINE_MUTEX(ibnl_mutex); 48 + static struct sock *nls; 49 + static LIST_HEAD(client_list); 50 + 51 + int ibnl_add_client(int index, int nops, 52 + const struct ibnl_client_cbs cb_table[]) 53 + { 54 + struct ibnl_client *cur; 55 + struct ibnl_client *nl_client; 56 + 57 + nl_client = kmalloc(sizeof *nl_client, GFP_KERNEL); 58 + if (!nl_client) 59 + return -ENOMEM; 60 + 61 + nl_client->index = index; 62 + nl_client->nops = nops; 63 + nl_client->cb_table = cb_table; 64 + 65 + mutex_lock(&ibnl_mutex); 66 + 67 + list_for_each_entry(cur, &client_list, list) { 68 + if (cur->index == index) { 69 + pr_warn("Client for %d already exists\n", index); 70 + mutex_unlock(&ibnl_mutex); 71 + kfree(nl_client); 72 + return -EINVAL; 73 + } 74 + } 75 + 76 + list_add_tail(&nl_client->list, &client_list); 77 + 78 + mutex_unlock(&ibnl_mutex); 79 + 80 + return 0; 81 + } 82 + EXPORT_SYMBOL(ibnl_add_client); 83 + 84 + int ibnl_remove_client(int index) 85 + { 86 + struct ibnl_client *cur, *next; 87 + 88 + mutex_lock(&ibnl_mutex); 89 + list_for_each_entry_safe(cur, next, &client_list, list) { 90 + if (cur->index == index) { 91 + list_del(&(cur->list)); 92 + mutex_unlock(&ibnl_mutex); 93 + kfree(cur); 94 + return 0; 95 + } 96 + } 97 + pr_warn("Can't remove callback for client idx %d. Not found\n", index); 98 + mutex_unlock(&ibnl_mutex); 99 + 100 + return -EINVAL; 101 + } 102 + EXPORT_SYMBOL(ibnl_remove_client); 103 + 104 + void *ibnl_put_msg(struct sk_buff *skb, struct nlmsghdr **nlh, int seq, 105 + int len, int client, int op) 106 + { 107 + unsigned char *prev_tail; 108 + 109 + prev_tail = skb_tail_pointer(skb); 110 + *nlh = NLMSG_NEW(skb, 0, seq, RDMA_NL_GET_TYPE(client, op), 111 + len, NLM_F_MULTI); 112 + (*nlh)->nlmsg_len = skb_tail_pointer(skb) - prev_tail; 113 + return NLMSG_DATA(*nlh); 114 + 115 + nlmsg_failure: 116 + nlmsg_trim(skb, prev_tail); 117 + return NULL; 118 + } 119 + EXPORT_SYMBOL(ibnl_put_msg); 120 + 121 + int ibnl_put_attr(struct sk_buff *skb, struct nlmsghdr *nlh, 122 + int len, void *data, int type) 123 + { 124 + unsigned char *prev_tail; 125 + 126 + prev_tail = skb_tail_pointer(skb); 127 + NLA_PUT(skb, type, len, data); 128 + nlh->nlmsg_len += skb_tail_pointer(skb) - prev_tail; 129 + return 0; 130 + 131 + nla_put_failure: 132 + nlmsg_trim(skb, prev_tail - nlh->nlmsg_len); 133 + return -EMSGSIZE; 134 + } 135 + EXPORT_SYMBOL(ibnl_put_attr); 136 + 137 + static int ibnl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) 138 + { 139 + struct ibnl_client *client; 140 + int type = nlh->nlmsg_type; 141 + int index = RDMA_NL_GET_CLIENT(type); 142 + int op = RDMA_NL_GET_OP(type); 143 + 144 + list_for_each_entry(client, &client_list, list) { 145 + if (client->index == index) { 146 + if (op < 0 || op >= client->nops || 147 + !client->cb_table[RDMA_NL_GET_OP(op)].dump) 148 + return -EINVAL; 149 + return netlink_dump_start(nls, skb, nlh, 150 + client->cb_table[op].dump, 151 + NULL); 152 + } 153 + } 154 + 155 + pr_info("Index %d wasn't found in client list\n", index); 156 + return -EINVAL; 157 + } 158 + 159 + static void ibnl_rcv(struct sk_buff *skb) 160 + { 161 + mutex_lock(&ibnl_mutex); 162 + netlink_rcv_skb(skb, &ibnl_rcv_msg); 163 + mutex_unlock(&ibnl_mutex); 164 + } 165 + 166 + int __init ibnl_init(void) 167 + { 168 + nls = netlink_kernel_create(&init_net, NETLINK_RDMA, 0, ibnl_rcv, 169 + NULL, THIS_MODULE); 170 + if (!nls) { 171 + pr_warn("Failed to create netlink socket\n"); 172 + return -ENOMEM; 173 + } 174 + 175 + return 0; 176 + } 177 + 178 + void ibnl_cleanup(void) 179 + { 180 + struct ibnl_client *cur, *next; 181 + 182 + mutex_lock(&ibnl_mutex); 183 + list_for_each_entry_safe(cur, next, &client_list, list) { 184 + list_del(&(cur->list)); 185 + kfree(cur); 186 + } 187 + mutex_unlock(&ibnl_mutex); 188 + 189 + netlink_kernel_release(nls); 190 + }
+28 -7
drivers/infiniband/core/ucma.c
··· 367 367 return ret; 368 368 } 369 369 370 - static ssize_t ucma_create_id(struct ucma_file *file, 371 - const char __user *inbuf, 372 - int in_len, int out_len) 370 + static int ucma_get_qp_type(struct rdma_ucm_create_id *cmd, enum ib_qp_type *qp_type) 371 + { 372 + switch (cmd->ps) { 373 + case RDMA_PS_TCP: 374 + *qp_type = IB_QPT_RC; 375 + return 0; 376 + case RDMA_PS_UDP: 377 + case RDMA_PS_IPOIB: 378 + *qp_type = IB_QPT_UD; 379 + return 0; 380 + default: 381 + return -EINVAL; 382 + } 383 + } 384 + 385 + static ssize_t ucma_create_id(struct ucma_file *file, const char __user *inbuf, 386 + int in_len, int out_len) 373 387 { 374 388 struct rdma_ucm_create_id cmd; 375 389 struct rdma_ucm_create_id_resp resp; 376 390 struct ucma_context *ctx; 391 + enum ib_qp_type qp_type; 377 392 int ret; 378 393 379 394 if (out_len < sizeof(resp)) ··· 397 382 if (copy_from_user(&cmd, inbuf, sizeof(cmd))) 398 383 return -EFAULT; 399 384 385 + ret = ucma_get_qp_type(&cmd, &qp_type); 386 + if (ret) 387 + return ret; 388 + 400 389 mutex_lock(&file->mut); 401 390 ctx = ucma_alloc_ctx(file); 402 391 mutex_unlock(&file->mut); ··· 408 389 return -ENOMEM; 409 390 410 391 ctx->uid = cmd.uid; 411 - ctx->cm_id = rdma_create_id(ucma_event_handler, ctx, cmd.ps); 392 + ctx->cm_id = rdma_create_id(ucma_event_handler, ctx, cmd.ps, qp_type); 412 393 if (IS_ERR(ctx->cm_id)) { 413 394 ret = PTR_ERR(ctx->cm_id); 414 395 goto err1; ··· 1357 1338 }; 1358 1339 1359 1340 static struct miscdevice ucma_misc = { 1360 - .minor = MISC_DYNAMIC_MINOR, 1361 - .name = "rdma_cm", 1362 - .fops = &ucma_fops, 1341 + .minor = MISC_DYNAMIC_MINOR, 1342 + .name = "rdma_cm", 1343 + .nodename = "infiniband/rdma_cm", 1344 + .mode = 0666, 1345 + .fops = &ucma_fops, 1363 1346 }; 1364 1347 1365 1348 static ssize_t show_abi_version(struct device *dev,
+7
drivers/infiniband/core/user_mad.c
··· 1176 1176 kref_put(&umad_dev->ref, ib_umad_release_dev); 1177 1177 } 1178 1178 1179 + static char *umad_devnode(struct device *dev, mode_t *mode) 1180 + { 1181 + return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev)); 1182 + } 1183 + 1179 1184 static int __init ib_umad_init(void) 1180 1185 { 1181 1186 int ret; ··· 1198 1193 printk(KERN_ERR "user_mad: couldn't create class infiniband_mad\n"); 1199 1194 goto out_chrdev; 1200 1195 } 1196 + 1197 + umad_class->devnode = umad_devnode; 1201 1198 1202 1199 ret = class_create_file(umad_class, &class_attr_abi_version.attr); 1203 1200 if (ret) {
+8
drivers/infiniband/core/uverbs_main.c
··· 824 824 kfree(uverbs_dev); 825 825 } 826 826 827 + static char *uverbs_devnode(struct device *dev, mode_t *mode) 828 + { 829 + *mode = 0666; 830 + return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev)); 831 + } 832 + 827 833 static int __init ib_uverbs_init(void) 828 834 { 829 835 int ret; ··· 847 841 printk(KERN_ERR "user_verbs: couldn't create class infiniband_verbs\n"); 848 842 goto out_chrdev; 849 843 } 844 + 845 + uverbs_class->devnode = uverbs_devnode; 850 846 851 847 ret = class_create_file(uverbs_class, &class_attr_abi_version.attr); 852 848 if (ret) {
+17 -9
drivers/infiniband/hw/cxgb3/iwch_cm.c
··· 914 914 goto err; 915 915 916 916 if (peer2peer && iwch_rqes_posted(ep->com.qp) == 0) { 917 - iwch_post_zb_read(ep->com.qp); 917 + iwch_post_zb_read(ep); 918 918 } 919 919 920 920 goto out; ··· 1078 1078 struct iwch_ep *ep = ctx; 1079 1079 struct cpl_wr_ack *hdr = cplhdr(skb); 1080 1080 unsigned int credits = ntohs(hdr->credits); 1081 + unsigned long flags; 1082 + int post_zb = 0; 1081 1083 1082 1084 PDBG("%s ep %p credits %u\n", __func__, ep, credits); 1083 1085 ··· 1089 1087 return CPL_RET_BUF_DONE; 1090 1088 } 1091 1089 1090 + spin_lock_irqsave(&ep->com.lock, flags); 1092 1091 BUG_ON(credits != 1); 1093 1092 dst_confirm(ep->dst); 1094 1093 if (!ep->mpa_skb) { 1095 1094 PDBG("%s rdma_init wr_ack ep %p state %u\n", 1096 - __func__, ep, state_read(&ep->com)); 1095 + __func__, ep, ep->com.state); 1097 1096 if (ep->mpa_attr.initiator) { 1098 1097 PDBG("%s initiator ep %p state %u\n", 1099 - __func__, ep, state_read(&ep->com)); 1100 - if (peer2peer) 1101 - iwch_post_zb_read(ep->com.qp); 1098 + __func__, ep, ep->com.state); 1099 + if (peer2peer && ep->com.state == FPDU_MODE) 1100 + post_zb = 1; 1102 1101 } else { 1103 1102 PDBG("%s responder ep %p state %u\n", 1104 - __func__, ep, state_read(&ep->com)); 1105 - ep->com.rpl_done = 1; 1106 - wake_up(&ep->com.waitq); 1103 + __func__, ep, ep->com.state); 1104 + if (ep->com.state == MPA_REQ_RCVD) { 1105 + ep->com.rpl_done = 1; 1106 + wake_up(&ep->com.waitq); 1107 + } 1107 1108 } 1108 1109 } else { 1109 1110 PDBG("%s lsm ack ep %p state %u freeing skb\n", 1110 - __func__, ep, state_read(&ep->com)); 1111 + __func__, ep, ep->com.state); 1111 1112 kfree_skb(ep->mpa_skb); 1112 1113 ep->mpa_skb = NULL; 1113 1114 } 1115 + spin_unlock_irqrestore(&ep->com.lock, flags); 1116 + if (post_zb) 1117 + iwch_post_zb_read(ep); 1114 1118 return CPL_RET_BUF_DONE; 1115 1119 } 1116 1120
+1 -1
drivers/infiniband/hw/cxgb3/iwch_provider.h
··· 332 332 struct ib_mw_bind *mw_bind); 333 333 int iwch_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *wc); 334 334 int iwch_post_terminate(struct iwch_qp *qhp, struct respQ_msg_t *rsp_msg); 335 - int iwch_post_zb_read(struct iwch_qp *qhp); 335 + int iwch_post_zb_read(struct iwch_ep *ep); 336 336 int iwch_register_device(struct iwch_dev *dev); 337 337 void iwch_unregister_device(struct iwch_dev *dev); 338 338 void stop_read_rep_timer(struct iwch_qp *qhp);
+3 -3
drivers/infiniband/hw/cxgb3/iwch_qp.c
··· 738 738 } 739 739 } 740 740 741 - int iwch_post_zb_read(struct iwch_qp *qhp) 741 + int iwch_post_zb_read(struct iwch_ep *ep) 742 742 { 743 743 union t3_wr *wqe; 744 744 struct sk_buff *skb; ··· 761 761 wqe->read.local_len = cpu_to_be32(0); 762 762 wqe->read.local_to = cpu_to_be64(1); 763 763 wqe->send.wrh.op_seop_flags = cpu_to_be32(V_FW_RIWR_OP(T3_WR_READ)); 764 - wqe->send.wrh.gen_tid_len = cpu_to_be32(V_FW_RIWR_TID(qhp->ep->hwtid)| 764 + wqe->send.wrh.gen_tid_len = cpu_to_be32(V_FW_RIWR_TID(ep->hwtid)| 765 765 V_FW_RIWR_LEN(flit_cnt)); 766 766 skb->priority = CPL_PRIORITY_DATA; 767 - return iwch_cxgb3_ofld_send(qhp->rhp->rdev.t3cdev_p, skb); 767 + return iwch_cxgb3_ofld_send(ep->com.qp->rhp->rdev.t3cdev_p, skb); 768 768 } 769 769 770 770 /*
+5 -13
drivers/infiniband/hw/cxgb4/iw_cxgb4.h
··· 35 35 #include <linux/list.h> 36 36 #include <linux/spinlock.h> 37 37 #include <linux/idr.h> 38 - #include <linux/workqueue.h> 38 + #include <linux/completion.h> 39 39 #include <linux/netdevice.h> 40 40 #include <linux/sched.h> 41 41 #include <linux/pci.h> ··· 131 131 132 132 #define C4IW_WR_TO (10*HZ) 133 133 134 - enum { 135 - REPLY_READY = 0, 136 - }; 137 - 138 134 struct c4iw_wr_wait { 139 - wait_queue_head_t wait; 140 - unsigned long status; 135 + struct completion completion; 141 136 int ret; 142 137 }; 143 138 144 139 static inline void c4iw_init_wr_wait(struct c4iw_wr_wait *wr_waitp) 145 140 { 146 141 wr_waitp->ret = 0; 147 - wr_waitp->status = 0; 148 - init_waitqueue_head(&wr_waitp->wait); 142 + init_completion(&wr_waitp->completion); 149 143 } 150 144 151 145 static inline void c4iw_wake_up(struct c4iw_wr_wait *wr_waitp, int ret) 152 146 { 153 147 wr_waitp->ret = ret; 154 - set_bit(REPLY_READY, &wr_waitp->status); 155 - wake_up(&wr_waitp->wait); 148 + complete(&wr_waitp->completion); 156 149 } 157 150 158 151 static inline int c4iw_wait_for_reply(struct c4iw_rdev *rdev, ··· 157 164 int ret; 158 165 159 166 do { 160 - ret = wait_event_timeout(wr_waitp->wait, 161 - test_and_clear_bit(REPLY_READY, &wr_waitp->status), to); 167 + ret = wait_for_completion_timeout(&wr_waitp->completion, to); 162 168 if (!ret) { 163 169 printk(KERN_ERR MOD "%s - Device %s not responding - " 164 170 "tid %u qpid %u\n", func,
+3 -1
drivers/infiniband/hw/nes/nes.c
··· 1138 1138 u32 i = 0; 1139 1139 struct nes_device *nesdev; 1140 1140 1141 - strict_strtoul(buf, 0, &wqm_quanta_value); 1141 + if (kstrtoul(buf, 0, &wqm_quanta_value) < 0) 1142 + return -EINVAL; 1143 + 1142 1144 list_for_each_entry(nesdev, &nes_dev_list, list) { 1143 1145 if (i == ee_flsh_adapter) { 1144 1146 nesdev->nesadapter->wqm_quanta = wqm_quanta_value;
+1 -1
drivers/infiniband/hw/qib/Kconfig
··· 1 1 config INFINIBAND_QIB 2 2 tristate "QLogic PCIe HCA support" 3 - depends on 64BIT && NET 3 + depends on 64BIT 4 4 ---help--- 5 5 This is a low-level driver for QLogic PCIe QLE InfiniBand host 6 6 channel adapters. This driver does not support the QLogic
+1 -1
drivers/infiniband/ulp/iser/iser_verbs.c
··· 548 548 iser_conn_get(ib_conn); /* ref ib conn's cma id */ 549 549 ib_conn->cma_id = rdma_create_id(iser_cma_handler, 550 550 (void *)ib_conn, 551 - RDMA_PS_TCP); 551 + RDMA_PS_TCP, IB_QPT_RC); 552 552 if (IS_ERR(ib_conn->cma_id)) { 553 553 err = PTR_ERR(ib_conn->cma_id); 554 554 iser_err("rdma_create_id failed: %d\n", err);
+2 -2
drivers/infiniband/ulp/srp/ib_srp.c
··· 1147 1147 static void srp_handle_recv(struct srp_target_port *target, struct ib_wc *wc) 1148 1148 { 1149 1149 struct ib_device *dev = target->srp_host->srp_dev->dev; 1150 - struct srp_iu *iu = (struct srp_iu *) wc->wr_id; 1150 + struct srp_iu *iu = (struct srp_iu *) (uintptr_t) wc->wr_id; 1151 1151 int res; 1152 1152 u8 opcode; 1153 1153 ··· 1231 1231 break; 1232 1232 } 1233 1233 1234 - iu = (struct srp_iu *) wc.wr_id; 1234 + iu = (struct srp_iu *) (uintptr_t) wc.wr_id; 1235 1235 list_add(&iu->list, &target->free_tx); 1236 1236 } 1237 1237 }
+1
include/linux/netlink.h
··· 24 24 /* leave room for NETLINK_DM (DM Events) */ 25 25 #define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */ 26 26 #define NETLINK_ECRYPTFS 19 27 + #define NETLINK_RDMA 20 27 28 28 29 #define MAX_LINKS 32 29 30
+5
include/rdma/Kbuild
··· 1 + header-y += ib_user_cm.h 1 2 header-y += ib_user_mad.h 3 + header-y += ib_user_sa.h 4 + header-y += ib_user_verbs.h 5 + header-y += rdma_netlink.h 6 + header-y += rdma_user_cm.h
+1
include/rdma/ib_user_cm.h
··· 34 34 #ifndef IB_USER_CM_H 35 35 #define IB_USER_CM_H 36 36 37 + #include <linux/types.h> 37 38 #include <rdma/ib_user_sa.h> 38 39 39 40 #define IB_USER_CM_ABI_VERSION 5
+18 -1
include/rdma/rdma_cm.h
··· 111 111 } param; 112 112 }; 113 113 114 + enum rdma_cm_state { 115 + RDMA_CM_IDLE, 116 + RDMA_CM_ADDR_QUERY, 117 + RDMA_CM_ADDR_RESOLVED, 118 + RDMA_CM_ROUTE_QUERY, 119 + RDMA_CM_ROUTE_RESOLVED, 120 + RDMA_CM_CONNECT, 121 + RDMA_CM_DISCONNECT, 122 + RDMA_CM_ADDR_BOUND, 123 + RDMA_CM_LISTEN, 124 + RDMA_CM_DEVICE_REMOVAL, 125 + RDMA_CM_DESTROYING 126 + }; 127 + 114 128 struct rdma_cm_id; 115 129 116 130 /** ··· 144 130 rdma_cm_event_handler event_handler; 145 131 struct rdma_route route; 146 132 enum rdma_port_space ps; 133 + enum ib_qp_type qp_type; 147 134 u8 port_num; 148 135 }; 149 136 ··· 155 140 * returned rdma_id. 156 141 * @context: User specified context associated with the id. 157 142 * @ps: RDMA port space. 143 + * @qp_type: type of queue pair associated with the id. 158 144 */ 159 145 struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler, 160 - void *context, enum rdma_port_space ps); 146 + void *context, enum rdma_port_space ps, 147 + enum ib_qp_type qp_type); 161 148 162 149 /** 163 150 * rdma_destroy_id - Destroys an RDMA identifier.
+92
include/rdma/rdma_netlink.h
··· 1 + #ifndef _RDMA_NETLINK_H 2 + #define _RDMA_NETLINK_H 3 + 4 + #include <linux/types.h> 5 + 6 + enum { 7 + RDMA_NL_RDMA_CM = 1 8 + }; 9 + 10 + #define RDMA_NL_GET_CLIENT(type) ((type & (((1 << 6) - 1) << 10)) >> 10) 11 + #define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1)) 12 + #define RDMA_NL_GET_TYPE(client, op) ((client << 10) + op) 13 + 14 + enum { 15 + RDMA_NL_RDMA_CM_ID_STATS = 0, 16 + RDMA_NL_RDMA_CM_NUM_OPS 17 + }; 18 + 19 + enum { 20 + RDMA_NL_RDMA_CM_ATTR_SRC_ADDR = 1, 21 + RDMA_NL_RDMA_CM_ATTR_DST_ADDR, 22 + RDMA_NL_RDMA_CM_NUM_ATTR, 23 + }; 24 + 25 + struct rdma_cm_id_stats { 26 + __u32 qp_num; 27 + __u32 bound_dev_if; 28 + __u32 port_space; 29 + __s32 pid; 30 + __u8 cm_state; 31 + __u8 node_type; 32 + __u8 port_num; 33 + __u8 qp_type; 34 + }; 35 + 36 + #ifdef __KERNEL__ 37 + 38 + #include <linux/netlink.h> 39 + 40 + struct ibnl_client_cbs { 41 + int (*dump)(struct sk_buff *skb, struct netlink_callback *nlcb); 42 + }; 43 + 44 + int ibnl_init(void); 45 + void ibnl_cleanup(void); 46 + 47 + /** 48 + * Add a a client to the list of IB netlink exporters. 49 + * @index: Index of the added client 50 + * @nops: Number of supported ops by the added client. 51 + * @cb_table: A table for op->callback 52 + * 53 + * Returns 0 on success or a negative error code. 54 + */ 55 + int ibnl_add_client(int index, int nops, 56 + const struct ibnl_client_cbs cb_table[]); 57 + 58 + /** 59 + * Remove a client from IB netlink. 60 + * @index: Index of the removed IB client. 61 + * 62 + * Returns 0 on success or a negative error code. 63 + */ 64 + int ibnl_remove_client(int index); 65 + 66 + /** 67 + * Put a new message in a supplied skb. 68 + * @skb: The netlink skb. 69 + * @nlh: Pointer to put the header of the new netlink message. 70 + * @seq: The message sequence number. 71 + * @len: The requested message length to allocate. 72 + * @client: Calling IB netlink client. 73 + * @op: message content op. 74 + * Returns the allocated buffer on success and NULL on failure. 75 + */ 76 + void *ibnl_put_msg(struct sk_buff *skb, struct nlmsghdr **nlh, int seq, 77 + int len, int client, int op); 78 + /** 79 + * Put a new attribute in a supplied skb. 80 + * @skb: The netlink skb. 81 + * @nlh: Header of the netlink message to append the attribute to. 82 + * @len: The length of the attribute data. 83 + * @data: The attribute data to put. 84 + * @type: The attribute type. 85 + * Returns the 0 and a negative error code on failure. 86 + */ 87 + int ibnl_put_attr(struct sk_buff *skb, struct nlmsghdr *nlh, 88 + int len, void *data, int type); 89 + 90 + #endif /* __KERNEL__ */ 91 + 92 + #endif /* _RDMA_NETLINK_H */
+2 -1
net/9p/trans_rdma.c
··· 589 589 return -ENOMEM; 590 590 591 591 /* Create the RDMA CM ID */ 592 - rdma->cm_id = rdma_create_id(p9_cm_event_handler, client, RDMA_PS_TCP); 592 + rdma->cm_id = rdma_create_id(p9_cm_event_handler, client, RDMA_PS_TCP, 593 + IB_QPT_RC); 593 594 if (IS_ERR(rdma->cm_id)) 594 595 goto error; 595 596
+1 -1
net/rds/ib.c
··· 325 325 /* Create a CMA ID and try to bind it. This catches both 326 326 * IB and iWARP capable NICs. 327 327 */ 328 - cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP); 328 + cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP, IB_QPT_RC); 329 329 if (IS_ERR(cm_id)) 330 330 return PTR_ERR(cm_id); 331 331
+1 -1
net/rds/ib_cm.c
··· 587 587 /* XXX I wonder what affect the port space has */ 588 588 /* delegate cm event handler to rdma_transport */ 589 589 ic->i_cm_id = rdma_create_id(rds_rdma_cm_event_handler, conn, 590 - RDMA_PS_TCP); 590 + RDMA_PS_TCP, IB_QPT_RC); 591 591 if (IS_ERR(ic->i_cm_id)) { 592 592 ret = PTR_ERR(ic->i_cm_id); 593 593 ic->i_cm_id = NULL;
+1 -1
net/rds/iw.c
··· 226 226 /* Create a CMA ID and try to bind it. This catches both 227 227 * IB and iWARP capable NICs. 228 228 */ 229 - cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP); 229 + cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP, IB_QPT_RC); 230 230 if (IS_ERR(cm_id)) 231 231 return PTR_ERR(cm_id); 232 232
+1 -1
net/rds/iw_cm.c
··· 522 522 /* XXX I wonder what affect the port space has */ 523 523 /* delegate cm event handler to rdma_transport */ 524 524 ic->i_cm_id = rdma_create_id(rds_rdma_cm_event_handler, conn, 525 - RDMA_PS_TCP); 525 + RDMA_PS_TCP, IB_QPT_RC); 526 526 if (IS_ERR(ic->i_cm_id)) { 527 527 ret = PTR_ERR(ic->i_cm_id); 528 528 ic->i_cm_id = NULL;
+2 -1
net/rds/rdma_transport.c
··· 158 158 struct rdma_cm_id *cm_id; 159 159 int ret; 160 160 161 - cm_id = rdma_create_id(rds_rdma_cm_event_handler, NULL, RDMA_PS_TCP); 161 + cm_id = rdma_create_id(rds_rdma_cm_event_handler, NULL, RDMA_PS_TCP, 162 + IB_QPT_RC); 162 163 if (IS_ERR(cm_id)) { 163 164 ret = PTR_ERR(cm_id); 164 165 printk(KERN_ERR "RDS/RDMA: failed to setup listener, "
+2 -1
net/sunrpc/xprtrdma/svc_rdma_transport.c
··· 695 695 return ERR_PTR(-ENOMEM); 696 696 xprt = &cma_xprt->sc_xprt; 697 697 698 - listen_id = rdma_create_id(rdma_listen_handler, cma_xprt, RDMA_PS_TCP); 698 + listen_id = rdma_create_id(rdma_listen_handler, cma_xprt, RDMA_PS_TCP, 699 + IB_QPT_RC); 699 700 if (IS_ERR(listen_id)) { 700 701 ret = PTR_ERR(listen_id); 701 702 dprintk("svcrdma: rdma_create_id failed = %d\n", ret);
+1 -1
net/sunrpc/xprtrdma/verbs.c
··· 387 387 388 388 init_completion(&ia->ri_done); 389 389 390 - id = rdma_create_id(rpcrdma_conn_upcall, xprt, RDMA_PS_TCP); 390 + id = rdma_create_id(rpcrdma_conn_upcall, xprt, RDMA_PS_TCP, IB_QPT_RC); 391 391 if (IS_ERR(id)) { 392 392 rc = PTR_ERR(id); 393 393 dprintk("RPC: %s: rdma_create_id() failed %i\n",