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

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2566 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 0242a8c..d975c36 100644 (file)
@@ -899,6 +899,7 @@ ipoib_refresh_mcast(
                                  !( p_mac_array[i].addr[0] == 1 && p_mac_array[i].addr[1] == 0 && p_mac_array[i].addr[2] == 0x5e )\r
                                )\r
                        {\r
+                               \r
                                ipoib_port_join_mcast( p_port, p_mac_array[i], IB_MC_REC_STATE_FULL_MEMBER );\r
                        }\r
                }\r
@@ -1154,6 +1155,7 @@ ipoib_set_active(
                /* Join all programmed multicast groups. */\r
                for( i = 0; i < p_adapter->mcast_array_size; i++ )\r
                {\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_MCAST,("Calling join mcast from ipoib_set_active\n"));\r
                        ipoib_port_join_mcast(\r
                                p_adapter->p_port, p_adapter->mcast_array[i] ,IB_MC_REC_STATE_FULL_MEMBER);\r
                }\r
index b5c9dbc..8612118 100644 (file)
@@ -334,6 +334,7 @@ ULONG                       g_ipoib_send_SW_in_loop = 0;
 ULONG                  g_ipoib_send_SG_pending = 0;\r
 ULONG                  g_ipoib_send_SG_real = 0;\r
 ULONG                  g_ipoib_send_SG_failed = 0;\r
+ULONG                  g_ipoib_send_reset = 0;\r
 \r
 \r
 typedef struct _IPOIB_REG_ENTRY\r
index 22c7cf6..fb8be8b 100644 (file)
@@ -383,7 +383,8 @@ 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_PRINT( TRACE_LEVEL_WARNING, IPOIB_DBG_MCAST ,("Got the race between the mcast callback and a receive/send\n"));\r
+               IPOIB_PRINT( TRACE_LEVEL_WARNING, 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 983f98e..b10f772 100644 (file)
@@ -52,6 +52,8 @@ extern ULONG g_ipoib_send_SW_in_loop;
 extern ULONG g_ipoib_send_SG_pending;\r
 extern ULONG g_ipoib_send_SG_real;\r
 extern ULONG g_ipoib_send_SG_failed;\r
+extern ULONG g_ipoib_send_reset;\r
+\r
 \r
 \r
 \r
@@ -3264,8 +3266,6 @@ __pending_list_destroy(
                ASSERT(s_buf->p_nbl);\r
                IPOIB_DEC_NET_BUFFER_LIST_REF_COUNT(s_buf->p_nbl);\r
                \r
-               //Increase the send counter\r
-               ++g_ipoib_send;\r
                \r
                __send_complete_net_buffer(s_buf, NDIS_STATUS_RESET_IN_PROGRESS,send_complete_flags,TRUE);\r
 \r
@@ -3755,7 +3755,6 @@ ipoib_process_sg_list_real(
                \r
                cl_perf_stop( &p_port->p_adapter->perf, ProcessFailedSends );\r
                ret = true;\r
-               ++g_ipoib_send_SG_failed;\r
                goto send_end;\r
        }\r
        from_queue = (boolean_t)(s_buf->p_sgl != NULL);\r
@@ -3779,7 +3778,7 @@ ipoib_process_sg_list_real(
 \r
                        if( ETH_IS_MULTICAST( p_eth_hdr->dst.addr ) )\r
                        {\r
-                               IPOIB_PRINT( TRACE_LEVEL_VERBOSE, IPOIB_DBG_MCAST, ("recived a mc packet (from the queue) %p\n", p_net_buffer_list));\r
+                               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_MCAST, ("recived a mc packet (from the queue) %p\n", p_net_buffer_list));\r
                                if( ipoib_port_join_mcast( p_port, p_eth_hdr->dst,\r
                                        IB_MC_REC_STATE_FULL_MEMBER) == IB_SUCCESS )\r
                                {\r
@@ -3891,7 +3890,6 @@ mc_end:
                        cl_perf_start( ProcessFailedSends );\r
                        __send_complete_net_buffer(s_buf, NDIS_STATUS_SUCCESS, complete_flags, TRUE);\r
                        cl_perf_stop( &p_port->p_adapter->perf, ProcessFailedSends );\r
-                       //++g_ipoib_send_SG_failed;\r
                        ret = true;\r
                        goto send_end;\r
                }\r
@@ -3927,9 +3925,10 @@ mc_end:
                cl_perf_stop( &p_port->p_adapter->perf, ProcessFailedSends );\r
                /* Flag the adapter as hung since posting is busted. */\r
                p_port->p_adapter->hung = TRUE;\r
+       } else {\r
+               ++g_ipoib_send;\r
+               cl_atomic_inc( &p_port->send_mgr.depth );\r
        }\r
-       ++g_ipoib_send;\r
-       cl_atomic_inc( &p_port->send_mgr.depth );\r
 \r
 send_end:              \r
                        \r
@@ -4833,6 +4832,7 @@ __send_mgr_queue(
        if( status == NDIS_STATUS_NO_ROUTE_TO_DESTINATION &&\r
                ETH_IS_MULTICAST( p_eth_hdr->dst.addr ) )\r
        {\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_MCAST,("Calling join mcast from send_mgr_queue\n"));\r
                if( ipoib_port_join_mcast( p_port, p_eth_hdr->dst, \r
                        IB_MC_REC_STATE_FULL_MEMBER) == IB_SUCCESS )\r
                {\r
@@ -5479,7 +5479,24 @@ __send_complete_net_buffer(
 \r
        NET_BUFFER_LIST_STATUS(s_buf->p_nbl) = status;\r
 \r
-\r
+       switch (status) {\r
+               case NDIS_STATUS_SUCCESS:\r
+                       ++g_ipoib_send_ack;\r
+                       break;\r
+               case NDIS_STATUS_RESET_IN_PROGRESS:\r
+                       ++g_ipoib_send_reset;\r
+                       break;\r
+               case NDIS_STATUS_FAILURE:\r
+                       ++g_ipoib_send_SG_failed;\r
+                       break;\r
+               case NDIS_STATUS_INVALID_LENGTH:\r
+               case NDIS_STATUS_PAUSED:\r
+               case NDIS_STATUS_SEND_ABORTED:\r
+               case NDIS_STATUS_RESOURCES:\r
+               default:\r
+                       ASSERT(FALSE);\r
+               \r
+       }\r
                \r
        IPOIB_DEC_NET_BUFFER_LIST_REF_COUNT(s_buf->p_nbl);\r
        /* Complete the NBL */\r
@@ -5673,8 +5690,6 @@ __send_cb(
                                ("Successfull send completion for NBL=0x%p .\n",  s_buf->p_nbl ));\r
                        CL_ASSERT( s_buf );\r
 \r
-\r
-                       ++g_ipoib_send_ack;\r
                        p_endpt = s_buf->p_endpt;\r
 \r
                        NDIS_STATUS status = NDIS_STATUS_FAILURE;\r
@@ -7483,6 +7498,14 @@ ipoib_port_join_mcast(
 \r
        IPOIB_ENTER( IPOIB_DBG_MCAST );\r
 \r
+       IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_MCAST,\r
+               ("Join Multicast request: \n"\r
+               "\tsrc MAC: %02X-%02X-%02X-%02X-%02X-%02X\n",\r
+               mac.addr[0], mac.addr[1],\r
+               mac.addr[2], mac.addr[3],\r
+               mac.addr[4], mac.addr[5]));\r
+\r
+\r
        switch( __endpt_mgr_ref( p_port, mac, &p_endpt ) )\r
        {\r
        case NDIS_STATUS_NO_ROUTE_TO_DESTINATION:\r
@@ -7624,12 +7647,13 @@ __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_MCAST | IPOIB_DBG_INIT),\r
-                       ("Invalid state - Aborting.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_MCAST ,("Invalid state - Aborting.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT ,("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
+               //cl_spinlock_acquire(&p_port->send_lock);\r
+               //ipoib_port_resume(p_port , FALSE);\r
+               __pending_list_destroy( p_port );\r
+               //cl_spinlock_release(&p_port->send_lock);\r
                return;\r
        }\r
 \r