]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
Set SM LID address in network byte order
authorSean Hefty <sean.hefty@intel.com>
Thu, 10 Feb 2011 20:06:46 +0000 (12:06 -0800)
committerSean Hefty <sean.hefty@intel.com>
Sat, 5 Mar 2011 00:53:13 +0000 (16:53 -0800)
acm_set_dest_addr expects LIDs to be in network order.
Convert the sm_lid retrieved from the port attributes into
network order.  This formats the LID value correctly
when entered into the ibacm log.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
src/acm.c

index 10680f8f271549b9ee365a2085843879d06fd657..d52e83a1c152dcee872887ee8913f0cfb00509df 100644 (file)
--- a/src/acm.c
+++ b/src/acm.c
@@ -2637,13 +2637,14 @@ static void acm_port_up(struct acm_port *port)
        port->lid = attr.lid;
        port->lid_mask = 0xffff - ((1 << attr.lmc) - 1);
 
-       acm_set_dest_addr(&port->sa_dest, ACM_ADDRESS_LID,
-               (uint8_t *) &attr.sm_lid, sizeof(attr.sm_lid));
        port->sa_dest.av.src_path_bits = 0;
        port->sa_dest.av.dlid = attr.sm_lid;
        port->sa_dest.av.sl = attr.sm_sl;
        port->sa_dest.av.port_num = port->port_num;
        port->sa_dest.remote_qpn = 1;
+       attr.sm_lid = htons(attr.sm_lid);
+       acm_set_dest_addr(&port->sa_dest, ACM_ADDRESS_LID,
+               (uint8_t *) &attr.sm_lid, sizeof(attr.sm_lid));
 
        port->sa_dest.ah = ibv_create_ah(port->dev->pd, &port->sa_dest.av);
        if (!port->sa_dest.ah)