[openib-general] [PATCH] OpenSM - Clear IsSM bit when shutting down
Michael S. Tsirkin
mst at mellanox.co.il
Sun Aug 8 11:21:12 PDT 2004
But, userspace clearly can not guarantee an operation on shutdown
(e.g. the app can be killed with -9).
Does not this mean we need a kernel component help, to make cleaning
IsSM in a robust fashion?
MST
Quoting r. Jan Daley (jdaley at systemfabricworks.com) "[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
More information about the general
mailing list