[IPoIB NDIS 6.0 CM]
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 17 Nov 2009 12:19:23 +0000 (12:19 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 17 Nov 2009 12:19:23 +0000 (12:19 +0000)
Avoiding endless loop inside the pending-list-flushing loop. (mlnx 5022)

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

ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp

index b44d156..0675dd3 100644 (file)
@@ -5567,36 +5567,35 @@ ipoib_port_resume(
        p_item =  cl_qlist_remove_head( &p_port->send_mgr.pending_list );\r
        while (p_item != cl_qlist_end(&p_port->send_mgr.pending_list))\r
        {\r
-                               \r
-               /* Check the send queue and pend the request if not empty. */\r
-               if( p_port->send_mgr.depth == p_port->p_adapter->params.sq_depth )\r
-               {\r
-                   \r
-                       IPOIB_PRINT( TRACE_LEVEL_WARNING, IPOIB_DBG_SEND,\r
-                               ("No available WQEs.\n") );\r
-                       cl_qlist_insert_head( &p_port->send_mgr.pending_list, p_item  );\r
-                       break;\r
-               }\r
 \r
                s_buf = (ipoib_send_NB_SG*) (PVOID) p_item; // TODO: Check this casting\r
 \r
                if (!b_good_port_state) {\r
+                       // Port is in error state, flush the list\r
                        ipoib_inc_send_stat( p_port->p_adapter, IP_STAT_DROPPED, 0 );\r
                        __send_complete_net_buffer(\r
                                s_buf, NDIS_STATUS_FAILURE, NDIS_SEND_COMPLETE_FLAGS_DISPATCH_LEVEL, FALSE);\r
-       \r
-                       continue;\r
-               }\r
+               } else {\r
+\r
+                       /* Check the send queue and pend the request if not empty. */\r
+                       if( p_port->send_mgr.depth == p_port->p_adapter->params.sq_depth )\r
+                       {\r
+                           \r
+                               IPOIB_PRINT( TRACE_LEVEL_WARNING, IPOIB_DBG_SEND,\r
+                                       ("No available WQEs.\n") );\r
+                               cl_qlist_insert_head( &p_port->send_mgr.pending_list, p_item  );\r
+                               break;\r
+                       }\r
                        \r
-               bool continue_sending = ipoib_process_sg_list_real(NULL, NULL, (PSCATTER_GATHER_LIST) s_buf->p_sgl, s_buf);\r
+                       bool continue_sending = ipoib_process_sg_list_real(NULL, NULL, (PSCATTER_GATHER_LIST) s_buf->p_sgl, s_buf);\r
 \r
-               //cl_qlist_check_validity(&p_port->send_mgr.pending_list);\r
+                       //cl_qlist_check_validity(&p_port->send_mgr.pending_list);\r
 \r
-               if (!continue_sending) {\r
-                       ASSERT (cl_is_item_in_qlist(&p_port->send_mgr.pending_list, (cl_list_item_t*)(PVOID)s_buf));\r
-                       goto Cleanup;\r
+                       if (!continue_sending) {\r
+                               ASSERT (cl_is_item_in_qlist(&p_port->send_mgr.pending_list, (cl_list_item_t*)(PVOID)s_buf));\r
+                               goto Cleanup;\r
+                       }\r
                }\r
-\r
                                \r
                p_item =  cl_qlist_remove_head( &p_port->send_mgr.pending_list );\r
        }\r