-Bottom: 30326a5093b7b177c8d7612eba401d4999793f71
-Top: 18456ee741149c35b5859c6627ad1b4824322404
+Bottom: a9f2547719cd51bede8c11e59c05218503096632
+Top: 9962a940efd219c52418715f8e1c4d496699b292
Author: Sean Hefty <sean.hefty@intel.com>
Date: 2010-11-15 14:08:15 -0800
---
diff --git a/src/acm.c b/src/acm.c
-index 820365c..27a6a25 100644
+index 692e881..daa0985 100644
--- a/src/acm.c
+++ b/src/acm.c
@@ -37,6 +37,7 @@
fprintf(flog, msg);
switch (addr_type) {
case ACM_EP_INFO_NAME:
-@@ -289,7 +296,7 @@ acm_alloc_dest(uint8_t addr_type, uint8_t *addr)
+@@ -293,7 +300,7 @@ acm_alloc_dest(uint8_t addr_type, uint8_t *addr)
}
acm_init_dest(dest, addr_type, addr, ACM_MAX_ADDRESS);
return dest;
}
-@@ -303,17 +310,18 @@ acm_get_dest(struct acm_ep *ep, uint8_t addr_type, uint8_t *addr)
+@@ -307,17 +314,18 @@ acm_get_dest(struct acm_ep *ep, uint8_t addr_type, uint8_t *addr)
if (tdest) {
dest = *tdest;
(void) atomic_inc(&dest->refcnt);
if (atomic_dec(&dest->refcnt) == 0) {
free(dest);
}
-@@ -361,7 +369,7 @@ acm_alloc_req(struct acm_client *client, struct acm_resolve_msg *msg)
+@@ -365,7 +373,7 @@ acm_alloc_req(struct acm_client *client, struct acm_resolve_msg *msg)
(void) atomic_inc(&client->refcnt);
req->client = client;
memcpy(&req->msg, msg, sizeof(req->msg));
return req;
}
-@@ -736,7 +744,7 @@ static uint8_t acm_resolve_path(struct acm_ep *ep, struct acm_dest *dest,
+@@ -740,7 +748,7 @@ static uint8_t acm_resolve_path(struct acm_ep *ep, struct acm_dest *dest,
struct acm_send_msg *msg;
struct ib_sa_mad *mad;
msg = acm_alloc_send(ep, &ep->port->sa_dest, sizeof(*mad));
if (!msg) {
acm_log(0, "ERROR - cannot allocate send msg\n");
-@@ -764,7 +772,7 @@ acm_record_acm_addr(struct acm_ep *ep, struct acm_dest *dest, struct ibv_wc *wc,
+@@ -768,7 +776,7 @@ acm_record_acm_addr(struct acm_ep *ep, struct acm_dest *dest, struct ibv_wc *wc,
{
int index;
index = acm_best_mc_index(ep, rec);
if (index < 0) {
acm_log(0, "ERROR - no shared multicast groups\n");
-@@ -814,7 +822,7 @@ acm_send_addr_resp(struct acm_ep *ep, struct acm_dest *dest)
+@@ -818,7 +826,7 @@ acm_send_addr_resp(struct acm_ep *ep, struct acm_dest *dest)
struct acm_send_msg *msg;
struct acm_mad *mad;
msg = acm_alloc_send(ep, dest, sizeof (*mad));
if (!msg) {
acm_log(0, "ERROR - failed to allocate message\n");
-@@ -845,7 +853,7 @@ acm_client_resolve_resp(struct acm_client *client, struct acm_resolve_msg *req_m
+@@ -849,7 +857,7 @@ acm_client_resolve_resp(struct acm_client *client, struct acm_resolve_msg *req_m
struct acm_resolve_msg *resp_msg = (struct acm_resolve_msg *) &msg;
int ret;
memset(&msg, 0, sizeof msg);
lock_acquire(&client->lock);
-@@ -900,7 +908,7 @@ acm_complete_queued_req(struct acm_dest *dest, uint8_t status)
+@@ -904,7 +912,7 @@ acm_complete_queued_req(struct acm_dest *dest, uint8_t status)
req = container_of(entry, struct acm_request, entry);
lock_release(&dest->lock);
acm_client_resolve_resp(req->client,
(struct acm_resolve_msg *) &req->msg, dest, status);
acm_free_req(req);
-@@ -923,9 +931,11 @@ acm_dest_sa_resp(struct acm_send_msg *msg, struct ibv_wc *wc, struct acm_mad *ma
+@@ -927,9 +935,11 @@ acm_dest_sa_resp(struct acm_send_msg *msg, struct ibv_wc *wc, struct acm_mad *ma
status = ACM_STATUS_ETIMEDOUT;
}
acm_log(2, "resp status 0x%x\n", status);
lock_release(&dest->lock);
return;
}
-@@ -992,11 +1002,13 @@ acm_process_addr_req(struct acm_ep *ep, struct ibv_wc *wc, struct acm_mad *mad)
+@@ -996,11 +1006,13 @@ acm_process_addr_req(struct acm_ep *ep, struct ibv_wc *wc, struct acm_mad *mad)
dest->req_id = mad->tid;
lock_acquire(&dest->lock);
ibv_destroy_ah(dest->ah); // TODO: ah could be in use
/* fall through */
case ACM_INIT:
-@@ -1078,6 +1090,7 @@ put:
+@@ -1082,6 +1094,7 @@ put:
static void acm_process_acm_recv(struct acm_ep *ep, struct ibv_wc *wc, struct acm_mad *mad)
{
struct acm_send_msg *req;
int free;
acm_log(2, "\n");
-@@ -1092,6 +1105,9 @@ static void acm_process_acm_recv(struct acm_ep *ep, struct ibv_wc *wc, struct ac
+@@ -1096,6 +1109,9 @@ static void acm_process_acm_recv(struct acm_ep *ep, struct ibv_wc *wc, struct ac
return;
}
if (mad->method & IB_METHOD_RESP) {
acm_log(2, "received response\n");
req = acm_get_request(ep, mad->tid, &free);
-@@ -1187,7 +1203,7 @@ static void acm_process_recv(struct acm_ep *ep, struct ibv_wc *wc)
+@@ -1191,7 +1207,7 @@ static void acm_process_recv(struct acm_ep *ep, struct ibv_wc *wc)
{
struct acm_mad *mad;
mad = (struct acm_mad *) (uintptr_t) (wc->wr_id + sizeof(struct ibv_grh));
switch (mad->mgmt_class) {
case IB_MGMT_CLASS_SA:
-@@ -1635,7 +1651,7 @@ static void acm_svr_accept(void)
+@@ -1639,7 +1655,7 @@ static void acm_svr_accept(void)
client[i].sock = s;
atomic_set(&client[i].refcnt, 1);
}
static uint8_t acm_svr_query_sa(struct acm_ep *ep, struct acm_request *req)
-@@ -1711,7 +1727,7 @@ acm_svr_query(struct acm_client *client, struct acm_resolve_msg *msg)
+@@ -1715,7 +1731,7 @@ acm_svr_query(struct acm_client *client, struct acm_resolve_msg *msg)
struct acm_ep *ep;
uint8_t status;
if (msg->hdr.length != ACM_MSG_HDR_LENGTH + ACM_MSG_EP_LENGTH) {
acm_log(0, "ERROR - invalid length: 0x%x\n", msg->hdr.length);
status = ACM_STATUS_EINVAL;
-@@ -1916,7 +1932,7 @@ acm_svr_queue_req(struct acm_dest *dest, struct acm_client *client,
+@@ -1920,7 +1936,7 @@ acm_svr_queue_req(struct acm_dest *dest, struct acm_client *client,
{
struct acm_request *req;
req = acm_alloc_req(client, msg);
if (!req) {
return ACM_STATUS_ENOMEM;
-@@ -1935,6 +1951,7 @@ acm_svr_resolve(struct acm_client *client, struct acm_resolve_msg *msg)
+@@ -1939,6 +1955,7 @@ acm_svr_resolve(struct acm_client *client, struct acm_resolve_msg *msg)
uint8_t status;
int ret;
status = acm_svr_verify_resolve(msg, &saddr, &daddr);
if (status) {
acm_log(0, "misformatted or unsupported request\n");
-@@ -2006,7 +2023,7 @@ static void acm_svr_receive(struct acm_client *client)
+@@ -2010,7 +2027,7 @@ static void acm_svr_receive(struct acm_client *client)
struct acm_resolve_msg *resolve_msg = (struct acm_resolve_msg *) &msg;
int ret;