]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
[ibacm] Add support for name cache
authorHal Rosenstock <hal@dev.mellanox.co.il>
Fri, 19 Jul 2013 18:30:04 +0000 (14:30 -0400)
committerSean Hefty <sean.hefty@intel.com>
Thu, 25 Jul 2013 19:38:41 +0000 (12:38 -0700)
Similar to IPv4 and IPv6 preload, (host)name cache preload is
now supported in addr_preload_file when acm_hosts is specified
for addr_preload setting.

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
acm_notes.txt
ibacm_hosts.data
man/ibacm.1
src/acm.c

index d2044843f8ffd80c81ec862bb4e593328c811814..3f24322aea69b52279a6797d4556d81ccff15cbf 100644 (file)
@@ -136,7 +136,7 @@ none which does not preload these caches.  See dump_pr.notes.txt in dump_pr
 for more information on the opensm_full_v1 file format and how to configure
 OpenSM to generate this file.
 
-Additional IPv4 and IPv6 caches can be be preloaded by using the
-addr_preload option.  The default is none which does not preload these
+Additionally, the name, IPv4, and IPv6 caches can be be preloaded by using
+the addr_preload option.  The default is none which does not preload these
 caches.  To preload these caches, set this option to acm_hosts and
 configure the addr_data_file appropriately.
index 901169191373ae1cdd73b9eb3e03f0fd2cd670dd..78b978d90d7491bd0fdca02f981fadfb073bdf5b 100644 (file)
@@ -3,10 +3,13 @@
 # Entry format is:
 # address IB GID
 #
+# The address may be one of the following:
+# host_name - ascii character string, up to 31 characters
 # address - IPv4 or IPv6 formatted address
 #
 # There can be multiple entries for a single IB GID
 #
 # Samples:
+# luna3 fe80::8:f104:39a:169
 # 192.168.1.3 fe80::8:f104:39a:169
 # fe80::208:f104:39a:169 fe80::8:f104:39a:169
index 0ff58a2e653b562e03526452ea04dd3669a2abfa..fb1575220eedde3382454fefa4de274b93bd9c9c 100644 (file)
@@ -157,8 +157,8 @@ See dump_pr.notes.txt in dump_pr for more information on the
 full_opensm_v1 file format and how to configure OpenSM to
 generate this file.
 .P
-Additional IPv4 and IPv6 caches can be be preloaded by using the
-addr_preload option.  The default is none which does not preload these
+Additionally, the name, IPv4, and IPv6 caches can be be preloaded by using
+the addr_preload option.  The default is none which does not preload these
 caches. To preload these caches, set this option to acm_hosts and
 configure the addr_data_file appropriately.
 .SH "SEE ALSO"
index 7f926b4878852b728914509ecd19cacdcfc23e01..09051dc5de3b608f81f5356927d72552523cfba8 100644 (file)
--- a/src/acm.c
+++ b/src/acm.c
@@ -2832,20 +2832,18 @@ static void acm_parse_hosts_file(struct acm_ep *ep)
                        acm_log(0, "ERROR - %s is not IB GID\n", gid);
                        continue;
                }
+               memset(name, 0, ACM_MAX_ADDRESS);
                if (inet_pton(AF_INET, addr, &ip_addr) > 0) {
                        addr_type = ACM_ADDRESS_IP;
+                       memcpy(name, &ip_addr, 4);
                } else if (inet_pton(AF_INET6, addr, &ip_addr) > 0) {
                        addr_type = ACM_ADDRESS_IP6;
+                       memcpy(name, &ip_addr, sizeof(ip_addr));
                } else {
-                       acm_log(0, "ERROR - %s is not IP address\n", addr);
-                       continue;
+                       addr_type = ACM_ADDRESS_NAME;
+                       strncpy((char *)name, addr, ACM_MAX_ADDRESS);
                }
 
-               memset(name, 0, ACM_MAX_ADDRESS);
-               if (addr_type == ACM_ADDRESS_IP)
-                       memcpy(name, &ip_addr, 4);
-               else
-                       memcpy(name, &ip_addr, sizeof(ip_addr));
                dest = acm_acquire_dest(ep, addr_type, name);
                if (!dest) {
                        acm_log(0, "ERROR - unable to create dest %s\n", addr);