[IBAL] Fix locking around MAD tracking list.
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 24 Jul 2006 19:18:19 +0000 (19:18 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 24 Jul 2006 19:18:19 +0000 (19:18 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@426 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/al/al_mad_pool.h
core/al/kernel/al_dev.c
core/al/kernel/al_mad_pool.c
core/al/kernel/al_proxy_subnet.c

index ce2b75a..6954480 100644 (file)
@@ -278,11 +278,4 @@ put_mad_rmpp(
        IN                              al_mad_rmpp_t                           *p_rmpp );\r
 \r
 \r
-#ifdef CL_KERNEL\r
-void\r
-proxy_put_mad(\r
-       IN              const   ib_mad_element_t*                       p_mad_element );\r
-#endif\r
-\r
-\r
 #endif // __AL_MAD_POOL_H__\r
index cedf274..1969830 100644 (file)
@@ -281,7 +281,7 @@ __proxy_cleanup_map(
                {\r
                /* Return any MADs not reported to the user. */\r
                case AL_OBJ_TYPE_H_MAD:\r
-                       proxy_put_mad( (ib_mad_element_t*)p_h->p_obj );\r
+                       ib_put_mad( (ib_mad_element_t*)p_h->p_obj );\r
                        al_hdl_free( p_context->h_al, i );\r
                        break;\r
 \r
index 57d38b2..036cfa5 100644 (file)
@@ -490,7 +490,7 @@ __cleanup_pool_key(
        {\r
                p_mad_element_list = p_last_mad_element = NULL;\r
 \r
-               cl_spinlock_acquire( &p_pool_key->obj.h_al->obj.lock );\r
+               cl_spinlock_acquire( &p_pool_key->obj.h_al->mad_lock );\r
                for( p_list_item = cl_qlist_head( &p_pool_key->obj.h_al->mad_list );\r
                         p_list_item != cl_qlist_end( &p_pool_key->obj.h_al->mad_list );\r
                         p_list_item = p_next_item )\r
@@ -509,7 +509,7 @@ __cleanup_pool_key(
                        p_last_mad_element = &p_mad->element;\r
                        p_last_mad_element->p_next = NULL;\r
                }\r
-               cl_spinlock_release( &p_pool_key->obj.h_al->obj.lock );\r
+               cl_spinlock_release( &p_pool_key->obj.h_al->mad_lock );\r
 \r
                /* Return any outstanding MADs to the pool. */\r
                if( p_mad_element_list )\r
@@ -914,37 +914,6 @@ ib_put_mad(
 }\r
 \r
 \r
-void\r
-proxy_put_mad(\r
-       IN              const   ib_mad_element_t*                       p_mad_element )\r
-{\r
-       al_mad_element_t*               p_mad;\r
-\r
-       CL_ASSERT( p_mad_element );\r
-       CL_ASSERT( !p_mad_element->p_next );\r
-\r
-       p_mad = PARENT_STRUCT( p_mad_element, al_mad_element_t, element );\r
-\r
-       /* Deallocate any buffers allocated for the user. */\r
-       if( p_mad->p_al_mad_buf )\r
-       {\r
-               cl_free( p_mad->p_al_mad_buf );\r
-               p_mad->p_al_mad_buf = NULL;\r
-       }\r
-\r
-       /* See if the MAD has already been returned to the MAD pool. */\r
-       CL_ASSERT( p_mad->h_al );\r
-\r
-       /* Remove the MAD element from the owning AL instance. */\r
-       cl_qlist_remove_item( &p_mad->h_al->mad_list, &p_mad->al_item );\r
-       deref_al_obj( &p_mad->h_al->obj );\r
-       p_mad->h_al = NULL;\r
-\r
-       /* Return the MAD element to the pool. */\r
-       __put_mad_element( p_mad );\r
-}\r
-\r
-\r
 \r
 /*\r
  * Resize the data buffer associated with a MAD element.\r
index e220d4a..cad5897 100644 (file)
@@ -704,7 +704,7 @@ __proxy_mad_recv_cb(
         */\r
        if( !proxy_context_ref( p_context ) )\r
        {\r
-               proxy_put_mad( p_mad_element );\r
+               ib_put_mad( p_mad_element );\r
                AL_EXIT( AL_DBG_MAD );\r
                return;\r
        }\r
@@ -723,7 +723,7 @@ __proxy_mad_recv_cb(
        {\r
                al_hdl_free( p_context->h_al, hdl );\r
 proxy_mad_recv_cb_err:\r
-               proxy_put_mad( p_mad_element );\r
+               ib_put_mad( p_mad_element );\r
        }\r
        cl_spinlock_release( &p_context->h_al->obj.lock );\r
 \r