]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
librdmacm: Support RAI_NUMERICHOST and no delay options
authorSean Hefty <sean.hefty@intel.com>
Mon, 6 Dec 2010 21:17:03 +0000 (13:17 -0800)
committerSean Hefty <sean.hefty@intel.com>
Thu, 9 Dec 2010 01:25:10 +0000 (17:25 -0800)
Add support similar to getaddrinfo AI_NUMERICHOST.  This
indicates that lengthy address resolution protocols should
not be used.  Also allow a caller of rdma_getaddrinfo to
indicate that lengthy route resolution protocols should not
be used.

Since rdma_getaddrinfo is a synchronous call, this allows a
user to obtain locally available data only without long
delays that may block an application thread.  Callers can then
use the asynchronous librdmacm calls to complete any missing
information.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
include/rdma/rdma_cma.h [changed mode: 0644->0755]
man/rdma_getaddrinfo.3 [changed mode: 0644->0755]
src/acm.c
src/addrinfo.c

old mode 100644 (file)
new mode 100755 (executable)
index d17ef88..b48cd2e
@@ -165,6 +165,8 @@ struct rdma_cm_event {
 };
 
 #define RAI_PASSIVE            0x00000001
+#define RAI_NUMERICHOST                0x00000002
+#define RAI_NOROUTE            0x00000004
 
 struct rdma_addrinfo {
        int                     ai_flags;
old mode 100644 (file)
new mode 100755 (executable)
index c418b5a..e69d8ce
@@ -38,6 +38,11 @@ Hint flags that control the operation.  Supported flags are:
 .IP "RAI_PASSIVE" 12
 Indicates that the results will be used on the passive/listening
 side of a connection.
+.IP "RAI_NUMERICHOST" 12
+If specified, then the node parameter, if provided, must be a numerical
+network address.  This flag suppresses any lengthy address resolution. 
+.IP "RAI_NOROUTE" 12
+If set, this flag suppresses any lengthy route resolution.
 .IP "ai_family" 12
 Address family for the source and destination address.  Supported families
 are: AF_INET, AF_INET6, and AF_IB.
index e2d02b41804e3c46c49daf5131e326bb0218f7be..1fa6c6242cf8d9f71f0213c461281ecc9ae52e14 100755 (executable)
--- a/src/acm.c
+++ b/src/acm.c
@@ -292,6 +292,8 @@ void ucma_ib_resolve(struct rdma_addrinfo *rai, struct rdma_addrinfo *hints)
 
        if (rai->ai_dst_len) {
                data->flags = ACM_EP_FLAG_DEST;
+               if (rai->ai_flags & (RAI_NUMERICHOST | RAI_NOROUTE))
+                       data->flags |= ACM_FLAGS_NODELAY;
                ucma_copy_rai_addr(data, rai->ai_dst_addr);
                data++;
                msg.hdr.length += ACM_MSG_EP_LENGTH;
index a1cb8a51d3fb3b869146b455f2129c1ae2e3aa7b..021f7c4e4e137638e5b2a59aa7a06c6ef9abcbb4 100755 (executable)
@@ -48,7 +48,8 @@
 static void ucma_convert_to_ai(struct addrinfo *ai, struct rdma_addrinfo *rai)
 {
        memset(ai, 0, sizeof *ai);
-       ai->ai_flags = (rai->ai_flags & RAI_PASSIVE) ? AI_PASSIVE : 0;
+       ai->ai_flags  = (rai->ai_flags & RAI_PASSIVE) ? AI_PASSIVE : 0;
+       ai->ai_flags |= (rai->ai_flags & RAI_NUMERICHOST) ? AI_NUMERICHOST : 0;
        ai->ai_family = rai->ai_family;
 
        switch (rai->ai_qp_type) {