[ofw] [PATCH] ib/cm: update port attributes earlier in destructionpath

Leonid Keller leonid at mellanox.co.il
Tue May 12 06:40:25 PDT 2009


Please, commit. 

> -----Original Message-----
> From: ofw-bounces at lists.openfabrics.org 
> [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Sean Hefty
> Sent: Tuesday, May 12, 2009 2:28 AM
> To: ofw at lists.openfabrics.org; 'Fab Tillier'; Tzachi Dar
> Subject: [ofw] [PATCH] ib/cm: update port attributes earlier 
> in destructionpath
> 
> The CM tries to modify the port attributes during the cleanup 
> phase of port cep destruction.  However, if the stack is 
> being brought down, by the time ib_modify_hca is called, the 
> h_ca handle is invalid.
> 
> Signed-off-by: Sean Hefty <sean.hefty at intel.com>
> ---
> I can't think of any reason why modification of the port 
> attributes is deferred.
> 
> Index: al_cm_cep.c
> ===================================================================
> --- al_cm_cep.c	(revision 2139)
> +++ al_cm_cep.c	(working copy)
> @@ -2409,6 +2409,7 @@
>  {
>  	cep_agent_t			*p_port_cep;
>  	KLOCK_QUEUE_HANDLE	hdl;
> +	ib_port_attr_mod_t	port_attr_mod;
>  
>  	AL_ENTER( AL_DBG_CM );
>  
> @@ -2433,6 +2434,16 @@
>  		p_port_cep->h_pd = NULL;
>  	}
>  
> +	if( p_port_cep->h_ca )
> +	{
> +		/* Update local port attributes */
> +		port_attr_mod.cap.cm = FALSE;
> +		ib_modify_ca( p_port_cep->h_ca, p_port_cep->port_num,
> +			IB_CA_MOD_IS_CM_SUPPORTED, &port_attr_mod );
> +		deref_al_obj( &p_port_cep->h_ca->obj );
> +		p_port_cep->h_ca = NULL;
> +	}
> +
>  	AL_EXIT( AL_DBG_CM );
>  }
>  
> @@ -2447,22 +2458,10 @@
>  	IN				al_obj_t		
> 			*p_obj )
>  {
>  	cep_agent_t			*p_port_cep;
> -	ib_port_attr_mod_t	port_attr_mod;
>  
>  	AL_ENTER( AL_DBG_CM );
>  
>  	p_port_cep = PARENT_STRUCT( p_obj, cep_agent_t, obj );
> -
> -	if( p_port_cep->h_ca )
> -	{
> -		/* Update local port attributes */
> -		port_attr_mod.cap.cm = FALSE;
> -		ib_modify_ca( p_port_cep->h_ca, p_port_cep->port_num,
> -			IB_CA_MOD_IS_CM_SUPPORTED, &port_attr_mod );
> -
> -		deref_al_obj( &p_port_cep->h_ca->obj );
> -	}
> -
>  	destroy_al_obj( &p_port_cep->obj );
>  	cl_free( p_port_cep );
> 
> 
> _______________________________________________
> ofw mailing list
> ofw at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
> 



More information about the ofw mailing list