Minimalistic update of the osmtest port chooser - this will work in the
same fashion as it was before osm_vendor_get_all_port_attr() update.

Signed-off-by: Sasha Khapyorsky <[EMAIL PROTECTED]>
---
 opensm/osmtest/main.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/opensm/osmtest/main.c b/opensm/osmtest/main.c
index 1c9004b..dade6da 100644
--- a/opensm/osmtest/main.c
+++ b/opensm/osmtest/main.c
@@ -263,15 +263,16 @@ ib_net64_t get_port_guid(IN osmtest_t * p_osmt, uint64_t 
port_guid)
                return (0);
        }
 
-       if (port_guid == 0 || num_ports == 1) {
+       if (num_ports == 1) {
                printf("using default guid 0x%" PRIx64 "\n",
                       cl_hton64(attr_array[0].port_guid));
                return (attr_array[0].port_guid);
        }
 
        for (i = 0; i < num_ports; i++) {
-               if (attr_array[i].port_guid == port_guid)
-                       return port_guid;
+               if (attr_array[i].port_guid == port_guid ||
+                   (!port_guid && attr_array[i].link_state > IB_LINK_DOWN))
+                       return attr_array[i].port_guid;
        }
 
        return 0;
-- 
1.5.3.rc2.29.gc4640f

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to