[ofw] RE: [PATCH] mad: deregister MR earlier in destroy path

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


Please, commit. 

> -----Original Message-----
> From: Sean Hefty [mailto:sean.hefty at intel.com] 
> Sent: Tuesday, May 12, 2009 2:35 AM
> To: ofw at lists.openfabrics.org; Leonid Keller; Tzachi Dar
> Subject: [PATCH] mad: deregister MR earlier in destroy path
> 
> When restarting the stack, the MAD pool tries to deregister 
> its memory during the cleanup phase.  This results in an 
> error because of an invalid h_mr handle.  Fix the error by 
> deregistering the memory during the destroying callback.
> 
> Signed-off-by: Sean Hefty <sean.hefty at intel.com>
> ---
> This moves the memory deregistration call from the cleanup 
> thread to whatever thread is calling destroy.  I didn't see 
> any issues with this during my testing.
> 
> Index: al_mad_pool.c
> ===================================================================
> --- al_mad_pool.c	(revision 2100)
> +++ al_mad_pool.c	(working copy)
> @@ -460,6 +460,8 @@
>  
>  	/* Remove this pool_key from the AL instance. */
>  	al_remove_key( p_pool_key );
> +	if( p_pool_key->h_mr )
> +		ib_dereg_mr( p_pool_key->h_mr );
>  
>  	p_pool_key->lkey = 0;
>  }
> @@ -483,9 +485,6 @@
>  
>  	CL_ASSERT( !p_pool_key->mad_cnt );
>  
> -	if( p_pool_key->h_mr )
> -		ib_dereg_mr( p_pool_key->h_mr );
> -
>  	/* Search for any outstanding MADs associated with the 
> given pool key. */
>  	if( p_pool_key->mad_cnt )
>  	{
> 
> 



More information about the ofw mailing list