From: Sean Hefty Date: Thu, 30 Jun 2011 00:35:59 +0000 (-0700) Subject: refresh X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=a3cc34ac6a9da47d25644a6a5d19eec5c003fdb0;p=~shefty%2Fibacm.git refresh --- diff --git a/meta b/meta index 1ead45d..c7a0965 100644 --- a/meta +++ b/meta @@ -1,12 +1,11 @@ Version: 1 -Previous: 1a6d6659c9c333c8cdb144e18fe63f7e63076bb4 -Head: 4887ffbf54fd111f1ec4c30d1948e790daa6590f +Previous: 892cf361f7b772e9e44e6a5d38bd6572af27b5f7 +Head: e1350d3280457341dd720e82890fe911895cd738 Applied: deam: 3eb8f395f9a52f04c5b408812e743566e6d673fe braces: b6e7734ccc3d5e6103ae137025ec71b6bea39a63 counters: ff3d79a44beb17d1ba7e3eb724de877ae0eeebb5 - bld: 76137f6a8472a917ccd351871c664027324fea95 - refresh-temp: 4887ffbf54fd111f1ec4c30d1948e790daa6590f + bld: e1350d3280457341dd720e82890fe911895cd738 Unapplied: acm1.0.5: 1b225173756cfcec4d81d26b1160ebae7644261b name2ip: 8e00708e882239292492e13aa51c82042255933c diff --git a/patches/bld b/patches/bld index 803fa2b..3f4d9ab 100644 --- a/patches/bld +++ b/patches/bld @@ -1,5 +1,5 @@ Bottom: ed43fb0fa39a4f3f51411e8cb67ee3b7271e74c3 -Top: ed43fb0fa39a4f3f51411e8cb67ee3b7271e74c3 +Top: cd42f24f71f72296a1e200caad51f1dc74bc3f0b Author: Sean Hefty Date: 2011-06-29 17:28:57 -0700 @@ -10,4 +10,125 @@ Signed-off-by: Sean Hefty --- - +diff --git a/include/infiniband/acm.h b/include/infiniband/acm.h +index 23d8198..7a06161 100644 +--- a/include/infiniband/acm.h ++++ b/include/infiniband/acm.h +@@ -115,8 +115,12 @@ struct acm_perf_msg { + }; + + struct acm_msg { +- struct acm_hdr hdr; +- uint8_t data[ACM_MSG_DATA_LENGTH]; ++ struct acm_hdr hdr; ++ union{ ++ uint8_t data[ACM_MSG_DATA_LENGTH]; ++ struct acm_ep_addr_data resolve_data[0]; ++ uint64_t perf_data[0]; ++ }; + }; + + #endif /* ACM_H */ +diff --git a/src/libacm.c b/src/libacm.c +index 5331b2c..b57710a 100644 +--- a/src/libacm.c ++++ b/src/libacm.c +@@ -111,7 +111,7 @@ void ib_acm_disconnect(void) + } + } + +-static int acm_format_resp(struct acm_resolve_msg *msg, ++static int acm_format_resp(struct acm_msg *msg, + struct ibv_path_data **paths, int *count) + { + struct ibv_path_data *path_data; +@@ -129,8 +129,8 @@ static int acm_format_resp(struct acm_resolve_msg *msg, + for (i = 0; i < addr_cnt; i++) { + switch (msg->data[i].type) { + case ACM_EP_INFO_PATH: +- path_data[i].flags = msg->data[i].flags; +- path_data[i].path = msg->data[i].info.path; ++ path_data[i].flags = msg->resolve_data[i].flags; ++ path_data[i].path = msg->resolve_data[i].info.path; + (*count)++; + break; + default: +@@ -139,13 +139,16 @@ static int acm_format_resp(struct acm_resolve_msg *msg, + + switch (msg->data[i].type) { + case ACM_EP_INFO_ADDRESS_IP: +- inet_ntop(AF_INET, msg->data[i].info.addr, addr, sizeof addr); ++ inet_ntop(AF_INET, msg->resolve_data[i].info.addr, ++ addr, sizeof addr); + break; + case ACM_EP_INFO_ADDRESS_IP6: +- inet_ntop(AF_INET6, msg->data[i].info.addr, addr, sizeof addr); ++ inet_ntop(AF_INET6, msg->resolve_data[i].info.addr, ++ addr, sizeof addr); + break; + case ACM_EP_INFO_NAME: +- memcpy(addr, msg->data[i].info.name, ACM_MAX_ADDRESS); ++ memcpy(addr, msg->resolve_data[i].info.name, ++ ACM_MAX_ADDRESS); + break; + default: + goto err; +@@ -220,7 +223,6 @@ static int acm_resolve(uint8_t *src, uint8_t *dest, uint8_t type, + 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; + int ret, cnt = 0; + + lock_acquire(&lock); +@@ -229,13 +231,13 @@ static int acm_resolve(uint8_t *src, uint8_t *dest, uint8_t type, + msg.hdr.opcode = ACM_OP_RESOLVE; + + if (src) { +- ret = acm_format_ep_addr(&resolve_msg->data[cnt++], src, type, ++ ret = acm_format_ep_addr(&msg.resolve_data[cnt++], src, type, + ACM_EP_FLAG_SOURCE); + if (ret) + goto out; + } + +- ret = acm_format_ep_addr(&resolve_msg->data[cnt++], dest, type, ++ ret = acm_format_ep_addr(&msg.resolve_data[cnt++], dest, type, + ACM_EP_FLAG_DEST | flags); + if (ret) + goto out; +@@ -255,7 +257,7 @@ static int acm_resolve(uint8_t *src, uint8_t *dest, uint8_t type, + goto out; + } + +- ret = acm_format_resp(resolve_msg, paths, count); ++ ret = acm_format_resp(&msg, paths, count); + out: + lock_release(&lock); + return ret; +@@ -292,7 +294,7 @@ int ib_acm_resolve_path(struct ibv_path_record *path, uint32_t flags) + msg.hdr.opcode = ACM_OP_RESOLVE; + msg.hdr.length = ACM_MSG_HDR_LENGTH + ACM_MSG_EP_LENGTH; + +- data = &((struct acm_resolve_msg *) &msg)->data[0]; ++ data = &msg.resolve_data[0]; + data->flags = flags; + data->type = ACM_EP_INFO_PATH; + data->info.path = *path; +@@ -317,7 +319,6 @@ out: + int ib_acm_query_perf(uint64_t **counters, int *count) + { + struct acm_msg msg; +- struct acm_perf_msg *perf_msg = (struct acm_perf_msg *) &msg; + int ret; + + lock_acquire(&lock); +@@ -345,7 +346,7 @@ int ib_acm_query_perf(uint64_t **counters, int *count) + goto out; + } + +- memcpy(*counters, perf_msg->data, sizeof(uint64_t) * msg.hdr.data[0]); ++ memcpy(*counters, &msg.perf_data, sizeof(uint64_t) * msg.hdr.data[0]); + *count = msg.hdr.data[0]; + ret = 0; + out: diff --git a/patches/refresh-temp b/patches/refresh-temp deleted file mode 100644 index fdf75a7..0000000 --- a/patches/refresh-temp +++ /dev/null @@ -1,131 +0,0 @@ -Bottom: ed43fb0fa39a4f3f51411e8cb67ee3b7271e74c3 -Top: cd42f24f71f72296a1e200caad51f1dc74bc3f0b -Author: Sean Hefty -Date: 2011-06-29 17:35:59 -0700 - -Refresh of bld - ---- - -diff --git a/include/infiniband/acm.h b/include/infiniband/acm.h -index 23d8198..7a06161 100644 ---- a/include/infiniband/acm.h -+++ b/include/infiniband/acm.h -@@ -115,8 +115,12 @@ struct acm_perf_msg { - }; - - struct acm_msg { -- struct acm_hdr hdr; -- uint8_t data[ACM_MSG_DATA_LENGTH]; -+ struct acm_hdr hdr; -+ union{ -+ uint8_t data[ACM_MSG_DATA_LENGTH]; -+ struct acm_ep_addr_data resolve_data[0]; -+ uint64_t perf_data[0]; -+ }; - }; - - #endif /* ACM_H */ -diff --git a/src/libacm.c b/src/libacm.c -index 5331b2c..b57710a 100644 ---- a/src/libacm.c -+++ b/src/libacm.c -@@ -111,7 +111,7 @@ void ib_acm_disconnect(void) - } - } - --static int acm_format_resp(struct acm_resolve_msg *msg, -+static int acm_format_resp(struct acm_msg *msg, - struct ibv_path_data **paths, int *count) - { - struct ibv_path_data *path_data; -@@ -129,8 +129,8 @@ static int acm_format_resp(struct acm_resolve_msg *msg, - for (i = 0; i < addr_cnt; i++) { - switch (msg->data[i].type) { - case ACM_EP_INFO_PATH: -- path_data[i].flags = msg->data[i].flags; -- path_data[i].path = msg->data[i].info.path; -+ path_data[i].flags = msg->resolve_data[i].flags; -+ path_data[i].path = msg->resolve_data[i].info.path; - (*count)++; - break; - default: -@@ -139,13 +139,16 @@ static int acm_format_resp(struct acm_resolve_msg *msg, - - switch (msg->data[i].type) { - case ACM_EP_INFO_ADDRESS_IP: -- inet_ntop(AF_INET, msg->data[i].info.addr, addr, sizeof addr); -+ inet_ntop(AF_INET, msg->resolve_data[i].info.addr, -+ addr, sizeof addr); - break; - case ACM_EP_INFO_ADDRESS_IP6: -- inet_ntop(AF_INET6, msg->data[i].info.addr, addr, sizeof addr); -+ inet_ntop(AF_INET6, msg->resolve_data[i].info.addr, -+ addr, sizeof addr); - break; - case ACM_EP_INFO_NAME: -- memcpy(addr, msg->data[i].info.name, ACM_MAX_ADDRESS); -+ memcpy(addr, msg->resolve_data[i].info.name, -+ ACM_MAX_ADDRESS); - break; - default: - goto err; -@@ -220,7 +223,6 @@ static int acm_resolve(uint8_t *src, uint8_t *dest, uint8_t type, - 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; - int ret, cnt = 0; - - lock_acquire(&lock); -@@ -229,13 +231,13 @@ static int acm_resolve(uint8_t *src, uint8_t *dest, uint8_t type, - msg.hdr.opcode = ACM_OP_RESOLVE; - - if (src) { -- ret = acm_format_ep_addr(&resolve_msg->data[cnt++], src, type, -+ ret = acm_format_ep_addr(&msg.resolve_data[cnt++], src, type, - ACM_EP_FLAG_SOURCE); - if (ret) - goto out; - } - -- ret = acm_format_ep_addr(&resolve_msg->data[cnt++], dest, type, -+ ret = acm_format_ep_addr(&msg.resolve_data[cnt++], dest, type, - ACM_EP_FLAG_DEST | flags); - if (ret) - goto out; -@@ -255,7 +257,7 @@ static int acm_resolve(uint8_t *src, uint8_t *dest, uint8_t type, - goto out; - } - -- ret = acm_format_resp(resolve_msg, paths, count); -+ ret = acm_format_resp(&msg, paths, count); - out: - lock_release(&lock); - return ret; -@@ -292,7 +294,7 @@ int ib_acm_resolve_path(struct ibv_path_record *path, uint32_t flags) - msg.hdr.opcode = ACM_OP_RESOLVE; - msg.hdr.length = ACM_MSG_HDR_LENGTH + ACM_MSG_EP_LENGTH; - -- data = &((struct acm_resolve_msg *) &msg)->data[0]; -+ data = &msg.resolve_data[0]; - data->flags = flags; - data->type = ACM_EP_INFO_PATH; - data->info.path = *path; -@@ -317,7 +319,6 @@ out: - int ib_acm_query_perf(uint64_t **counters, int *count) - { - struct acm_msg msg; -- struct acm_perf_msg *perf_msg = (struct acm_perf_msg *) &msg; - int ret; - - lock_acquire(&lock); -@@ -345,7 +346,7 @@ int ib_acm_query_perf(uint64_t **counters, int *count) - goto out; - } - -- memcpy(*counters, perf_msg->data, sizeof(uint64_t) * msg.hdr.data[0]); -+ memcpy(*counters, &msg.perf_data, sizeof(uint64_t) * msg.hdr.data[0]); - *count = msg.hdr.data[0]; - ret = 0; - out: