[openib-general] [PATCH] Opensm - fix osm_venodr_get_all_port_attr

Yael Kalka yael at mellanox.co.il
Thu Dec 8 02:39:30 PST 2005


Hi Hal,

If osm_vendor_get_all_port_attr is called before the osm_vendor_bind,
then the sm_lid of the default port isn't updated correctly.
This patch fixes it.

Thanks,
Yael

Signed-off-by:  Yael Kalka <yael at mellanox.co.il>

Index: libvendor/osm_vendor_ibumad.c
===================================================================
--- libvendor/osm_vendor_ibumad.c       (revision 4345)
+++ libvendor/osm_vendor_ibumad.c       (working copy)
@@ -577,6 +577,7 @@ osm_vendor_get_all_port_attr(
        int *p_linkstates = linkstates;
        umad_port_t def_port = {""};
        int r, i, j;
+   int sm_lid = 0;
 
        OSM_LOG_ENTER( p_vend->p_log, osm_vendor_get_all_port_attr );
 
@@ -636,6 +637,8 @@ osm_vendor_get_all_port_attr(
                        def_port.ca_name, def_port.portnum,
                        cl_hton64(def_port.port_guid));
 
+      sm_lid = def_port.sm_lid;
+
                umad_release_port(&def_port);
        }
 
@@ -644,6 +647,9 @@ osm_vendor_get_all_port_attr(
                for (i = 0; i < *p_num_ports; i++) {
                        p_attr_array[i].port_guid = portguids[i];
                        p_attr_array[i].lid = lids[i];
+         if (i == 0)
+           p_attr_array[i].sm_lid = sm_lid;
+         else
                        p_attr_array[i].sm_lid = p_vend->umad_port.sm_lid;
                        p_attr_array[i].link_state = linkstates[i];
                }




More information about the general mailing list