aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorHefty, Sean <sean.hefty@intel.com>2011-05-10 01:06:10 -0400
committerRoland Dreier <roland@purestorage.com>2011-05-10 01:06:10 -0400
commita9bb79128aa659f97b774b97c9bb1bdc74444595 (patch)
tree20208e66195581568e5c68f838897199d224fa90 /include/rdma
parent43b752daae9445a3b2b075a236840d801fce1593 (diff)
RDMA/cma: Add an ID_REUSEADDR option
Lustre requires that clients bind to a privileged port number before connecting to a remote server. On larger clusters (typically more than about 1000 nodes), the number of privileged ports is exhausted, resulting in lustre being unusable. To handle this, we add support for reusable addresses to the rdma_cm. This mimics the behavior of the socket option SO_REUSEADDR. A user may set an rdma_cm_id to reuse an address before calling rdma_bind_addr() (explicitly or implicitly). If set, other rdma_cm_id's may be bound to the same address, provided that they all have reuse enabled, and there are no active listens. If rdma_listen() is called on an rdma_cm_id that has reuse enabled, it will only succeed if there are no other id's bound to that same address. The reuse option is exported to user space. The behavior of the kernel reuse implementation was verified against that given by sockets. This patch is derived from a path by Ira Weiny <weiny2@llnl.gov> Signed-off-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/rdma_cm.h10
-rw-r--r--include/rdma/rdma_user_cm.h5
2 files changed, 13 insertions, 2 deletions
diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h
index 4fae90304648..169f7a53fb0c 100644
--- a/include/rdma/rdma_cm.h
+++ b/include/rdma/rdma_cm.h
@@ -329,4 +329,14 @@ void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr);
329 */ 329 */
330void rdma_set_service_type(struct rdma_cm_id *id, int tos); 330void rdma_set_service_type(struct rdma_cm_id *id, int tos);
331 331
332/**
333 * rdma_set_reuseaddr - Allow the reuse of local addresses when binding
334 * the rdma_cm_id.
335 * @id: Communication identifier to configure.
336 * @reuse: Value indicating if the bound address is reusable.
337 *
338 * Reuse must be set before an address is bound to the id.
339 */
340int rdma_set_reuseaddr(struct rdma_cm_id *id, int reuse);
341
332#endif /* RDMA_CM_H */ 342#endif /* RDMA_CM_H */
diff --git a/include/rdma/rdma_user_cm.h b/include/rdma/rdma_user_cm.h
index 1d165022c02d..fc82c1896f75 100644
--- a/include/rdma/rdma_user_cm.h
+++ b/include/rdma/rdma_user_cm.h
@@ -221,8 +221,9 @@ enum {
221 221
222/* Option details */ 222/* Option details */
223enum { 223enum {
224 RDMA_OPTION_ID_TOS = 0, 224 RDMA_OPTION_ID_TOS = 0,
225 RDMA_OPTION_IB_PATH = 1 225 RDMA_OPTION_ID_REUSEADDR = 1,
226 RDMA_OPTION_IB_PATH = 1
226}; 227};
227 228
228struct rdma_ucm_set_option { 229struct rdma_ucm_set_option {