diff options
author | Sean Hefty <sean.hefty@intel.com> | 2007-02-15 20:00:18 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-02-16 17:29:07 -0500 |
commit | c8f6a362bf3eb28ade6027b49bb160a336dd51c0 (patch) | |
tree | b9b19599c9fddea313725a359283bc624a86c1ec /include | |
parent | faec2f7b96b555055d0aa6cc6b83a537270bed52 (diff) |
RDMA/cma: Add multicast communication support
Extend rdma_cm to support multicast communication. Multicast support
is added to the existing RDMA_PS_UDP port space, as well as a new
RDMA_PS_IPOIB port space. The latter port space allows joining the
multicast groups used by IPoIB, which enables offloading IPoIB traffic
to a separate QP. The port space determines the signature used in the
MGID when joining the group. The newly added RDMA_PS_IPOIB also
allows for unicast operations, similar to RDMA_PS_UDP.
Supporting the RDMA_PS_IPOIB requires changing how UD QPs are initialized,
since we can no longer assume that the qkey is constant. This requires
saving the Q_Key to use when attaching to a device, so that it is
available when creating the QP. The Q_Key information is exported to
the user through the existing rdma_init_qp_attr() interface.
Multicast support is also exported to userspace through the rdma_ucm.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/rdma/rdma_cm.h | 21 | ||||
-rw-r--r-- | include/rdma/rdma_cm_ib.h | 4 | ||||
-rw-r--r-- | include/rdma/rdma_user_cm.h | 13 |
3 files changed, 33 insertions, 5 deletions
diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h index 36cd8a8526a0..2d6a7705eae7 100644 --- a/include/rdma/rdma_cm.h +++ b/include/rdma/rdma_cm.h | |||
@@ -52,10 +52,13 @@ enum rdma_cm_event_type { | |||
52 | RDMA_CM_EVENT_ESTABLISHED, | 52 | RDMA_CM_EVENT_ESTABLISHED, |
53 | RDMA_CM_EVENT_DISCONNECTED, | 53 | RDMA_CM_EVENT_DISCONNECTED, |
54 | RDMA_CM_EVENT_DEVICE_REMOVAL, | 54 | RDMA_CM_EVENT_DEVICE_REMOVAL, |
55 | RDMA_CM_EVENT_MULTICAST_JOIN, | ||
56 | RDMA_CM_EVENT_MULTICAST_ERROR | ||
55 | }; | 57 | }; |
56 | 58 | ||
57 | enum rdma_port_space { | 59 | enum rdma_port_space { |
58 | RDMA_PS_SDP = 0x0001, | 60 | RDMA_PS_SDP = 0x0001, |
61 | RDMA_PS_IPOIB= 0x0002, | ||
59 | RDMA_PS_TCP = 0x0106, | 62 | RDMA_PS_TCP = 0x0106, |
60 | RDMA_PS_UDP = 0x0111, | 63 | RDMA_PS_UDP = 0x0111, |
61 | RDMA_PS_SCTP = 0x0183 | 64 | RDMA_PS_SCTP = 0x0183 |
@@ -294,5 +297,21 @@ int rdma_reject(struct rdma_cm_id *id, const void *private_data, | |||
294 | */ | 297 | */ |
295 | int rdma_disconnect(struct rdma_cm_id *id); | 298 | int rdma_disconnect(struct rdma_cm_id *id); |
296 | 299 | ||
297 | #endif /* RDMA_CM_H */ | 300 | /** |
301 | * rdma_join_multicast - Join the multicast group specified by the given | ||
302 | * address. | ||
303 | * @id: Communication identifier associated with the request. | ||
304 | * @addr: Multicast address identifying the group to join. | ||
305 | * @context: User-defined context associated with the join request, returned | ||
306 | * to the user through the private_data pointer in multicast events. | ||
307 | */ | ||
308 | int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr, | ||
309 | void *context); | ||
298 | 310 | ||
311 | /** | ||
312 | * rdma_leave_multicast - Leave the multicast group specified by the given | ||
313 | * address. | ||
314 | */ | ||
315 | void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr); | ||
316 | |||
317 | #endif /* RDMA_CM_H */ | ||
diff --git a/include/rdma/rdma_cm_ib.h b/include/rdma/rdma_cm_ib.h index 9b176df1d667..950424b38f16 100644 --- a/include/rdma/rdma_cm_ib.h +++ b/include/rdma/rdma_cm_ib.h | |||
@@ -44,7 +44,7 @@ | |||
44 | int rdma_set_ib_paths(struct rdma_cm_id *id, | 44 | int rdma_set_ib_paths(struct rdma_cm_id *id, |
45 | struct ib_sa_path_rec *path_rec, int num_paths); | 45 | struct ib_sa_path_rec *path_rec, int num_paths); |
46 | 46 | ||
47 | /* Global qkey for UD QPs and multicast groups. */ | 47 | /* Global qkey for UDP QPs and multicast groups. */ |
48 | #define RDMA_UD_QKEY 0x01234567 | 48 | #define RDMA_UDP_QKEY 0x01234567 |
49 | 49 | ||
50 | #endif /* RDMA_CM_IB_H */ | 50 | #endif /* RDMA_CM_IB_H */ |
diff --git a/include/rdma/rdma_user_cm.h b/include/rdma/rdma_user_cm.h index 9572ab8eeac1..f632b0c007c9 100644 --- a/include/rdma/rdma_user_cm.h +++ b/include/rdma/rdma_user_cm.h | |||
@@ -38,7 +38,7 @@ | |||
38 | #include <rdma/ib_user_verbs.h> | 38 | #include <rdma/ib_user_verbs.h> |
39 | #include <rdma/ib_user_sa.h> | 39 | #include <rdma/ib_user_sa.h> |
40 | 40 | ||
41 | #define RDMA_USER_CM_ABI_VERSION 3 | 41 | #define RDMA_USER_CM_ABI_VERSION 4 |
42 | 42 | ||
43 | #define RDMA_MAX_PRIVATE_DATA 256 | 43 | #define RDMA_MAX_PRIVATE_DATA 256 |
44 | 44 | ||
@@ -58,7 +58,9 @@ enum { | |||
58 | RDMA_USER_CM_CMD_GET_EVENT, | 58 | RDMA_USER_CM_CMD_GET_EVENT, |
59 | RDMA_USER_CM_CMD_GET_OPTION, | 59 | RDMA_USER_CM_CMD_GET_OPTION, |
60 | RDMA_USER_CM_CMD_SET_OPTION, | 60 | RDMA_USER_CM_CMD_SET_OPTION, |
61 | RDMA_USER_CM_CMD_NOTIFY | 61 | RDMA_USER_CM_CMD_NOTIFY, |
62 | RDMA_USER_CM_CMD_JOIN_MCAST, | ||
63 | RDMA_USER_CM_CMD_LEAVE_MCAST | ||
62 | }; | 64 | }; |
63 | 65 | ||
64 | /* | 66 | /* |
@@ -188,6 +190,13 @@ struct rdma_ucm_notify { | |||
188 | __u32 event; | 190 | __u32 event; |
189 | }; | 191 | }; |
190 | 192 | ||
193 | struct rdma_ucm_join_mcast { | ||
194 | __u64 response; /* rdma_ucm_create_id_resp */ | ||
195 | __u64 uid; | ||
196 | struct sockaddr_in6 addr; | ||
197 | __u32 id; | ||
198 | }; | ||
199 | |||
191 | struct rdma_ucm_get_event { | 200 | struct rdma_ucm_get_event { |
192 | __u64 response; | 201 | __u64 response; |
193 | }; | 202 | }; |