[IPoIB NDIS 6.0 CM]
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 17 Nov 2009 12:29:21 +0000 (12:29 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 17 Nov 2009 12:29:21 +0000 (12:29 +0000)
Bugfix: free NBL only after freeing SG (mlnx 5120)

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2570 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp

index 5afe93d..f17e236 100644 (file)
@@ -5448,7 +5448,12 @@ __send_complete_net_buffer(
                ("Processing send completion for NBL=0x%p .\n",  s_buf->p_nbl ));\r
        \r
        \r
-       \r
+       // Free SGL element allocated by NDIS\r
+       // We should do it before freeing the whole NBL\r
+       NdisMFreeNetBufferSGList(\r
+                                                       s_buf->p_port->p_adapter->NdisMiniportDmaHandle,\r
+                                                       s_buf->p_sgl,\r
+                                                       s_buf->p_curr_nb);\r
        \r
        // No need to delete p_sg_buf at this state, we will destroy the whole list at the end of the execution\r
        //NET_BUFFER_LIST_NEXT_NBL(p_desc->p_netbuf_list) = NULL;\r
@@ -5516,25 +5521,19 @@ __send_complete_net_buffer(
                }\r
        } \r
 \r
-       \r
-       //Free SGL element allocated by NDIS\r
-               NdisMFreeNetBufferSGList(\r
-                                                               s_buf->p_port->p_adapter->NdisMiniportDmaHandle,\r
-                                                               s_buf->p_sgl,\r
-                                                               s_buf->p_curr_nb);\r
                                                                \r
-               if( s_buf->p_send_buf )\r
-               {\r
-                       cl_perf_start( FreeSendBuf );\r
-                       NdisFreeToNPagedLookasideList( &s_buf->p_port->buf_mgr.send_buf_list,\r
-                               s_buf->p_send_buf );\r
-                       cl_perf_stop( &p_port->p_adapter->perf, FreeSendBuf );\r
-               }       \r
-               \r
-               /* Dereference the enpoint used for the transfer. */\r
-               if( s_buf->p_endpt ) {\r
-                       ipoib_endpt_deref( s_buf->p_endpt );\r
-               }\r
+       if( s_buf->p_send_buf )\r
+       {\r
+               cl_perf_start( FreeSendBuf );\r
+               NdisFreeToNPagedLookasideList( &s_buf->p_port->buf_mgr.send_buf_list,\r
+                       s_buf->p_send_buf );\r
+               cl_perf_stop( &p_port->p_adapter->perf, FreeSendBuf );\r
+       }       \r
+       \r
+       /* Dereference the enpoint used for the transfer. */\r
+       if( s_buf->p_endpt ) {\r
+               ipoib_endpt_deref( s_buf->p_endpt );\r
+       }\r
 #if 0  \r
        if (status == NDIS_STATUS_SUCCESS) {\r
                //++g_ipoib_send_SG_real;\r