[IPOIB] g_stat: added more fields: prev_port and halt thread.
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 30 Nov 2009 15:41:53 +0000 (15:41 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 30 Nov 2009 15:41:53 +0000 (15:41 +0000)
When IPoIB is stuck, it is usually found in the halt thread, waiting for resources reclamation. (mlnx 5188)

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

ulp/ipoib/kernel/ipoib_adapter.c
ulp/ipoib/kernel/ipoib_driver.c
ulp/ipoib/kernel/ipoib_stat.h
ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp
ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp
ulp/ipoib_NDIS6_CM/kernel/ipoib_stat.h

index 1115bc5..80cba64 100644 (file)
@@ -272,6 +272,7 @@ ipoib_destroy_adapter(
         * will cascade to child objects.  This prevents potential duplicate\r
         * destruction (or worse, stale pointer usage).\r
         */\r
+       p_adapter->p_stat->p_prev_port = p_adapter->p_port;\r
        p_adapter->p_port = NULL;\r
 \r
        cl_obj_unlock( &p_adapter->obj );\r
@@ -644,6 +645,7 @@ __ipoib_pnp_cb(
 \r
                p_pnp_rec->context = p_port;\r
 \r
+               p_adapter->p_stat->p_prev_port = p_adapter->p_port;\r
                p_adapter->p_port = p_port;\r
                cl_obj_unlock( &p_adapter->obj );\r
                break;\r
@@ -654,6 +656,7 @@ __ipoib_pnp_cb(
 \r
                cl_obj_lock( &p_adapter->obj );\r
                p_adapter->state = IB_PNP_PORT_REMOVE;\r
+               p_adapter->p_stat->p_prev_port = p_adapter->p_port;\r
                p_port = p_adapter->p_port;\r
                p_adapter->p_port = NULL;\r
                cl_obj_unlock( &p_adapter->obj );\r
@@ -965,6 +968,7 @@ __ipoib_adapter_reset(
        state = p_adapter->state;\r
 \r
        /* Destroy the current port instance if it still exists. */\r
+       p_adapter->p_stat->p_prev_port = p_adapter->p_port;\r
        p_port = p_adapter->p_port;\r
        p_adapter->p_port = NULL;\r
        cl_obj_unlock( &p_adapter->obj );\r
index 3b11aba..f8809bc 100644 (file)
@@ -608,7 +608,7 @@ ipoib_get_adapter_params(
        NdisCloseConfiguration( h_config );\r
 \r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
-       return NDIS_STATUS_SUCCESS;\r
+       return status;\r
 }\r
 \r
 \r
@@ -819,6 +819,7 @@ ipoib_halt(
        CL_ASSERT( adapter_context );\r
        p_adapter = (ipoib_adapter_t*)adapter_context;\r
        p_stat = p_adapter->p_stat;\r
+       p_stat->p_halt_thread = KeGetCurrentThread();\r
 \r
        IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Port %016I64x (CA %016I64x port %d) halting\n",\r
index 1613a7d..7e601bb 100644 (file)
@@ -34,11 +34,15 @@ Notes:
 \r
 // device\r
 typedef struct _ipoib_adapter ipoib_adapter_t;\r
+typedef struct _ipoib_port ipoib_port_t;\r
+\r
 \r
 typedef struct _IPOIB_ST_DEVICE\r
 {\r
        boolean_t                       valid;\r
        ipoib_adapter_t         *p_adapter;\r
+       ipoib_port_t            *p_prev_port;\r
+       PRKTHREAD                       *p_halt_thread;\r
        int                                     n_power_irps;   // NdisDevicePnPEventPowerProfileChanged \r
        int                                     n_pnp_irps;             // NdisDevicePnPEventSurpriseRemoved \r
        \r
index e9283cf..c1a8b74 100644 (file)
@@ -262,6 +262,7 @@ ipoib_destroy_adapter(
         * will cascade to child objects.  This prevents potential duplicate\r
         * destruction (or worse, stale pointer usage).\r
         */\r
+       p_adapter->p_stat->p_prev_port = p_adapter->p_port;\r
        p_adapter->p_port = NULL;\r
 \r
        cl_obj_unlock( &p_adapter->obj );\r
@@ -666,6 +667,7 @@ __ipoib_pnp_cb(
 \r
                p_pnp_rec->context = p_port;\r
 \r
+               p_adapter->p_stat->p_prev_port = p_adapter->p_port;\r
                p_adapter->p_port = p_port;\r
                cl_obj_unlock( &p_adapter->obj );\r
                break;\r
@@ -683,6 +685,7 @@ __ipoib_pnp_cb(
 \r
                cl_obj_lock( &p_adapter->obj );\r
                p_adapter->state = IB_PNP_PORT_REMOVE;\r
+               p_adapter->p_stat->p_prev_port = p_adapter->p_port;\r
                p_port = p_adapter->p_port;\r
                p_adapter->p_port = NULL;\r
                cl_obj_unlock( &p_adapter->obj );\r
@@ -1019,6 +1022,7 @@ __ipoib_adapter_reset(
        state = p_adapter->state;\r
 \r
        /* Destroy the current port instance if it still exists. */\r
+       p_adapter->p_stat->p_prev_port = p_adapter->p_port;\r
        p_port = p_adapter->p_port;\r
        p_adapter->p_port = NULL;\r
        cl_obj_unlock( &p_adapter->obj );\r
index 215eeb3..477460b 100644 (file)
@@ -881,7 +881,7 @@ ipoib_get_adapter_params(
        NdisCloseConfiguration( h_config );\r
 \r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
-       return NDIS_STATUS_SUCCESS;\r
+       return status;\r
 }\r
 \r
 \r
@@ -2093,6 +2093,7 @@ ipoib_halt_ex(
 #endif\r
 \r
        PIPOIB_ST_DEVICE p_stat = p_adapter->p_stat;\r
+       p_stat->p_halt_thread = KeGetCurrentThread();\r
        ipoib_destroy_adapter( p_adapter );\r
        ipoib_st_dev_rmv( p_stat );\r
 \r
index 1613a7d..1c84791 100644 (file)
@@ -34,11 +34,14 @@ Notes:
 \r
 // device\r
 typedef struct _ipoib_adapter ipoib_adapter_t;\r
+typedef struct _ipoib_port ipoib_port_t;\r
 \r
 typedef struct _IPOIB_ST_DEVICE\r
 {\r
        boolean_t                       valid;\r
        ipoib_adapter_t         *p_adapter;\r
+       ipoib_port_t            *p_prev_port;\r
+       PRKTHREAD                       *p_halt_thread;\r
        int                                     n_power_irps;   // NdisDevicePnPEventPowerProfileChanged \r
        int                                     n_pnp_irps;             // NdisDevicePnPEventSurpriseRemoved \r
        \r