Bottom: 5cb19eb81ed40ac6bba59f5d10974e9fc25a49af
-Top: 9bd0de553ed9e9568bbdd22a2f0ccafa4a17450f
+Top: 9a270ff78976ad2fad44919c3ccfde93246bfe39
Author: Sean Hefty <sean.hefty@intel.com>
Date: 2010-12-06 13:07:41 -0800
#define ACM_MSG_HDR_LENGTH 16
#define ACM_MAX_ADDRESS 64
+diff --git a/man/ib_acme.1 b/man/ib_acme.1
+index 0c0e332..52000a3 100644
+--- a/man/ib_acme.1
++++ b/man/ib_acme.1
+@@ -37,6 +37,10 @@ Indicates that the resolved path information should be verified with the
+ active IB SA. Use of the -v option provides a sanity check that\r
+ resolved path information is usable given the current cluster configuration.\r
+ .TP\r
++\-c\r
++Instructs the ACM service to only returned information that currently resides\r
++in its local cache.\r
++.TP\r
+ \-A\r
+ With this option, the ib_acme utility automatically generates the address\r
+ configuration file acm_addr.cfg. The generated file is\r
diff --git a/src/acme.c b/src/acme.c
-index cc34577..f14912a 100644
+index cc34577..3ee2073 100644
--- a/src/acme.c
+++ b/src/acme.c
-@@ -70,6 +70,7 @@ static void show_usage(char *program)
+@@ -51,6 +51,7 @@ static char *dest_addr;
+ static char *src_addr;
+ static char addr_type = 'i';
+ static int verify;
++static int nodelay;
+ static int make_addr;
+ static int make_opts;
+ int verbose;
+@@ -70,6 +71,7 @@ static void show_usage(char *program)
printf(" -s src_addr - format defined by -f option\n");
printf(" -d dest_addr - format defined by -f option\n");
printf(" [-v] - verify ACM response against SA query response\n");
printf("usage 2: %s\n", program);
printf(" -A [addr_file] - generate local address configuration file\n");
printf(" (default is %s)\n", ACM_ADDR_FILE);
-@@ -550,7 +551,7 @@ int CDECL_FUNC main(int argc, char **argv)
+@@ -418,6 +420,16 @@ static void show_path(struct ibv_path_record *path)
+ printf(" packet lifetime: %d\n", path->packetlifetime & 0x1F);
+ }
+
++static uint32_t get_resolve_flags()
++{
++ uint32_t flags = 0;
++
++ if (nodelay)
++ flags |= ACM_FLAGS_NODELAY;
++
++ return flags;
++}
++
+ static int resolve_ip(struct ibv_path_record *path)
+ {
+ struct ibv_path_data *paths;
+@@ -439,7 +451,7 @@ static int resolve_ip(struct ibv_path_record *path)
+ }
+
+ ret = ib_acm_resolve_ip((struct sockaddr *) &src, (struct sockaddr *) &dest,
+- &paths, &count);
++ &paths, &count, get_resolve_flags());
+ if (ret) {
+ printf("ib_acm_resolve_ip failed: 0x%x\n", ret);
+ return ret;
+@@ -455,7 +467,7 @@ static int resolve_name(struct ibv_path_record *path)
+ struct ibv_path_data *paths;
+ int ret, count;
+
+- ret = ib_acm_resolve_name(src_addr, dest_addr, &paths, &count);
++ ret = ib_acm_resolve_name(src_addr, dest_addr, &paths, &count, get_resolve_flags());
+ if (ret) {
+ printf("ib_acm_resolve_name failed: 0x%x\n", ret);
+ return ret;
+@@ -550,7 +562,7 @@ int CDECL_FUNC main(int argc, char **argv)
if (ret)
goto out;
switch (op) {
case 'f':
addr_type = optarg[0];
-@@ -564,6 +565,9 @@ int CDECL_FUNC main(int argc, char **argv)
+@@ -564,6 +576,9 @@ int CDECL_FUNC main(int argc, char **argv)
case 'v':
verify = 1;
break;
case 'A':
make_addr = 1;
if (opt_arg(argc, argv))
+diff --git a/src/libacm.c b/src/libacm.c
+index 3ce0cd0..59a181b 100644
+--- a/src/libacm.c
++++ b/src/libacm.c
+@@ -143,7 +143,7 @@ err:
+ }
+
+ static int acm_resolve(uint8_t *src, uint8_t *dest, uint8_t type,
+- struct ibv_path_data **paths, int *count)
++ struct ibv_path_data **paths, int *count, uint32_t flags)
+ {
+ struct acm_msg msg;
+ struct acm_resolve_msg *resolve_msg = (struct acm_resolve_msg *) &msg;
+@@ -162,7 +162,7 @@ static int acm_resolve(uint8_t *src, uint8_t *dest, uint8_t type,
+ src_data->type = type;
+ src_data->flags = ACM_EP_FLAG_SOURCE;
+ dest_data->type = type;
+- dest_data->flags = ACM_EP_FLAG_DEST;
++ dest_data->flags = ACM_EP_FLAG_DEST | flags;
+
+ switch (type) {
+ case ACM_EP_INFO_NAME:
+@@ -202,21 +202,21 @@ out:
+ }
+
+ int ib_acm_resolve_name(char *src, char *dest,
+- struct ibv_path_data **paths, int *count)
++ struct ibv_path_data **paths, int *count, uint32_t flags)
+ {
+ return acm_resolve((uint8_t *) src, (uint8_t *) dest,
+- ACM_EP_INFO_NAME, paths, count);
++ ACM_EP_INFO_NAME, paths, count, flags);
+ }
+
+ int ib_acm_resolve_ip(struct sockaddr *src, struct sockaddr *dest,
+- struct ibv_path_data **paths, int *count)
++ struct ibv_path_data **paths, int *count, uint32_t flags)
+ {
+ if (((struct sockaddr *) dest)->sa_family == AF_INET) {
+ return acm_resolve((uint8_t *) src, (uint8_t *) dest,
+- ACM_EP_INFO_ADDRESS_IP, paths, count);
++ ACM_EP_INFO_ADDRESS_IP, paths, count, flags);
+ } else {
+ return acm_resolve((uint8_t *) src, (uint8_t *) dest,
+- ACM_EP_INFO_ADDRESS_IP6, paths, count);
++ ACM_EP_INFO_ADDRESS_IP6, paths, count, flags);
+ }
+ }
+
+diff --git a/src/libacm.h b/src/libacm.h
+index 302099b..16df8b0 100644
+--- a/src/libacm.h
++++ b/src/libacm.h
+@@ -33,8 +33,8 @@ int libacm_init();
+ void libacm_cleanup();
+
+ int ib_acm_resolve_name(char *src, char *dest,
+- struct ibv_path_data **paths, int *count);
++ struct ibv_path_data **paths, int *count, uint32_t flags);
+ int ib_acm_resolve_ip(struct sockaddr *src, struct sockaddr *dest,
+- struct ibv_path_data **paths, int *count);
++ struct ibv_path_data **paths, int *count, uint32_t flags);
+ int ib_acm_resolve_path(struct ibv_path_record *path, uint32_t flags);
+ #define ib_acm_free_paths(paths) free(paths)
+++ /dev/null
-Bottom: 9bd0de553ed9e9568bbdd22a2f0ccafa4a17450f
-Top: 9a270ff78976ad2fad44919c3ccfde93246bfe39
-Author: Sean Hefty <sean.hefty@intel.com>
-Date: 2010-12-06 15:49:25 -0800
-
-Refresh of nodelay
-
----
-
-diff --git a/man/ib_acme.1 b/man/ib_acme.1
-index 0c0e332..52000a3 100644
---- a/man/ib_acme.1
-+++ b/man/ib_acme.1
-@@ -37,6 +37,10 @@ Indicates that the resolved path information should be verified with the
- active IB SA. Use of the -v option provides a sanity check that\r
- resolved path information is usable given the current cluster configuration.\r
- .TP\r
-+\-c\r
-+Instructs the ACM service to only returned information that currently resides\r
-+in its local cache.\r
-+.TP\r
- \-A\r
- With this option, the ib_acme utility automatically generates the address\r
- configuration file acm_addr.cfg. The generated file is\r
-diff --git a/src/acme.c b/src/acme.c
-index f14912a..3ee2073 100644
---- a/src/acme.c
-+++ b/src/acme.c
-@@ -51,6 +51,7 @@ static char *dest_addr;
- static char *src_addr;
- static char addr_type = 'i';
- static int verify;
-+static int nodelay;
- static int make_addr;
- static int make_opts;
- int verbose;
-@@ -419,6 +420,16 @@ static void show_path(struct ibv_path_record *path)
- printf(" packet lifetime: %d\n", path->packetlifetime & 0x1F);
- }
-
-+static uint32_t get_resolve_flags()
-+{
-+ uint32_t flags = 0;
-+
-+ if (nodelay)
-+ flags |= ACM_FLAGS_NODELAY;
-+
-+ return flags;
-+}
-+
- static int resolve_ip(struct ibv_path_record *path)
- {
- struct ibv_path_data *paths;
-@@ -440,7 +451,7 @@ static int resolve_ip(struct ibv_path_record *path)
- }
-
- ret = ib_acm_resolve_ip((struct sockaddr *) &src, (struct sockaddr *) &dest,
-- &paths, &count);
-+ &paths, &count, get_resolve_flags());
- if (ret) {
- printf("ib_acm_resolve_ip failed: 0x%x\n", ret);
- return ret;
-@@ -456,7 +467,7 @@ static int resolve_name(struct ibv_path_record *path)
- struct ibv_path_data *paths;
- int ret, count;
-
-- ret = ib_acm_resolve_name(src_addr, dest_addr, &paths, &count);
-+ ret = ib_acm_resolve_name(src_addr, dest_addr, &paths, &count, get_resolve_flags());
- if (ret) {
- printf("ib_acm_resolve_name failed: 0x%x\n", ret);
- return ret;
-diff --git a/src/libacm.c b/src/libacm.c
-index 3ce0cd0..59a181b 100644
---- a/src/libacm.c
-+++ b/src/libacm.c
-@@ -143,7 +143,7 @@ err:
- }
-
- static int acm_resolve(uint8_t *src, uint8_t *dest, uint8_t type,
-- struct ibv_path_data **paths, int *count)
-+ struct ibv_path_data **paths, int *count, uint32_t flags)
- {
- struct acm_msg msg;
- struct acm_resolve_msg *resolve_msg = (struct acm_resolve_msg *) &msg;
-@@ -162,7 +162,7 @@ static int acm_resolve(uint8_t *src, uint8_t *dest, uint8_t type,
- src_data->type = type;
- src_data->flags = ACM_EP_FLAG_SOURCE;
- dest_data->type = type;
-- dest_data->flags = ACM_EP_FLAG_DEST;
-+ dest_data->flags = ACM_EP_FLAG_DEST | flags;
-
- switch (type) {
- case ACM_EP_INFO_NAME:
-@@ -202,21 +202,21 @@ out:
- }
-
- int ib_acm_resolve_name(char *src, char *dest,
-- struct ibv_path_data **paths, int *count)
-+ struct ibv_path_data **paths, int *count, uint32_t flags)
- {
- return acm_resolve((uint8_t *) src, (uint8_t *) dest,
-- ACM_EP_INFO_NAME, paths, count);
-+ ACM_EP_INFO_NAME, paths, count, flags);
- }
-
- int ib_acm_resolve_ip(struct sockaddr *src, struct sockaddr *dest,
-- struct ibv_path_data **paths, int *count)
-+ struct ibv_path_data **paths, int *count, uint32_t flags)
- {
- if (((struct sockaddr *) dest)->sa_family == AF_INET) {
- return acm_resolve((uint8_t *) src, (uint8_t *) dest,
-- ACM_EP_INFO_ADDRESS_IP, paths, count);
-+ ACM_EP_INFO_ADDRESS_IP, paths, count, flags);
- } else {
- return acm_resolve((uint8_t *) src, (uint8_t *) dest,
-- ACM_EP_INFO_ADDRESS_IP6, paths, count);
-+ ACM_EP_INFO_ADDRESS_IP6, paths, count, flags);
- }
- }
-
-diff --git a/src/libacm.h b/src/libacm.h
-index 302099b..16df8b0 100644
---- a/src/libacm.h
-+++ b/src/libacm.h
-@@ -33,8 +33,8 @@ int libacm_init();
- void libacm_cleanup();
-
- int ib_acm_resolve_name(char *src, char *dest,
-- struct ibv_path_data **paths, int *count);
-+ struct ibv_path_data **paths, int *count, uint32_t flags);
- int ib_acm_resolve_ip(struct sockaddr *src, struct sockaddr *dest,
-- struct ibv_path_data **paths, int *count);
-+ struct ibv_path_data **paths, int *count, uint32_t flags);
- int ib_acm_resolve_path(struct ibv_path_record *path, uint32_t flags);
- #define ib_acm_free_paths(paths) free(paths)