[openib-general] [PATCH] OpenSM Assigning Duplicate LIDs

Yael Kalka yael at mellanox.co.il
Mon Aug 9 05:34:07 PDT 2004


Committed to OpenSM - gen1.
Thanks,
Yael

-----Original Message-----
From: Jan Daley [mailto:jdaley at systemfabricworks.com]
Sent: Saturday, August 07, 2004 12:08 AM
To: openib-general at openib.org
Subject: [openib-general] [PATCH] OpenSM Assigning Duplicate LIDs


Hi,

I ran across a scenario in which the SM would assign the same lid to
multiple nodes.  The problem occurs when two nodes that have the same
lid are placed into a subnet that doesn't have an SM running.  When
OpenSM is started, it preserves the existing lids without checking for
duplicates.



Index: opensm/osm_lid_mgr.c
===================================================================
--- opensm/osm_lid_mgr.c	(revision 590)
+++ opensm/osm_lid_mgr.c	(working copy)
@@ -878,6 +878,7 @@
   osm_lid_mgr_t*           const p_mgr = (osm_lid_mgr_t*)context;
   osm_physp_t*          p_physp;
   cl_ptr_vector_t*         p_tbl;
+  osm_port_t*           temp_port;
 
   OSM_LOG_ENTER( p_mgr->p_log, __osm_lid_mgr_process_foreign );
 
@@ -912,19 +913,33 @@
              min_lid_ho, max_lid_ho );
   }
 
-  /*
-    Place this port into the port ptr vector.
-    And update the PortInfo attribute template.
-  */
-  for( lid_ho = min_lid_ho; lid_ho <= max_lid_ho; lid_ho++ )
-    cl_ptr_vector_set( p_tbl, lid_ho, p_port );
+  if (CL_SUCCESS == cl_ptr_vector_at(p_tbl, min_lid_ho,
(void*)&temp_port)
+      && NULL != temp_port)
+  {
+    /*
+      If something is already there, we need to find a new
+      lid range for this port.  Process it like it is unassigned.
+    */
+    __osm_lid_mgr_process_unassigned(p_object, context);
+  }
+  else
+  {
+    /*
+      Place this port into the port ptr vector.
+      And update the PortInfo attribute template.
+    */
+    for( lid_ho = min_lid_ho; lid_ho <= max_lid_ho; lid_ho++ )
+    {
+      cl_ptr_vector_set( p_tbl, lid_ho, p_port );
+    }
 
-  /*
-    Set the PortInfo for the Physical Port associated
-    with this Port.
-  */
-  p_physp = osm_port_get_default_phys_ptr( p_port );
-  __osm_lid_mgr_set_physp_pi( p_mgr, p_physp, cl_hton16( min_lid_ho )
);
+    /*
+      Set the PortInfo for the Physical Port associated
+      with this Port.
+    */
+    p_physp = osm_port_get_default_phys_ptr( p_port );
+    __osm_lid_mgr_set_physp_pi( p_mgr, p_physp, cl_hton16( min_lid_ho )
);
+  }
 
   OSM_LOG_EXIT( p_mgr->p_log );
 }



Jan Daley
System Fabric Works
(512) 343-6101 x 13




_______________________________________________
openib-general mailing list
openib-general at openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit
http://openib.org/mailman/listinfo/openib-general
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20040809/c77ae3a8/attachment.html>


More information about the general mailing list