Skip to contentSkip to conversation

Add option to allow for ACM cache lookup performance measurement

PATCH In review Hal Rosenstock 1 participant 1 message Jun 27, 2013 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH v2 16/16 Add option to allow for ACM cache lookup performance measurement

-C option is added for resolution repetition count

---
Change since v1:
Rebased

 man/ib_acme.1 |    8 ++++++--
 src/acme.c    |   52 +++++++++++++++++++++++++++++++---------------------
 src/libacm.c  |   20 +++++++++++---------
 src/libacm.h  |    7 +++++--
 4 files changed, 53 insertions(+), 34 deletions(-)
man/ib_acme.1 +6 -2
index 6485858..e67a242 100644
@@ -1,10 +1,10 @@
-.TH "ib_acme" 7 "2013-06-15" "ib_acme" "ib_acme" ib_acme
+.TH "ib_acme" 7 "2013-06-21" "ib_acme" "ib_acme" ib_acme
 .SH NAME
 ib_acme \- test and configuration utility for the IB ACM
 .SH SYNOPSIS
 .sp
 .nf
-\fIib_acme\fR [-f addr_format] [-s src_addr] -d dest_addr [-v] [-c] [-P] [-S svc_addr]
+\fIib_acme\fR [-f addr_format] [-s src_addr] -d dest_addr [-v] [-c] [-P] [-S svc_addr] [-C repetitions]
 .fi
 .nf
 \fIib_acme\fR [-A [addr_file]] [-O [opt_file]] [-D dest_dir] [-V]
@@ -48,6 +48,10 @@ Queries performance data from the destination service
 \-S svc_addr
 address of ACM service, default: local service
 .TP
+\-C repetitions
+number of repetitions to perform resolution.  Used to measure
+performance of ACM cache lookups.  Defaults to 1. 
+.TP
 \-A [addr_file]
 With this option, the ib_acme utility automatically generates the address
 configuration file ibacm_addr.cfg.  The generated file is
src/acme.c +31 -21

105 lines not on this page · raw message

src/libacm.c +11 -9
index 274eb2d..1bf7030 100644
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2009 Intel Corporation.  All rights reserved.
+ * Copyright (c) 2013 Mellanox Technologies LTD. All rights reserved.
  *
  * This software is available to you under the OpenIB.org BSD license
  * below:
@@ -113,7 +114,7 @@ void ib_acm_disconnect(void)
 }
 
 static int acm_format_resp(struct acm_msg *msg,
-	struct ibv_path_data **paths, int *count)
+	struct ibv_path_data **paths, int *count, int print)
 {
 	struct ibv_path_data *path_data;
 	char addr[ACM_MAX_ADDRESS];
@@ -154,7 +155,8 @@ static int acm_format_resp(struct acm_msg *msg,
 			default:
 				goto err;
 			}
-			printf("Source: %s\n", addr);
+			if (print)
+				printf("Source: %s\n", addr);
 			break;
 		}
 	}
@@ -221,7 +223,7 @@ static int acm_error(uint8_t status)
 }
 
 static int acm_resolve(uint8_t *src, uint8_t *dest, uint8_t type,
-	struct ibv_path_data **paths, int *count, uint32_t flags)
+	struct ibv_path_data **paths, int *count, uint32_t flags, int print)
 {
 	struct acm_msg msg;
 	int ret, cnt = 0;
@@ -258,28 +260,28 @@ static int acm_resolve(uint8_t *src, uint8_t *dest, uint8_t type,
 		goto out;
 	}
 
-	ret = acm_format_resp(&msg, paths, count);
+	ret = acm_format_resp(&msg, paths, count, print);
 out:
 	lock_release(&lock);
 	return ret;
 }
 
 int ib_acm_resolve_name(char *src, char *dest,
-	struct ibv_path_data **paths, int *count, uint32_t flags)
+	struct ibv_path_data **paths, int *count, uint32_t flags, int print)
 {
 	return acm_resolve((uint8_t *) src, (uint8_t *) dest,
-		ACM_EP_INFO_NAME, paths, count, flags);
+		ACM_EP_INFO_NAME, paths, count, flags, print);
 }
 
 int ib_acm_resolve_ip(struct sockaddr *src, struct sockaddr *dest,
-	struct ibv_path_data **paths, int *count, uint32_t flags)
+	struct ibv_path_data **paths, int *count, uint32_t flags, int print)
 {
 	if (((struct sockaddr *) dest)->sa_family == AF_INET) {
 		return acm_resolve((uint8_t *) src, (uint8_t *) dest,
-			ACM_EP_INFO_ADDRESS_IP, paths, count, flags);
+			ACM_EP_INFO_ADDRESS_IP, paths, count, flags, print);
 	} else {
 		return acm_resolve((uint8_t *) src, (uint8_t *) dest,
-			ACM_EP_INFO_ADDRESS_IP6, paths, count, flags);
+			ACM_EP_INFO_ADDRESS_IP6, paths, count, flags, print);
 	}
 }
 
src/libacm.h +5 -2
index 61220d5..9a241aa 100644
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2009 Intel Corporation.  All rights reserved.
+ * Copyright (c) 2013 Mellanox Technologies LTD. All rights reserved.
  *
  * This software is available to you under the OpenIB.org BSD license
  * below:
@@ -36,9 +37,11 @@ int ib_acm_connect(char *dest_svc);
 void ib_acm_disconnect();
 
 int ib_acm_resolve_name(char *src, char *dest,
-	struct ibv_path_data **paths, int *count, uint32_t flags);
+	struct ibv_path_data **paths, int *count, uint32_t flags,
+	int print);
 int ib_acm_resolve_ip(struct sockaddr *src, struct sockaddr *dest,
-	struct ibv_path_data **paths, int *count, uint32_t flags);
+	struct ibv_path_data **paths, int *count, uint32_t flags,
+	int print);
 int ib_acm_resolve_path(struct ibv_path_record *path, uint32_t flags);
 #define ib_acm_free_paths(paths) free(paths)
 
Signature · 6 lines
1.7.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html