<!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 - Clear IsSM bit when shutting down</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:09 AM</FONT>
<BR><FONT SIZE=2>To: openib-general@openib.org</FONT>
<BR><FONT SIZE=2>Subject: [openib-general] [PATCH] OpenSM - Clear IsSM bit when shutting</FONT>
<BR><FONT SIZE=2>down</FONT>
</P>
<BR>
<P><FONT SIZE=2>Hi,</FONT>
</P>
<P><FONT SIZE=2>This patch is to clear the PortInfo:CapabilityMask:IsSM bit on shutdown.</FONT>
<BR><FONT SIZE=2>A SM that is brought up on a different node later on will do repeated</FONT>
<BR><FONT SIZE=2>SubnGet(SMInfo) that will just timeout.</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2>Index: opensm/osm_vendor_mlx.c</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>--- opensm/osm_vendor_mlx.c (revision 590)</FONT>
<BR><FONT SIZE=2>+++ opensm/osm_vendor_mlx.c (working copy)</FONT>
<BR><FONT SIZE=2>@@ -674,6 +674,43 @@</FONT>
<BR><FONT SIZE=2> }</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> /*</FONT>
<BR><FONT SIZE=2>+ * NAME __osm_vendor_clear_sm</FONT>
<BR><FONT SIZE=2>+ *</FONT>
<BR><FONT SIZE=2>+ * DESCRIPTION Modifies the port info for the bound port to clear</FONT>
<BR><FONT SIZE=2>the "IS_SM" bit.</FONT>
<BR><FONT SIZE=2>+ */</FONT>
<BR><FONT SIZE=2>+static void</FONT>
<BR><FONT SIZE=2>+__osm_vendor_clear_sm( IN osm_bind_handle_t h_bind )</FONT>
<BR><FONT SIZE=2>+{</FONT>
<BR><FONT SIZE=2>+ osmv_bind_obj_t *p_bo = ( osmv_bind_obj_t * ) h_bind;</FONT>
<BR><FONT SIZE=2>+ osm_vendor_t const *p_vend = p_bo->p_vendor;</FONT>
<BR><FONT SIZE=2>+ VAPI_ret_t status;</FONT>
<BR><FONT SIZE=2>+ VAPI_hca_attr_t attr_mod;</FONT>
<BR><FONT SIZE=2>+ VAPI_hca_attr_mask_t attr_mask;</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ OSM_LOG_ENTER( p_vend->p_log, osm_vendor_set_sm );</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ cl_memclr( &attr_mod, sizeof( attr_mod ) );</FONT>
<BR><FONT SIZE=2>+ cl_memclr( &attr_mask, sizeof( attr_mask ) );</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ attr_mod.is_sm = FALSE;</FONT>
<BR><FONT SIZE=2>+ attr_mask = HCA_ATTR_IS_SM;</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ status =</FONT>
<BR><FONT SIZE=2>+ VAPI_modify_hca_attr( p_bo->hca_hndl, p_bo->port_num, &attr_mod,</FONT>
<BR><FONT SIZE=2>+ &attr_mask );</FONT>
<BR><FONT SIZE=2>+ if ( status != VAPI_OK )</FONT>
<BR><FONT SIZE=2>+ {</FONT>
<BR><FONT SIZE=2>+ osm_log( p_vend->p_log, OSM_LOG_ERROR,</FONT>
<BR><FONT SIZE=2>+ "osm_vendor_set_sm: ERR 5012: "</FONT>
<BR><FONT SIZE=2>+ "Unable to clear 'IS_SM' bit in port attributes (%d).\n",</FONT>
<BR><FONT SIZE=2>+ status );</FONT>
<BR><FONT SIZE=2>+ }</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+ OSM_LOG_EXIT( p_vend->p_log );</FONT>
<BR><FONT SIZE=2>+}</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2>+/*</FONT>
<BR><FONT SIZE=2> * NAME __osm_vendor_internal_unbind</FONT>
<BR><FONT SIZE=2> *</FONT>
<BR><FONT SIZE=2> * DESCRIPTION Destroying a bind:</FONT>
<BR><FONT SIZE=2>@@ -689,6 +726,8 @@</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2> OSM_LOG_ENTER(p_log,__osm_vendor_internal_unbind);</FONT>
<BR><FONT SIZE=2> </FONT>
<BR><FONT SIZE=2>+ __osm_vendor_clear_sm(h_bind);</FONT>
<BR><FONT SIZE=2>+</FONT>
<BR><FONT SIZE=2> /* "notifying" all that from now on no new sends can be done */</FONT>
<BR><FONT SIZE=2> osmv_txn_lock(p_bo);</FONT>
<BR><FONT SIZE=2> p_bo->is_closing = TRUE;</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>