[IPoIB NDIS 6.0 CM]
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 17 Nov 2009 12:21:35 +0000 (12:21 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 17 Nov 2009 12:21:35 +0000 (12:21 +0000)
Fixing a problem when mcast_cb exits before flushing the pending list
Prints, comments fixing
Code clean-up. (mlnx 5076)

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

ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp
ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp
ulp/ipoib_NDIS6_CM/kernel/ipoib_endpoint.cpp
ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp

index 7ab212a..0242a8c 100644 (file)
@@ -985,7 +985,7 @@ __ipoib_adapter_reset(
        IPOIB_ENTER( IPOIB_DBG_INIT );\r
        IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("Got RESET\n") );\r
-//     return;\r
+\r
        p_adapter = (ipoib_adapter_t*)context;\r
        \r
        /* Synchronize with destruction */\r
index 671950e..b5c9dbc 100644 (file)
 \r
 #define MAJOR_DRIVER_VERSION 2\r
 #define MINOR_DRIVER_VERSION 1\r
-#if defined(NDIS60_MINIPORT)\r
+\r
 #define MAJOR_NDIS_VERSION 6\r
 #define MINOR_NDIS_VERSION 0\r
 \r
-#else\r
-#error NDIS Version not defined, try defining NDIS60_MINIPORT\r
-#endif\r
 \r
 PDRIVER_OBJECT                         g_p_drv_obj;\r
 \r
index 699593c..22c7cf6 100644 (file)
@@ -383,6 +383,7 @@ ipoib_endpt_queue(
                 * can receive packets, and NDIS can try to respond.  We need to delay\r
                 * a response until the MC callback runs and sets the AV.\r
                 */\r
+               IPOIB_PRINT( TRACE_LEVEL_WARNING, (IPOIB_DBG_MCAST | IPOIB_DBG_SEND),("Got the race between the mcast callback and a receive/send\n"));\r
                ipoib_endpt_deref( p_endpt );\r
                IPOIB_EXIT( IPOIB_DBG_ENDPT );\r
                return NDIS_STATUS_PENDING;\r
index 0675dd3..983f98e 100644 (file)
@@ -3814,7 +3814,7 @@ ipoib_process_sg_list_real(
                         !ETH_IS_BROADCAST( p_eth_hdr->dst.addr ) ) \r
                {\r
 \r
-                       IPOIB_PRINT_EXIT( TRACE_LEVEL_VERBOSE, IPOIB_DBG_MCAST,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_MCAST,\r
                                ("recived a Multicast NBL= %p\n", p_net_buffer_list) );\r
 \r
                        \r
@@ -3873,7 +3873,7 @@ mc_end:
                        cl_perf_start( QueuePacket );\r
 \r
                        cl_qlist_insert_tail( &p_port->send_mgr.pending_list, (cl_list_item_t*)s_buf );\r
-                       IPOIB_PRINT( TRACE_LEVEL_VERBOSE, IPOIB_DBG_SEND, ("Inserting %p NB first time to the pending list\n", p_netbuf));\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_SEND, ("Inserting %p NB first time to the pending list\n", p_netbuf));\r
                        \r
                        cl_perf_stop( &p_port->p_adapter->perf, QueuePacket );\r
                        ++g_ipoib_send_SG_pending;\r
@@ -3956,11 +3956,11 @@ ipoib_process_sg_list(
        cl_spinlock_acquire( &p_port->send_lock );\r
        ++g_ipoib_send_SG;\r
        if (g_ipoib_send_SG > 2) {\r
-               ASSERT(g_ipoib_send_SG-2 <= g_ipoib_send + g_ipoib_send_mcast+p_port->send_mgr.pending_list.count+ g_ipoib_send_SG_failed);\r
+               //ASSERT(g_ipoib_send_SG-2 <= g_ipoib_send + g_ipoib_send_mcast+p_port->send_mgr.pending_list.count+ g_ipoib_send_SG_failed);\r
        }\r
        ipoib_process_sg_list_real(pDO, pIrp, p_sgl, context);\r
        if (g_ipoib_send_SG > 1) {\r
-               ASSERT(g_ipoib_send_SG-1 <= g_ipoib_send + g_ipoib_send_mcast+p_port->send_mgr.pending_list.count + g_ipoib_send_SG_failed);\r
+               //ASSERT(g_ipoib_send_SG-1 <= g_ipoib_send + g_ipoib_send_mcast+p_port->send_mgr.pending_list.count + g_ipoib_send_SG_failed);\r
        }\r
        cl_spinlock_release( &p_port->send_lock );\r
 \r
@@ -5470,10 +5470,14 @@ __send_complete_net_buffer(
        \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
+#if 0\r
        if (NET_BUFFER_LIST_STATUS(s_buf->p_nbl) != NDIS_STATUS_FAILURE) {\r
                //TODO what about other statuses ?????\r
                NET_BUFFER_LIST_STATUS(s_buf->p_nbl) = status;\r
        }\r
+#endif\r
+\r
+       NET_BUFFER_LIST_STATUS(s_buf->p_nbl) = status;\r
 \r
 \r
                \r
@@ -7620,8 +7624,12 @@ __mcast_cb(
                        p_port->p_adapter->p_ifc->leave_mcast( p_mcast_rec->h_mcast, __leave_error_mcast_cb );\r
                }\r
                ipoib_port_deref( p_port, ref_mcast_inv_state );\r
-               IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, (IPOIB_DBG_MCAST | IPOIB_DBG_INIT),\r
                        ("Invalid state - Aborting.\n") );\r
+\r
+               cl_spinlock_acquire(&p_port->send_lock);\r
+               ipoib_port_resume(p_port , FALSE);\r
+               cl_spinlock_release(&p_port->send_lock);\r
                return;\r
        }\r
 \r