]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
mad: deregister MR earlier in destroy path
authorshefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 12 May 2009 17:17:54 +0000 (17:17 +0000)
committershefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 12 May 2009 17:17:54 +0000 (17:17 +0000)
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@intel.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1@2170 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

trunk/core/al/kernel/al_mad_pool.c

index e4535d30121564dcb3486f3953ad3802b31e9139..252f72b8a8f018434063b5cef47299684a613daf 100644 (file)
@@ -460,6 +460,8 @@ __destroying_pool_key(
 \r
        /* Remove this pool_key from the AL instance. */\r
        al_remove_key( p_pool_key );\r
+       if( p_pool_key->h_mr )\r
+               ib_dereg_mr( p_pool_key->h_mr );\r
 \r
        p_pool_key->lkey = 0;\r
 }\r
@@ -483,9 +485,6 @@ __cleanup_pool_key(
 \r
        CL_ASSERT( !p_pool_key->mad_cnt );\r
 \r
-       if( p_pool_key->h_mr )\r
-               ib_dereg_mr( p_pool_key->h_mr );\r
-\r
        /* Search for any outstanding MADs associated with the given pool key. */\r
        if( p_pool_key->mad_cnt )\r
        {\r