[openib-general] [PATCH] OpenSM - Clear IsSM bit when shuttin g down

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


Committed to OpenSM - gen1.
Thanks,
Yael

-----Original Message-----
From: Jan Daley [mailto:jdaley at systemfabricworks.com]
Sent: Saturday, August 07, 2004 12:09 AM
To: openib-general at openib.org
Subject: [openib-general] [PATCH] OpenSM - Clear IsSM bit when shutting
down


Hi,

This patch is to clear the PortInfo:CapabilityMask:IsSM bit on shutdown.
A SM that is brought up on a different node later on will do repeated
SubnGet(SMInfo) that will just timeout.



Index: opensm/osm_vendor_mlx.c
===================================================================
--- opensm/osm_vendor_mlx.c	(revision 590)
+++ opensm/osm_vendor_mlx.c	(working copy)
@@ -674,6 +674,43 @@
 }
 
 /*
+ *  NAME            __osm_vendor_clear_sm
+ *
+ *  DESCRIPTION     Modifies the port info for the bound port to clear
the "IS_SM" bit.
+ */
+static void
+__osm_vendor_clear_sm( IN osm_bind_handle_t h_bind )
+{
+  osmv_bind_obj_t *p_bo = ( osmv_bind_obj_t * ) h_bind;
+  osm_vendor_t const *p_vend = p_bo->p_vendor;
+  VAPI_ret_t status;
+  VAPI_hca_attr_t attr_mod;
+  VAPI_hca_attr_mask_t attr_mask;
+
+  OSM_LOG_ENTER( p_vend->p_log, osm_vendor_set_sm );
+
+  cl_memclr( &attr_mod, sizeof( attr_mod ) );
+  cl_memclr( &attr_mask, sizeof( attr_mask ) );
+
+  attr_mod.is_sm = FALSE;
+  attr_mask = HCA_ATTR_IS_SM;
+
+  status =
+    VAPI_modify_hca_attr( p_bo->hca_hndl, p_bo->port_num, &attr_mod,
+                          &attr_mask );
+  if ( status != VAPI_OK )
+  {
+    osm_log( p_vend->p_log, OSM_LOG_ERROR,
+             "osm_vendor_set_sm: ERR 5012: "
+             "Unable to clear 'IS_SM' bit in port attributes (%d).\n",
+             status );
+  }
+
+  OSM_LOG_EXIT( p_vend->p_log );
+}
+
+
+/*
  *  NAME            __osm_vendor_internal_unbind
  *
  *  DESCRIPTION     Destroying a bind:
@@ -689,6 +726,8 @@
 
   OSM_LOG_ENTER(p_log,__osm_vendor_internal_unbind);
 
+   __osm_vendor_clear_sm(h_bind);
+
   /* "notifying" all that from now on no new sends can be done */
   osmv_txn_lock(p_bo);
   p_bo->is_closing = TRUE;



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/90c3ed2f/attachment.html>


More information about the general mailing list