diff options
author | Guy Shapiro <guysh@mellanox.com> | 2015-10-22 08:20:10 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-10-28 12:32:48 -0400 |
commit | fa20105e09e97e81aadf02f722c31195e4a75c84 (patch) | |
tree | bb25c580d408a2c4a96abda8c49c2751e72bfe52 | |
parent | 4be74b42a6d05a74a21362010cd3920fa17f63c7 (diff) |
IB/cma: Add support for network namespaces
Add support for network namespaces in the ib_cma module. This is
accomplished by:
1. Adding network namespace parameter for rdma_create_id. This parameter is
used to populate the network namespace field in rdma_id_private.
rdma_create_id keeps a reference on the network namespace.
2. Using the network namespace from the rdma_id instead of init_net inside
of ib_cma, when listening on an ID and when looking for an ID for an
incoming request.
3. Decrementing the reference count for the appropriate network namespace
when calling rdma_destroy_id.
In order to preserve the current behavior init_net is passed when calling
from other modules.
Signed-off-by: Guy Shapiro <guysh@mellanox.com>
Signed-off-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Yotam Kenneth <yotamke@mellanox.com>
Signed-off-by: Shachar Raindel <raindel@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | drivers/infiniband/core/cma.c | 46 | ||||
-rw-r--r-- | drivers/infiniband/core/ucma.c | 3 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iser_verbs.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 2 | ||||
-rw-r--r-- | drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h | 4 | ||||
-rw-r--r-- | include/rdma/rdma_cm.h | 6 | ||||
-rw-r--r-- | net/9p/trans_rdma.c | 4 | ||||
-rw-r--r-- | net/rds/ib.c | 2 | ||||
-rw-r--r-- | net/rds/ib_cm.c | 2 | ||||
-rw-r--r-- | net/rds/iw.c | 2 | ||||
-rw-r--r-- | net/rds/iw_cm.c | 2 | ||||
-rw-r--r-- | net/rds/rdma_transport.c | 4 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_transport.c | 4 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/verbs.c | 3 |
14 files changed, 52 insertions, 34 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index ac03c32ca7f1..7e93eb1f33eb 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c | |||
@@ -600,7 +600,8 @@ static int cma_disable_callback(struct rdma_id_private *id_priv, | |||
600 | return 0; | 600 | return 0; |
601 | } | 601 | } |
602 | 602 | ||
603 | struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler, | 603 | struct rdma_cm_id *rdma_create_id(struct net *net, |
604 | rdma_cm_event_handler event_handler, | ||
604 | void *context, enum rdma_port_space ps, | 605 | void *context, enum rdma_port_space ps, |
605 | enum ib_qp_type qp_type) | 606 | enum ib_qp_type qp_type) |
606 | { | 607 | { |
@@ -624,7 +625,7 @@ struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler, | |||
624 | INIT_LIST_HEAD(&id_priv->listen_list); | 625 | INIT_LIST_HEAD(&id_priv->listen_list); |
625 | INIT_LIST_HEAD(&id_priv->mc_list); | 626 | INIT_LIST_HEAD(&id_priv->mc_list); |
626 | get_random_bytes(&id_priv->seq_num, sizeof id_priv->seq_num); | 627 | get_random_bytes(&id_priv->seq_num, sizeof id_priv->seq_num); |
627 | id_priv->id.route.addr.dev_addr.net = &init_net; | 628 | id_priv->id.route.addr.dev_addr.net = get_net(net); |
628 | 629 | ||
629 | return &id_priv->id; | 630 | return &id_priv->id; |
630 | } | 631 | } |
@@ -1278,7 +1279,7 @@ static bool cma_match_net_dev(const struct rdma_id_private *id_priv, | |||
1278 | cma_protocol_roce(&id_priv->id); | 1279 | cma_protocol_roce(&id_priv->id); |
1279 | 1280 | ||
1280 | return !addr->dev_addr.bound_dev_if || | 1281 | return !addr->dev_addr.bound_dev_if || |
1281 | (net_eq(dev_net(net_dev), &init_net) && | 1282 | (net_eq(dev_net(net_dev), addr->dev_addr.net) && |
1282 | addr->dev_addr.bound_dev_if == net_dev->ifindex); | 1283 | addr->dev_addr.bound_dev_if == net_dev->ifindex); |
1283 | } | 1284 | } |
1284 | 1285 | ||
@@ -1339,7 +1340,7 @@ static struct rdma_id_private *cma_id_from_event(struct ib_cm_id *cm_id, | |||
1339 | } | 1340 | } |
1340 | } | 1341 | } |
1341 | 1342 | ||
1342 | bind_list = cma_ps_find(&init_net, | 1343 | bind_list = cma_ps_find(*net_dev ? dev_net(*net_dev) : &init_net, |
1343 | rdma_ps_from_service_id(req.service_id), | 1344 | rdma_ps_from_service_id(req.service_id), |
1344 | cma_port_from_service_id(req.service_id)); | 1345 | cma_port_from_service_id(req.service_id)); |
1345 | id_priv = cma_find_listener(bind_list, cm_id, ib_event, &req, *net_dev); | 1346 | id_priv = cma_find_listener(bind_list, cm_id, ib_event, &req, *net_dev); |
@@ -1411,6 +1412,7 @@ static void cma_cancel_operation(struct rdma_id_private *id_priv, | |||
1411 | static void cma_release_port(struct rdma_id_private *id_priv) | 1412 | static void cma_release_port(struct rdma_id_private *id_priv) |
1412 | { | 1413 | { |
1413 | struct rdma_bind_list *bind_list = id_priv->bind_list; | 1414 | struct rdma_bind_list *bind_list = id_priv->bind_list; |
1415 | struct net *net = id_priv->id.route.addr.dev_addr.net; | ||
1414 | 1416 | ||
1415 | if (!bind_list) | 1417 | if (!bind_list) |
1416 | return; | 1418 | return; |
@@ -1418,7 +1420,7 @@ static void cma_release_port(struct rdma_id_private *id_priv) | |||
1418 | mutex_lock(&lock); | 1420 | mutex_lock(&lock); |
1419 | hlist_del(&id_priv->node); | 1421 | hlist_del(&id_priv->node); |
1420 | if (hlist_empty(&bind_list->owners)) { | 1422 | if (hlist_empty(&bind_list->owners)) { |
1421 | cma_ps_remove(&init_net, bind_list->ps, bind_list->port); | 1423 | cma_ps_remove(net, bind_list->ps, bind_list->port); |
1422 | kfree(bind_list); | 1424 | kfree(bind_list); |
1423 | } | 1425 | } |
1424 | mutex_unlock(&lock); | 1426 | mutex_unlock(&lock); |
@@ -1477,6 +1479,7 @@ void rdma_destroy_id(struct rdma_cm_id *id) | |||
1477 | cma_deref_id(id_priv->id.context); | 1479 | cma_deref_id(id_priv->id.context); |
1478 | 1480 | ||
1479 | kfree(id_priv->id.route.path_rec); | 1481 | kfree(id_priv->id.route.path_rec); |
1482 | put_net(id_priv->id.route.addr.dev_addr.net); | ||
1480 | kfree(id_priv); | 1483 | kfree(id_priv); |
1481 | } | 1484 | } |
1482 | EXPORT_SYMBOL(rdma_destroy_id); | 1485 | EXPORT_SYMBOL(rdma_destroy_id); |
@@ -1607,7 +1610,8 @@ static struct rdma_id_private *cma_new_conn_id(struct rdma_cm_id *listen_id, | |||
1607 | ib_event->param.req_rcvd.primary_path->service_id; | 1610 | ib_event->param.req_rcvd.primary_path->service_id; |
1608 | int ret; | 1611 | int ret; |
1609 | 1612 | ||
1610 | id = rdma_create_id(listen_id->event_handler, listen_id->context, | 1613 | id = rdma_create_id(listen_id->route.addr.dev_addr.net, |
1614 | listen_id->event_handler, listen_id->context, | ||
1611 | listen_id->ps, ib_event->param.req_rcvd.qp_type); | 1615 | listen_id->ps, ib_event->param.req_rcvd.qp_type); |
1612 | if (IS_ERR(id)) | 1616 | if (IS_ERR(id)) |
1613 | return NULL; | 1617 | return NULL; |
@@ -1662,9 +1666,10 @@ static struct rdma_id_private *cma_new_udp_id(struct rdma_cm_id *listen_id, | |||
1662 | struct rdma_id_private *id_priv; | 1666 | struct rdma_id_private *id_priv; |
1663 | struct rdma_cm_id *id; | 1667 | struct rdma_cm_id *id; |
1664 | const sa_family_t ss_family = listen_id->route.addr.src_addr.ss_family; | 1668 | const sa_family_t ss_family = listen_id->route.addr.src_addr.ss_family; |
1669 | struct net *net = listen_id->route.addr.dev_addr.net; | ||
1665 | int ret; | 1670 | int ret; |
1666 | 1671 | ||
1667 | id = rdma_create_id(listen_id->event_handler, listen_id->context, | 1672 | id = rdma_create_id(net, listen_id->event_handler, listen_id->context, |
1668 | listen_id->ps, IB_QPT_UD); | 1673 | listen_id->ps, IB_QPT_UD); |
1669 | if (IS_ERR(id)) | 1674 | if (IS_ERR(id)) |
1670 | return NULL; | 1675 | return NULL; |
@@ -1901,7 +1906,8 @@ static int iw_conn_req_handler(struct iw_cm_id *cm_id, | |||
1901 | return -ECONNABORTED; | 1906 | return -ECONNABORTED; |
1902 | 1907 | ||
1903 | /* Create a new RDMA id for the new IW CM ID */ | 1908 | /* Create a new RDMA id for the new IW CM ID */ |
1904 | new_cm_id = rdma_create_id(listen_id->id.event_handler, | 1909 | new_cm_id = rdma_create_id(listen_id->id.route.addr.dev_addr.net, |
1910 | listen_id->id.event_handler, | ||
1905 | listen_id->id.context, | 1911 | listen_id->id.context, |
1906 | RDMA_PS_TCP, IB_QPT_RC); | 1912 | RDMA_PS_TCP, IB_QPT_RC); |
1907 | if (IS_ERR(new_cm_id)) { | 1913 | if (IS_ERR(new_cm_id)) { |
@@ -2029,12 +2035,13 @@ static void cma_listen_on_dev(struct rdma_id_private *id_priv, | |||
2029 | { | 2035 | { |
2030 | struct rdma_id_private *dev_id_priv; | 2036 | struct rdma_id_private *dev_id_priv; |
2031 | struct rdma_cm_id *id; | 2037 | struct rdma_cm_id *id; |
2038 | struct net *net = id_priv->id.route.addr.dev_addr.net; | ||
2032 | int ret; | 2039 | int ret; |
2033 | 2040 | ||
2034 | if (cma_family(id_priv) == AF_IB && !rdma_cap_ib_cm(cma_dev->device, 1)) | 2041 | if (cma_family(id_priv) == AF_IB && !rdma_cap_ib_cm(cma_dev->device, 1)) |
2035 | return; | 2042 | return; |
2036 | 2043 | ||
2037 | id = rdma_create_id(cma_listen_handler, id_priv, id_priv->id.ps, | 2044 | id = rdma_create_id(net, cma_listen_handler, id_priv, id_priv->id.ps, |
2038 | id_priv->id.qp_type); | 2045 | id_priv->id.qp_type); |
2039 | if (IS_ERR(id)) | 2046 | if (IS_ERR(id)) |
2040 | return; | 2047 | return; |
@@ -2708,7 +2715,8 @@ static int cma_alloc_port(enum rdma_port_space ps, | |||
2708 | if (!bind_list) | 2715 | if (!bind_list) |
2709 | return -ENOMEM; | 2716 | return -ENOMEM; |
2710 | 2717 | ||
2711 | ret = cma_ps_alloc(&init_net, ps, bind_list, snum); | 2718 | ret = cma_ps_alloc(id_priv->id.route.addr.dev_addr.net, ps, bind_list, |
2719 | snum); | ||
2712 | if (ret < 0) | 2720 | if (ret < 0) |
2713 | goto err; | 2721 | goto err; |
2714 | 2722 | ||
@@ -2727,13 +2735,14 @@ static int cma_alloc_any_port(enum rdma_port_space ps, | |||
2727 | static unsigned int last_used_port; | 2735 | static unsigned int last_used_port; |
2728 | int low, high, remaining; | 2736 | int low, high, remaining; |
2729 | unsigned int rover; | 2737 | unsigned int rover; |
2738 | struct net *net = id_priv->id.route.addr.dev_addr.net; | ||
2730 | 2739 | ||
2731 | inet_get_local_port_range(&init_net, &low, &high); | 2740 | inet_get_local_port_range(net, &low, &high); |
2732 | remaining = (high - low) + 1; | 2741 | remaining = (high - low) + 1; |
2733 | rover = prandom_u32() % remaining + low; | 2742 | rover = prandom_u32() % remaining + low; |
2734 | retry: | 2743 | retry: |
2735 | if (last_used_port != rover && | 2744 | if (last_used_port != rover && |
2736 | !cma_ps_find(&init_net, ps, (unsigned short)rover)) { | 2745 | !cma_ps_find(net, ps, (unsigned short)rover)) { |
2737 | int ret = cma_alloc_port(ps, id_priv, rover); | 2746 | int ret = cma_alloc_port(ps, id_priv, rover); |
2738 | /* | 2747 | /* |
2739 | * Remember previously used port number in order to avoid | 2748 | * Remember previously used port number in order to avoid |
@@ -2799,7 +2808,7 @@ static int cma_use_port(enum rdma_port_space ps, | |||
2799 | if (snum < PROT_SOCK && !capable(CAP_NET_BIND_SERVICE)) | 2808 | if (snum < PROT_SOCK && !capable(CAP_NET_BIND_SERVICE)) |
2800 | return -EACCES; | 2809 | return -EACCES; |
2801 | 2810 | ||
2802 | bind_list = cma_ps_find(&init_net, ps, snum); | 2811 | bind_list = cma_ps_find(id_priv->id.route.addr.dev_addr.net, ps, snum); |
2803 | if (!bind_list) { | 2812 | if (!bind_list) { |
2804 | ret = cma_alloc_port(ps, id_priv, snum); | 2813 | ret = cma_alloc_port(ps, id_priv, snum); |
2805 | } else { | 2814 | } else { |
@@ -2991,8 +3000,11 @@ int rdma_bind_addr(struct rdma_cm_id *id, struct sockaddr *addr) | |||
2991 | if (addr->sa_family == AF_INET) | 3000 | if (addr->sa_family == AF_INET) |
2992 | id_priv->afonly = 1; | 3001 | id_priv->afonly = 1; |
2993 | #if IS_ENABLED(CONFIG_IPV6) | 3002 | #if IS_ENABLED(CONFIG_IPV6) |
2994 | else if (addr->sa_family == AF_INET6) | 3003 | else if (addr->sa_family == AF_INET6) { |
2995 | id_priv->afonly = init_net.ipv6.sysctl.bindv6only; | 3004 | struct net *net = id_priv->id.route.addr.dev_addr.net; |
3005 | |||
3006 | id_priv->afonly = net->ipv6.sysctl.bindv6only; | ||
3007 | } | ||
2996 | #endif | 3008 | #endif |
2997 | } | 3009 | } |
2998 | ret = cma_get_port(id_priv); | 3010 | ret = cma_get_port(id_priv); |
@@ -3797,6 +3809,7 @@ static int cma_netdev_change(struct net_device *ndev, struct rdma_id_private *id | |||
3797 | dev_addr = &id_priv->id.route.addr.dev_addr; | 3809 | dev_addr = &id_priv->id.route.addr.dev_addr; |
3798 | 3810 | ||
3799 | if ((dev_addr->bound_dev_if == ndev->ifindex) && | 3811 | if ((dev_addr->bound_dev_if == ndev->ifindex) && |
3812 | (net_eq(dev_net(ndev), dev_addr->net)) && | ||
3800 | memcmp(dev_addr->src_dev_addr, ndev->dev_addr, ndev->addr_len)) { | 3813 | memcmp(dev_addr->src_dev_addr, ndev->dev_addr, ndev->addr_len)) { |
3801 | printk(KERN_INFO "RDMA CM addr change for ndev %s used by id %p\n", | 3814 | printk(KERN_INFO "RDMA CM addr change for ndev %s used by id %p\n", |
3802 | ndev->name, &id_priv->id); | 3815 | ndev->name, &id_priv->id); |
@@ -3822,9 +3835,6 @@ static int cma_netdev_callback(struct notifier_block *self, unsigned long event, | |||
3822 | struct rdma_id_private *id_priv; | 3835 | struct rdma_id_private *id_priv; |
3823 | int ret = NOTIFY_DONE; | 3836 | int ret = NOTIFY_DONE; |
3824 | 3837 | ||
3825 | if (dev_net(ndev) != &init_net) | ||
3826 | return NOTIFY_DONE; | ||
3827 | |||
3828 | if (event != NETDEV_BONDING_FAILOVER) | 3838 | if (event != NETDEV_BONDING_FAILOVER) |
3829 | return NOTIFY_DONE; | 3839 | return NOTIFY_DONE; |
3830 | 3840 | ||
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index 3a342dfaac15..e80c107450ab 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c | |||
@@ -472,7 +472,8 @@ static ssize_t ucma_create_id(struct ucma_file *file, const char __user *inbuf, | |||
472 | return -ENOMEM; | 472 | return -ENOMEM; |
473 | 473 | ||
474 | ctx->uid = cmd.uid; | 474 | ctx->uid = cmd.uid; |
475 | ctx->cm_id = rdma_create_id(ucma_event_handler, ctx, cmd.ps, qp_type); | 475 | ctx->cm_id = rdma_create_id(&init_net, ucma_event_handler, ctx, cmd.ps, |
476 | qp_type); | ||
476 | if (IS_ERR(ctx->cm_id)) { | 477 | if (IS_ERR(ctx->cm_id)) { |
477 | ret = PTR_ERR(ctx->cm_id); | 478 | ret = PTR_ERR(ctx->cm_id); |
478 | goto err1; | 479 | goto err1; |
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 85132d867bc8..f3122372d49f 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c | |||
@@ -1017,7 +1017,7 @@ int iser_connect(struct iser_conn *iser_conn, | |||
1017 | ib_conn->beacon.wr_id = ISER_BEACON_WRID; | 1017 | ib_conn->beacon.wr_id = ISER_BEACON_WRID; |
1018 | ib_conn->beacon.opcode = IB_WR_SEND; | 1018 | ib_conn->beacon.opcode = IB_WR_SEND; |
1019 | 1019 | ||
1020 | ib_conn->cma_id = rdma_create_id(iser_cma_handler, | 1020 | ib_conn->cma_id = rdma_create_id(&init_net, iser_cma_handler, |
1021 | (void *)iser_conn, | 1021 | (void *)iser_conn, |
1022 | RDMA_PS_TCP, IB_QPT_RC); | 1022 | RDMA_PS_TCP, IB_QPT_RC); |
1023 | if (IS_ERR(ib_conn->cma_id)) { | 1023 | if (IS_ERR(ib_conn->cma_id)) { |
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index b58ac25ce19d..7d41c9d6d6bf 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
@@ -3096,7 +3096,7 @@ isert_setup_id(struct isert_np *isert_np) | |||
3096 | sa = (struct sockaddr *)&np->np_sockaddr; | 3096 | sa = (struct sockaddr *)&np->np_sockaddr; |
3097 | isert_dbg("ksockaddr: %p, sa: %p\n", &np->np_sockaddr, sa); | 3097 | isert_dbg("ksockaddr: %p, sa: %p\n", &np->np_sockaddr, sa); |
3098 | 3098 | ||
3099 | id = rdma_create_id(isert_cma_handler, isert_np, | 3099 | id = rdma_create_id(&init_net, isert_cma_handler, isert_np, |
3100 | RDMA_PS_TCP, IB_QPT_RC); | 3100 | RDMA_PS_TCP, IB_QPT_RC); |
3101 | if (IS_ERR(id)) { | 3101 | if (IS_ERR(id)) { |
3102 | isert_err("rdma_create_id() failed: %ld\n", PTR_ERR(id)); | 3102 | isert_err("rdma_create_id() failed: %ld\n", PTR_ERR(id)); |
diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h index f4b6c33ac318..5015a9e830bd 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h | |||
@@ -128,7 +128,9 @@ extern kib_tunables_t kiblnd_tunables; | |||
128 | IBLND_CREDIT_HIGHWATER_V1 : \ | 128 | IBLND_CREDIT_HIGHWATER_V1 : \ |
129 | *kiblnd_tunables.kib_peercredits_hiw) /* when eagerly to return credits */ | 129 | *kiblnd_tunables.kib_peercredits_hiw) /* when eagerly to return credits */ |
130 | 130 | ||
131 | #define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(cb, dev, ps, qpt) | 131 | #define kiblnd_rdma_create_id(cb, dev, ps, qpt) rdma_create_id(&init_net, \ |
132 | cb, dev, \ | ||
133 | ps, qpt) | ||
132 | 134 | ||
133 | static inline int | 135 | static inline int |
134 | kiblnd_concurrent_sends_v1(void) | 136 | kiblnd_concurrent_sends_v1(void) |
diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h index c92522c192d2..463ec0ccbe51 100644 --- a/include/rdma/rdma_cm.h +++ b/include/rdma/rdma_cm.h | |||
@@ -160,13 +160,17 @@ struct rdma_cm_id { | |||
160 | /** | 160 | /** |
161 | * rdma_create_id - Create an RDMA identifier. | 161 | * rdma_create_id - Create an RDMA identifier. |
162 | * | 162 | * |
163 | * @net: The network namespace in which to create the new id. | ||
163 | * @event_handler: User callback invoked to report events associated with the | 164 | * @event_handler: User callback invoked to report events associated with the |
164 | * returned rdma_id. | 165 | * returned rdma_id. |
165 | * @context: User specified context associated with the id. | 166 | * @context: User specified context associated with the id. |
166 | * @ps: RDMA port space. | 167 | * @ps: RDMA port space. |
167 | * @qp_type: type of queue pair associated with the id. | 168 | * @qp_type: type of queue pair associated with the id. |
169 | * | ||
170 | * The id holds a reference on the network namespace until it is destroyed. | ||
168 | */ | 171 | */ |
169 | struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler, | 172 | struct rdma_cm_id *rdma_create_id(struct net *net, |
173 | rdma_cm_event_handler event_handler, | ||
170 | void *context, enum rdma_port_space ps, | 174 | void *context, enum rdma_port_space ps, |
171 | enum ib_qp_type qp_type); | 175 | enum ib_qp_type qp_type); |
172 | 176 | ||
diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index ba1210253f5e..52b4a2f993f2 100644 --- a/net/9p/trans_rdma.c +++ b/net/9p/trans_rdma.c | |||
@@ -655,8 +655,8 @@ rdma_create_trans(struct p9_client *client, const char *addr, char *args) | |||
655 | return -ENOMEM; | 655 | return -ENOMEM; |
656 | 656 | ||
657 | /* Create the RDMA CM ID */ | 657 | /* Create the RDMA CM ID */ |
658 | rdma->cm_id = rdma_create_id(p9_cm_event_handler, client, RDMA_PS_TCP, | 658 | rdma->cm_id = rdma_create_id(&init_net, p9_cm_event_handler, client, |
659 | IB_QPT_RC); | 659 | RDMA_PS_TCP, IB_QPT_RC); |
660 | if (IS_ERR(rdma->cm_id)) | 660 | if (IS_ERR(rdma->cm_id)) |
661 | goto error; | 661 | goto error; |
662 | 662 | ||
diff --git a/net/rds/ib.c b/net/rds/ib.c index 2d3f2ab475df..cd64ef9a4748 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c | |||
@@ -317,7 +317,7 @@ static int rds_ib_laddr_check(struct net *net, __be32 addr) | |||
317 | /* Create a CMA ID and try to bind it. This catches both | 317 | /* Create a CMA ID and try to bind it. This catches both |
318 | * IB and iWARP capable NICs. | 318 | * IB and iWARP capable NICs. |
319 | */ | 319 | */ |
320 | cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP, IB_QPT_RC); | 320 | cm_id = rdma_create_id(&init_net, NULL, NULL, RDMA_PS_TCP, IB_QPT_RC); |
321 | if (IS_ERR(cm_id)) | 321 | if (IS_ERR(cm_id)) |
322 | return PTR_ERR(cm_id); | 322 | return PTR_ERR(cm_id); |
323 | 323 | ||
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index 9043f5c04787..f5a98068faf0 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c | |||
@@ -565,7 +565,7 @@ int rds_ib_conn_connect(struct rds_connection *conn) | |||
565 | 565 | ||
566 | /* XXX I wonder what affect the port space has */ | 566 | /* XXX I wonder what affect the port space has */ |
567 | /* delegate cm event handler to rdma_transport */ | 567 | /* delegate cm event handler to rdma_transport */ |
568 | ic->i_cm_id = rdma_create_id(rds_rdma_cm_event_handler, conn, | 568 | ic->i_cm_id = rdma_create_id(&init_net, rds_rdma_cm_event_handler, conn, |
569 | RDMA_PS_TCP, IB_QPT_RC); | 569 | RDMA_PS_TCP, IB_QPT_RC); |
570 | if (IS_ERR(ic->i_cm_id)) { | 570 | if (IS_ERR(ic->i_cm_id)) { |
571 | ret = PTR_ERR(ic->i_cm_id); | 571 | ret = PTR_ERR(ic->i_cm_id); |
diff --git a/net/rds/iw.c b/net/rds/iw.c index 3df0295c6659..576f1825fc55 100644 --- a/net/rds/iw.c +++ b/net/rds/iw.c | |||
@@ -223,7 +223,7 @@ static int rds_iw_laddr_check(struct net *net, __be32 addr) | |||
223 | /* Create a CMA ID and try to bind it. This catches both | 223 | /* Create a CMA ID and try to bind it. This catches both |
224 | * IB and iWARP capable NICs. | 224 | * IB and iWARP capable NICs. |
225 | */ | 225 | */ |
226 | cm_id = rdma_create_id(NULL, NULL, RDMA_PS_TCP, IB_QPT_RC); | 226 | cm_id = rdma_create_id(&init_net, NULL, NULL, RDMA_PS_TCP, IB_QPT_RC); |
227 | if (IS_ERR(cm_id)) | 227 | if (IS_ERR(cm_id)) |
228 | return PTR_ERR(cm_id); | 228 | return PTR_ERR(cm_id); |
229 | 229 | ||
diff --git a/net/rds/iw_cm.c b/net/rds/iw_cm.c index a6553a6fb2bc..aea4c911bc76 100644 --- a/net/rds/iw_cm.c +++ b/net/rds/iw_cm.c | |||
@@ -524,7 +524,7 @@ int rds_iw_conn_connect(struct rds_connection *conn) | |||
524 | 524 | ||
525 | /* XXX I wonder what affect the port space has */ | 525 | /* XXX I wonder what affect the port space has */ |
526 | /* delegate cm event handler to rdma_transport */ | 526 | /* delegate cm event handler to rdma_transport */ |
527 | ic->i_cm_id = rdma_create_id(rds_rdma_cm_event_handler, conn, | 527 | ic->i_cm_id = rdma_create_id(&init_net, rds_rdma_cm_event_handler, conn, |
528 | RDMA_PS_TCP, IB_QPT_RC); | 528 | RDMA_PS_TCP, IB_QPT_RC); |
529 | if (IS_ERR(ic->i_cm_id)) { | 529 | if (IS_ERR(ic->i_cm_id)) { |
530 | ret = PTR_ERR(ic->i_cm_id); | 530 | ret = PTR_ERR(ic->i_cm_id); |
diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c index b9b40af5345b..9c1fed81bf0f 100644 --- a/net/rds/rdma_transport.c +++ b/net/rds/rdma_transport.c | |||
@@ -142,8 +142,8 @@ static int rds_rdma_listen_init(void) | |||
142 | struct rdma_cm_id *cm_id; | 142 | struct rdma_cm_id *cm_id; |
143 | int ret; | 143 | int ret; |
144 | 144 | ||
145 | cm_id = rdma_create_id(rds_rdma_cm_event_handler, NULL, RDMA_PS_TCP, | 145 | cm_id = rdma_create_id(&init_net, rds_rdma_cm_event_handler, NULL, |
146 | IB_QPT_RC); | 146 | RDMA_PS_TCP, IB_QPT_RC); |
147 | if (IS_ERR(cm_id)) { | 147 | if (IS_ERR(cm_id)) { |
148 | ret = PTR_ERR(cm_id); | 148 | ret = PTR_ERR(cm_id); |
149 | printk(KERN_ERR "RDS/RDMA: failed to setup listener, " | 149 | printk(KERN_ERR "RDS/RDMA: failed to setup listener, " |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index fcc3eb80c265..4a41122d586f 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c | |||
@@ -692,8 +692,8 @@ static struct svc_xprt *svc_rdma_create(struct svc_serv *serv, | |||
692 | if (!cma_xprt) | 692 | if (!cma_xprt) |
693 | return ERR_PTR(-ENOMEM); | 693 | return ERR_PTR(-ENOMEM); |
694 | 694 | ||
695 | listen_id = rdma_create_id(rdma_listen_handler, cma_xprt, RDMA_PS_TCP, | 695 | listen_id = rdma_create_id(&init_net, rdma_listen_handler, cma_xprt, |
696 | IB_QPT_RC); | 696 | RDMA_PS_TCP, IB_QPT_RC); |
697 | if (IS_ERR(listen_id)) { | 697 | if (IS_ERR(listen_id)) { |
698 | ret = PTR_ERR(listen_id); | 698 | ret = PTR_ERR(listen_id); |
699 | dprintk("svcrdma: rdma_create_id failed = %d\n", ret); | 699 | dprintk("svcrdma: rdma_create_id failed = %d\n", ret); |
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index 81e8d31f3abc..6c06ba088fea 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c | |||
@@ -432,7 +432,8 @@ rpcrdma_create_id(struct rpcrdma_xprt *xprt, | |||
432 | 432 | ||
433 | init_completion(&ia->ri_done); | 433 | init_completion(&ia->ri_done); |
434 | 434 | ||
435 | id = rdma_create_id(rpcrdma_conn_upcall, xprt, RDMA_PS_TCP, IB_QPT_RC); | 435 | id = rdma_create_id(&init_net, rpcrdma_conn_upcall, xprt, RDMA_PS_TCP, |
436 | IB_QPT_RC); | ||
436 | if (IS_ERR(id)) { | 437 | if (IS_ERR(id)) { |
437 | rc = PTR_ERR(id); | 438 | rc = PTR_ERR(id); |
438 | dprintk("RPC: %s: rdma_create_id() failed %i\n", | 439 | dprintk("RPC: %s: rdma_create_id() failed %i\n", |