<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>RE: [openib-general] [PATCH] OpenSM Assigning Duplicate LIDs</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Committed to OpenSM - gen1.</FONT>
<BR><FONT SIZE=2>Thanks,</FONT>
<BR><FONT SIZE=2>Yael</FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Jan Daley [<A HREF="mailto:jdaley@systemfabricworks.com">mailto:jdaley@systemfabricworks.com</A>]</FONT>
<BR><FONT SIZE=2>Sent: Saturday, August 07, 2004 12:08 AM</FONT>
<BR><FONT SIZE=2>To: openib-general@openib.org</FONT>
<BR><FONT SIZE=2>Subject: [openib-general] [PATCH] OpenSM Assigning Duplicate LIDs</FONT>
</P>
<BR>
<P><FONT SIZE=2>Hi,</FONT>
</P>
<P><FONT SIZE=2>I ran across a scenario in which the SM would assign the same lid to</FONT>
<BR><FONT SIZE=2>multiple nodes. The problem occurs when two nodes that have the same</FONT>
<BR><FONT SIZE=2>lid are placed into a subnet that doesn't have an SM running. When</FONT>
<BR><FONT SIZE=2>OpenSM is started, it preserves the existing lids without checking for</FONT>
<BR><FONT SIZE=2>duplicates.</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>Index: opensm/osm_lid_mgr.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- opensm/osm_lid_mgr.c (revision 590)</FONT>
<BR><FONT SIZE=2>+++ opensm/osm_lid_mgr.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -878,6 +878,7 @@</FONT>
<BR><FONT SIZE=2> osm_lid_mgr_t* const p_mgr = (osm_lid_mgr_t*)context;</FONT>
<BR><FONT SIZE=2> osm_physp_t* p_physp;</FONT>
<BR><FONT SIZE=2> cl_ptr_vector_t* p_tbl;</FONT>
<BR><FONT SIZE=2>+ osm_port_t* temp_port;</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> OSM_LOG_ENTER( p_mgr->p_log, __osm_lid_mgr_process_foreign );</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>@@ -912,19 +913,33 @@</FONT>
<BR><FONT SIZE=2> min_lid_ho, max_lid_ho );</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>- /*</FONT>
<BR><FONT SIZE=2>- Place this port into the port ptr vector.</FONT>
<BR><FONT SIZE=2>- And update the PortInfo attribute template.</FONT>
<BR><FONT SIZE=2>- */</FONT>
<BR><FONT SIZE=2>- for( lid_ho = min_lid_ho; lid_ho <= max_lid_ho; lid_ho++ )</FONT>
<BR><FONT SIZE=2>- cl_ptr_vector_set( p_tbl, lid_ho, p_port );</FONT>
<BR><FONT SIZE=2>+ if (CL_SUCCESS == cl_ptr_vector_at(p_tbl, min_lid_ho,</FONT>
<BR><FONT SIZE=2>(void*)&temp_port)</FONT>
<BR><FONT SIZE=2>+ && NULL != temp_port)</FONT>
<BR><FONT SIZE=2>+ {</FONT>
<BR><FONT SIZE=2>+ /*</FONT>
<BR><FONT SIZE=2>+ If something is already there, we need to find a new</FONT>
<BR><FONT SIZE=2>+ lid range for this port. Process it like it is unassigned.</FONT>
<BR><FONT SIZE=2>+ */</FONT>
<BR><FONT SIZE=2>+ __osm_lid_mgr_process_unassigned(p_object, context);</FONT>
<BR><FONT SIZE=2>+ }</FONT>
<BR><FONT SIZE=2>+ else</FONT>
<BR><FONT SIZE=2>+ {</FONT>
<BR><FONT SIZE=2>+ /*</FONT>
<BR><FONT SIZE=2>+ Place this port into the port ptr vector.</FONT>
<BR><FONT SIZE=2>+ And update the PortInfo attribute template.</FONT>
<BR><FONT SIZE=2>+ */</FONT>
<BR><FONT SIZE=2>+ for( lid_ho = min_lid_ho; lid_ho <= max_lid_ho; lid_ho++ )</FONT>
<BR><FONT SIZE=2>+ {</FONT>
<BR><FONT SIZE=2>+ cl_ptr_vector_set( p_tbl, lid_ho, p_port );</FONT>
<BR><FONT SIZE=2>+ }</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>- /*</FONT>
<BR><FONT SIZE=2>- Set the PortInfo for the Physical Port associated</FONT>
<BR><FONT SIZE=2>- with this Port.</FONT>
<BR><FONT SIZE=2>- */</FONT>
<BR><FONT SIZE=2>- p_physp = osm_port_get_default_phys_ptr( p_port );</FONT>
<BR><FONT SIZE=2>- __osm_lid_mgr_set_physp_pi( p_mgr, p_physp, cl_hton16( min_lid_ho )</FONT>
<BR><FONT SIZE=2>);</FONT>
<BR><FONT SIZE=2>+ /*</FONT>
<BR><FONT SIZE=2>+ Set the PortInfo for the Physical Port associated</FONT>
<BR><FONT SIZE=2>+ with this Port.</FONT>
<BR><FONT SIZE=2>+ */</FONT>
<BR><FONT SIZE=2>+ p_physp = osm_port_get_default_phys_ptr( p_port );</FONT>
<BR><FONT SIZE=2>+ __osm_lid_mgr_set_physp_pi( p_mgr, p_physp, cl_hton16( min_lid_ho )</FONT>
<BR><FONT SIZE=2>);</FONT>
<BR><FONT SIZE=2>+ }</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> OSM_LOG_EXIT( p_mgr->p_log );</FONT>
<BR><FONT SIZE=2> }</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>Jan Daley</FONT>
<BR><FONT SIZE=2>System Fabric Works</FONT>
<BR><FONT SIZE=2>(512) 343-6101 x 13</FONT>
</P>
<BR>
<BR>
<BR>
<P><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>openib-general mailing list</FONT>
<BR><FONT SIZE=2>openib-general@openib.org</FONT>
<BR><FONT SIZE=2><A HREF="http://openib.org/mailman/listinfo/openib-general" TARGET="_blank">http://openib.org/mailman/listinfo/openib-general</A></FONT>
</P>
<P><FONT SIZE=2>To unsubscribe, please visit <A HREF="http://openib.org/mailman/listinfo/openib-general" TARGET="_blank">http://openib.org/mailman/listinfo/openib-general</A></FONT>
</P>
</BODY>
</HTML>