[openib-general] [PATCH]OpenSM/osm_lid_mgr.c: In __osm_lid_mgr_init_sweep, support enhanced switch port 0 for LMC > 0

Hal Rosenstock halr at voltaire.com
Tue Jun 27 12:22:54 PDT 2006


OpenSM/osm_lid_mgr.c: In __osm_lid_mgr_init_sweep, support enhanced
switch port 0 for LMC > 0

Base port 0 is constrained to have LMC of 0 whereas enhanced switch port
0 is not. Support enhanced switch port 0 is more like CA and router
ports in terms of this.

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

Index: opensm/osm_lid_mgr.c
===================================================================
--- opensm/osm_lid_mgr.c	(revision 8239)
+++ opensm/osm_lid_mgr.c	(working copy)
@@ -94,6 +94,7 @@
 #include <opensm/osm_lid_mgr.h>
 #include <opensm/osm_log.h>
 #include <opensm/osm_node.h>
+#include <opensm/osm_switch.h>
 #include <opensm/osm_helper.h>
 #include <opensm/osm_msgdef.h>
 #include <vendor/osm_vendor_api.h>
@@ -351,6 +352,8 @@ __osm_lid_mgr_init_sweep(
   osm_lid_mgr_range_t *p_range = NULL;
   osm_port_t          *p_port;
   cl_qmap_t           *p_port_guid_tbl;
+  osm_switch_t        *p_sw;
+  ib_switch_info_t    *p_si;
   uint8_t              lmc_num_lids = (uint8_t)(1 << p_mgr->p_subn->opt.lmc);
   uint16_t             lmc_mask;
   uint16_t             req_lid, num_lids;
@@ -436,7 +439,20 @@ __osm_lid_mgr_init_sweep(
            IB_NODE_TYPE_SWITCH )
         num_lids = lmc_num_lids;
       else
-        num_lids = 1;
+      {
+        /* Determine if enhanced switch port 0 */
+        p_sw = osm_get_switch_by_guid(p_mgr->p_subn,
+                                      osm_node_get_node_guid(osm_port_get_parent_node(p_port)));
+        if (p_sw && (p_si = osm_switch_get_si_ptr(p_sw)) &&
+            ib_switch_info_is_enhanced_port0(p_si))
+        {
+          num_lids = lmc_num_lids;
+        }
+        else
+        {
+          num_lids = 1;
+        }
+      }
 
       if ((num_lids != 1) &&
           (((db_min_lid & lmc_mask) != db_min_lid) ||







More information about the general mailing list