Bottom: b2af32a606dc3c3e64f150250320dc7d52426926
-Top: 93dfcd4be8bc16c920d7e571b1264983a3927e6a
+Top: 68adc0c9d48fa548f1cc79f409dba0cfd472afd3
Author: Sean Hefty <sean.hefty@intel.com>
Date: 2010-12-13 10:35:40 -0800
---
diff --git a/src/acm.c b/src/acm.c
-index e0f0b94..9f6a13b 100644
+index e0f0b94..ce30afc 100644
--- a/src/acm.c
+++ b/src/acm.c
@@ -268,8 +268,13 @@ acm_format_name(int level, char *name, size_t name_size,
+ ntohs(path->slid), ntohs(path->dlid));
+ } else {
+ acm_format_name(level, name, name_size, ACM_ADDRESS_GID,
-+ &path->dgid, sizeof path->dgid);
++ &path->dgid.raw, sizeof path->dgid);
+ }
break;
case ACM_ADDRESS_LID:
}
}
-+static int ib_gid_any(union ibv_gid *gid)
++static int ib_any_gid(union ibv_gid *gid)
+{
-+ return ((gid->subnet_prefix | gid->interface_id) == 0);
++ return ((gid->global.subnet_prefix | gid->global.interface_id) == 0);
+}
+
static int acm_compare_dest(const void *dest1, const void *dest2)
acm_log(2, "\n");
+ for (i = 0; i < MAX_EP_MC; i++) {
-+ if (dest->mgid == ep->mc_dest[i].mgid)
++ if (!memcmp(&dest->mgid, &ep->mc_dest[i].mgid, sizeof dest->mgid))
+ break;
+ }
+ if (i == MAX_EP_MC) {
dest->ah = ibv_create_ah(ep->port->dev->pd, &dest->av);
if (!dest->ah) {
acm_log(0, "ERROR - failed to create ah\n");
-@@ -775,8 +799,7 @@ static uint8_t acm_resolve_path(struct acm_ep *ep, struct acm_dest *dest,
+@@ -753,6 +777,59 @@ static void acm_init_path_query(struct ib_sa_mad *mad)
+ mad->attr_id = IB_SA_ATTR_PATH_REC;
+ }
+
++static uint64_t acm_path_comp_mask(struct ibv_path_record *path)
++{
++ uint32_t fl_hop;
++ uint16_t qos_sl;
++ uint64_t comp_mask = 0;
++
++ acm_log(2, "\n");
++ if (path->service_id)
++ comp_mask |= IB_COMP_MASK_PR_SERVICE_ID;
++ if (!ib_any_gid(&path->dgid))
++ comp_mask |= IB_COMP_MASK_PR_DGID;
++ if (!ib_any_gid(&path->sgid))
++ comp_mask |= IB_COMP_MASK_PR_SGID;
++ if (path->dlid)
++ comp_mask |= IB_COMP_MASK_PR_DLID;
++ if (path->slid)
++ comp_mask |= IB_COMP_MASK_PR_SLID;
++
++ fl_hop = ntohl(path->flowlabel_hoplimit);
++ if (fl_hop >> 8)
++ comp_mask |= IB_COMP_MASK_PR_FLOW_LABEL;
++ if (fl_hop & 0xFF)
++ comp_mask |= IB_COMP_MASK_PR_HOP_LIMIT;
++
++ if (path->tclass)
++ comp_mask |= IB_COMP_MASK_PR_TCLASS;
++ if (path->reversible_numpath & 0x80)
++ comp_mask |= IB_COMP_MASK_PR_REVERSIBLE;
++ if (path->pkey)
++ comp_mask |= IB_COMP_MASK_PR_PKEY;
++
++ qos_sl = ntohs(path->qosclass_sl);
++ if (qos_sl >> 4)
++ comp_mask |= IB_COMP_MASK_PR_QOS_CLASS;
++ if (qos_sl & 0xF)
++ comp_mask |= IB_COMP_MASK_PR_SL;
++
++ if (path->mtu & 0xC0)
++ comp_mask |= IB_COMP_MASK_PR_MTU_SELECTOR;
++ if (path->mtu & 0x3F)
++ comp_mask |= IB_COMP_MASK_PR_MTU;
++ if (path->rate & 0xC0)
++ comp_mask |= IB_COMP_MASK_PR_RATE_SELECTOR;
++ if (path->rate & 0x3F)
++ comp_mask |= IB_COMP_MASK_PR_RATE;
++ if (path->packetlifetime & 0xC0)
++ comp_mask |= IB_COMP_MASK_PR_PACKET_LIFETIME_SELECTOR;
++ if (path->packetlifetime & 0x3F)
++ comp_mask |= IB_COMP_MASK_PR_PACKET_LIFETIME;
++
++ return comp_mask;
++}
++
+ /* Caller must hold dest lock */
+ static uint8_t acm_resolve_path(struct acm_ep *ep, struct acm_dest *dest,
+ void (*resp_handler)(struct acm_send_msg *req,
+@@ -775,8 +852,7 @@ static uint8_t acm_resolve_path(struct acm_ep *ep, struct acm_dest *dest,
acm_init_path_query(mad);
memcpy(mad->data, &dest->path, sizeof(dest->path));
dest->state = ACM_QUERY_ROUTE;
acm_post_send(&ep->sa_queue, msg);
-@@ -804,16 +827,29 @@ acm_record_acm_addr(struct acm_ep *ep, struct acm_dest *dest, struct ibv_wc *wc,
+@@ -804,16 +880,29 @@ acm_record_acm_addr(struct acm_ep *ep, struct acm_dest *dest, struct ibv_wc *wc,
dest->av.grh.dgid = ((struct ibv_grh *) (uintptr_t) wc->wr_id)->sgid;
dest->mgid = ep->mc_dest[index].mgid;
static uint8_t acm_validate_addr_req(struct acm_mad *mad)
{
struct acm_resolve_rec *rec;
-@@ -959,10 +995,12 @@ acm_dest_sa_resp(struct acm_send_msg *msg, struct ibv_wc *wc, struct acm_mad *ma
+@@ -959,10 +1048,12 @@ acm_dest_sa_resp(struct acm_send_msg *msg, struct ibv_wc *wc, struct acm_mad *ma
if (!status) {
memcpy(&dest->path, sa_mad->data, sizeof(dest->path));
acm_init_path_av(msg->ep->port, dest);
}
}
if (!status) {
-@@ -1313,9 +1351,9 @@ static uint64_t acm_path_comp_mask(struct ibv_path_record *path)
- acm_log(2, "\n");
- if (path->service_id)
- comp_mask |= IB_COMP_MASK_PR_SERVICE_ID;
+@@ -1304,59 +1395,6 @@ static void acm_format_mgid(union ibv_gid *mgid, uint16_t pkey, uint8_t tos,
+ mgid->raw[15] = 0;
+ }
+
+-static uint64_t acm_path_comp_mask(struct ibv_path_record *path)
+-{
+- uint32_t fl_hop;
+- uint16_t qos_sl;
+- uint64_t comp_mask = 0;
+-
+- acm_log(2, "\n");
+- if (path->service_id)
+- comp_mask |= IB_COMP_MASK_PR_SERVICE_ID;
- if (path->dgid.global.interface_id || path->dgid.global.subnet_prefix)
-+ if (!ib_any_gid(&path->dgid))
- comp_mask |= IB_COMP_MASK_PR_DGID;
+- comp_mask |= IB_COMP_MASK_PR_DGID;
- if (path->sgid.global.interface_id || path->sgid.global.subnet_prefix)
-+ if (!ib_any_gid(&path->sgid))
- comp_mask |= IB_COMP_MASK_PR_SGID;
- if (path->dlid)
- comp_mask |= IB_COMP_MASK_PR_DLID;
+- comp_mask |= IB_COMP_MASK_PR_SGID;
+- if (path->dlid)
+- comp_mask |= IB_COMP_MASK_PR_DLID;
+- if (path->slid)
+- comp_mask |= IB_COMP_MASK_PR_SLID;
+-
+- fl_hop = ntohl(path->flowlabel_hoplimit);
+- if (fl_hop >> 8)
+- comp_mask |= IB_COMP_MASK_PR_FLOW_LABEL;
+- if (fl_hop & 0xFF)
+- comp_mask |= IB_COMP_MASK_PR_HOP_LIMIT;
+-
+- if (path->tclass)
+- comp_mask |= IB_COMP_MASK_PR_TCLASS;
+- if (path->reversible_numpath & 0x80)
+- comp_mask |= IB_COMP_MASK_PR_REVERSIBLE;
+- if (path->pkey)
+- comp_mask |= IB_COMP_MASK_PR_PKEY;
+-
+- qos_sl = ntohs(path->qosclass_sl);
+- if (qos_sl >> 4)
+- comp_mask |= IB_COMP_MASK_PR_QOS_CLASS;
+- if (qos_sl & 0xF)
+- comp_mask |= IB_COMP_MASK_PR_SL;
+-
+- if (path->mtu & 0xC0)
+- comp_mask |= IB_COMP_MASK_PR_MTU_SELECTOR;
+- if (path->mtu & 0x3F)
+- comp_mask |= IB_COMP_MASK_PR_MTU;
+- if (path->rate & 0xC0)
+- comp_mask |= IB_COMP_MASK_PR_RATE_SELECTOR;
+- if (path->rate & 0x3F)
+- comp_mask |= IB_COMP_MASK_PR_RATE;
+- if (path->packetlifetime & 0xC0)
+- comp_mask |= IB_COMP_MASK_PR_PACKET_LIFETIME_SELECTOR;
+- if (path->packetlifetime & 0x3F)
+- comp_mask |= IB_COMP_MASK_PR_PACKET_LIFETIME;
+-
+- return comp_mask;
+-}
+-
+ static void acm_init_join(struct ib_sa_mad *mad, union ibv_gid *port_gid,
+ uint16_t pkey, uint8_t tos, uint8_t tclass, uint8_t sl, uint8_t rate, uint8_t mtu)
+ {
@@ -1708,6 +1746,15 @@ static uint8_t acm_svr_query_sa(struct acm_ep *ep, struct acm_request *req)
return ACM_STATUS_SUCCESS;
}
+acm_is_path_from_port(struct acm_port *port, struct ibv_path_record *path)
+{
+ if (ib_any_gid(&path->sgid)) {
-+ return (port->lid == (ntohs(path.slid) & port->lid_mask));
++ return (port->lid == (ntohs(path->slid) & port->lid_mask));
+ }
+ return (acm_gid_index(port, &path->sgid) < port->gid_cnt);
+}
+++ /dev/null
-Bottom: 93dfcd4be8bc16c920d7e571b1264983a3927e6a
-Top: 68adc0c9d48fa548f1cc79f409dba0cfd472afd3
-Author: Sean Hefty <sean.hefty@intel.com>
-Date: 2010-12-17 08:20:41 -0800
-
-Refresh of lid
-
----
-
-diff --git a/src/acm.c b/src/acm.c
-index 9f6a13b..ce30afc 100644
---- a/src/acm.c
-+++ b/src/acm.c
-@@ -273,7 +273,7 @@ acm_format_name(int level, char *name, size_t name_size,
- ntohs(path->slid), ntohs(path->dlid));
- } else {
- acm_format_name(level, name, name_size, ACM_ADDRESS_GID,
-- &path->dgid, sizeof path->dgid);
-+ &path->dgid.raw, sizeof path->dgid);
- }
- break;
- case ACM_ADDRESS_LID:
-@@ -285,9 +285,9 @@ acm_format_name(int level, char *name, size_t name_size,
- }
- }
-
--static int ib_gid_any(union ibv_gid *gid)
-+static int ib_any_gid(union ibv_gid *gid)
- {
-- return ((gid->subnet_prefix | gid->interface_id) == 0);
-+ return ((gid->global.subnet_prefix | gid->global.interface_id) == 0);
- }
-
- static int acm_compare_dest(const void *dest1, const void *dest2)
-@@ -741,7 +741,7 @@ acm_record_acm_route(struct acm_ep *ep, struct acm_dest *dest)
-
- acm_log(2, "\n");
- for (i = 0; i < MAX_EP_MC; i++) {
-- if (dest->mgid == ep->mc_dest[i].mgid)
-+ if (!memcmp(&dest->mgid, &ep->mc_dest[i].mgid, sizeof dest->mgid))
- break;
- }
- if (i == MAX_EP_MC) {
-@@ -777,6 +777,59 @@ static void acm_init_path_query(struct ib_sa_mad *mad)
- mad->attr_id = IB_SA_ATTR_PATH_REC;
- }
-
-+static uint64_t acm_path_comp_mask(struct ibv_path_record *path)
-+{
-+ uint32_t fl_hop;
-+ uint16_t qos_sl;
-+ uint64_t comp_mask = 0;
-+
-+ acm_log(2, "\n");
-+ if (path->service_id)
-+ comp_mask |= IB_COMP_MASK_PR_SERVICE_ID;
-+ if (!ib_any_gid(&path->dgid))
-+ comp_mask |= IB_COMP_MASK_PR_DGID;
-+ if (!ib_any_gid(&path->sgid))
-+ comp_mask |= IB_COMP_MASK_PR_SGID;
-+ if (path->dlid)
-+ comp_mask |= IB_COMP_MASK_PR_DLID;
-+ if (path->slid)
-+ comp_mask |= IB_COMP_MASK_PR_SLID;
-+
-+ fl_hop = ntohl(path->flowlabel_hoplimit);
-+ if (fl_hop >> 8)
-+ comp_mask |= IB_COMP_MASK_PR_FLOW_LABEL;
-+ if (fl_hop & 0xFF)
-+ comp_mask |= IB_COMP_MASK_PR_HOP_LIMIT;
-+
-+ if (path->tclass)
-+ comp_mask |= IB_COMP_MASK_PR_TCLASS;
-+ if (path->reversible_numpath & 0x80)
-+ comp_mask |= IB_COMP_MASK_PR_REVERSIBLE;
-+ if (path->pkey)
-+ comp_mask |= IB_COMP_MASK_PR_PKEY;
-+
-+ qos_sl = ntohs(path->qosclass_sl);
-+ if (qos_sl >> 4)
-+ comp_mask |= IB_COMP_MASK_PR_QOS_CLASS;
-+ if (qos_sl & 0xF)
-+ comp_mask |= IB_COMP_MASK_PR_SL;
-+
-+ if (path->mtu & 0xC0)
-+ comp_mask |= IB_COMP_MASK_PR_MTU_SELECTOR;
-+ if (path->mtu & 0x3F)
-+ comp_mask |= IB_COMP_MASK_PR_MTU;
-+ if (path->rate & 0xC0)
-+ comp_mask |= IB_COMP_MASK_PR_RATE_SELECTOR;
-+ if (path->rate & 0x3F)
-+ comp_mask |= IB_COMP_MASK_PR_RATE;
-+ if (path->packetlifetime & 0xC0)
-+ comp_mask |= IB_COMP_MASK_PR_PACKET_LIFETIME_SELECTOR;
-+ if (path->packetlifetime & 0x3F)
-+ comp_mask |= IB_COMP_MASK_PR_PACKET_LIFETIME;
-+
-+ return comp_mask;
-+}
-+
- /* Caller must hold dest lock */
- static uint8_t acm_resolve_path(struct acm_ep *ep, struct acm_dest *dest,
- void (*resp_handler)(struct acm_send_msg *req,
-@@ -1342,59 +1395,6 @@ static void acm_format_mgid(union ibv_gid *mgid, uint16_t pkey, uint8_t tos,
- mgid->raw[15] = 0;
- }
-
--static uint64_t acm_path_comp_mask(struct ibv_path_record *path)
--{
-- uint32_t fl_hop;
-- uint16_t qos_sl;
-- uint64_t comp_mask = 0;
--
-- acm_log(2, "\n");
-- if (path->service_id)
-- comp_mask |= IB_COMP_MASK_PR_SERVICE_ID;
-- if (!ib_any_gid(&path->dgid))
-- comp_mask |= IB_COMP_MASK_PR_DGID;
-- if (!ib_any_gid(&path->sgid))
-- comp_mask |= IB_COMP_MASK_PR_SGID;
-- if (path->dlid)
-- comp_mask |= IB_COMP_MASK_PR_DLID;
-- if (path->slid)
-- comp_mask |= IB_COMP_MASK_PR_SLID;
--
-- fl_hop = ntohl(path->flowlabel_hoplimit);
-- if (fl_hop >> 8)
-- comp_mask |= IB_COMP_MASK_PR_FLOW_LABEL;
-- if (fl_hop & 0xFF)
-- comp_mask |= IB_COMP_MASK_PR_HOP_LIMIT;
--
-- if (path->tclass)
-- comp_mask |= IB_COMP_MASK_PR_TCLASS;
-- if (path->reversible_numpath & 0x80)
-- comp_mask |= IB_COMP_MASK_PR_REVERSIBLE;
-- if (path->pkey)
-- comp_mask |= IB_COMP_MASK_PR_PKEY;
--
-- qos_sl = ntohs(path->qosclass_sl);
-- if (qos_sl >> 4)
-- comp_mask |= IB_COMP_MASK_PR_QOS_CLASS;
-- if (qos_sl & 0xF)
-- comp_mask |= IB_COMP_MASK_PR_SL;
--
-- if (path->mtu & 0xC0)
-- comp_mask |= IB_COMP_MASK_PR_MTU_SELECTOR;
-- if (path->mtu & 0x3F)
-- comp_mask |= IB_COMP_MASK_PR_MTU;
-- if (path->rate & 0xC0)
-- comp_mask |= IB_COMP_MASK_PR_RATE_SELECTOR;
-- if (path->rate & 0x3F)
-- comp_mask |= IB_COMP_MASK_PR_RATE;
-- if (path->packetlifetime & 0xC0)
-- comp_mask |= IB_COMP_MASK_PR_PACKET_LIFETIME_SELECTOR;
-- if (path->packetlifetime & 0x3F)
-- comp_mask |= IB_COMP_MASK_PR_PACKET_LIFETIME;
--
-- return comp_mask;
--}
--
- static void acm_init_join(struct ib_sa_mad *mad, union ibv_gid *port_gid,
- uint16_t pkey, uint8_t tos, uint8_t tclass, uint8_t sl, uint8_t rate, uint8_t mtu)
- {
-@@ -1750,7 +1750,7 @@ static int
- acm_is_path_from_port(struct acm_port *port, struct ibv_path_record *path)
- {
- if (ib_any_gid(&path->sgid)) {
-- return (port->lid == (ntohs(path.slid) & port->lid_mask));
-+ return (port->lid == (ntohs(path->slid) & port->lid_mask));
- }
- return (acm_gid_index(port, &path->sgid) < port->gid_cnt);
- }