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 /include/rdma | |
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>
Diffstat (limited to 'include/rdma')
-rw-r--r-- | include/rdma/rdma_cm.h | 6 |
1 files changed, 5 insertions, 1 deletions
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 | ||