--- /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);
+ }