[IPOIB_NDIS6_CM] g_stat: added to the adapter structure two previously global counter...
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 2 Dec 2009 09:28:59 +0000 (09:28 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 2 Dec 2009 09:28:59 +0000 (09:28 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2614 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_adapter.h
ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp
ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp
ulp/ipoib_NDIS6_CM/kernel/ipoib_port.h
ulp/ipoib_NDIS6_CM/kernel/ipoib_stat.h

index 90757e4..003ba12 100644 (file)
@@ -224,6 +224,10 @@ ipoib_create_adapter(
                }\r
        }\r
 \r
                }\r
        }\r
 \r
+       p_adapter->p_stat = ipoib_st_dev_add();\r
+       if ( p_adapter->p_stat ) \r
+               p_adapter->p_stat->p_adapter = p_adapter;\r
+\r
        *pp_adapter = p_adapter;\r
 \r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
        *pp_adapter = p_adapter;\r
 \r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
@@ -251,10 +255,19 @@ void
 ipoib_destroy_adapter(\r
        IN                              ipoib_adapter_t* const          p_adapter )\r
 {\r
 ipoib_destroy_adapter(\r
        IN                              ipoib_adapter_t* const          p_adapter )\r
 {\r
+       PIPOIB_ST_DEVICE p_stat;\r
+\r
        IPOIB_ENTER( IPOIB_DBG_INIT );\r
 \r
        CL_ASSERT( p_adapter );\r
 \r
        IPOIB_ENTER( IPOIB_DBG_INIT );\r
 \r
        CL_ASSERT( p_adapter );\r
 \r
+       // statistics\r
+       p_stat = p_adapter->p_stat;\r
+       if ( p_stat ) {\r
+               p_stat->p_halt_thread = KeGetCurrentThread();\r
+               p_stat->p_prev_port = p_adapter->p_port;\r
+       }\r
+\r
        /*\r
         * Flag the adapter as being removed.  We use the IB_PNP_PORT_REMOVE state\r
         * for this purpose.  Note that we protect this state change with both the\r
        /*\r
         * Flag the adapter as being removed.  We use the IB_PNP_PORT_REMOVE state\r
         * for this purpose.  Note that we protect this state change with both the\r
@@ -272,7 +285,6 @@ ipoib_destroy_adapter(
         * will cascade to child objects.  This prevents potential duplicate\r
         * destruction (or worse, stale pointer usage).\r
         */\r
         * 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
        p_adapter->p_port = NULL;\r
 \r
        cl_obj_unlock( &p_adapter->obj );\r
@@ -280,6 +292,7 @@ ipoib_destroy_adapter(
        KeReleaseMutex( &p_adapter->mutex, FALSE );\r
 \r
        cl_obj_destroy( &p_adapter->obj );\r
        KeReleaseMutex( &p_adapter->mutex, FALSE );\r
 \r
        cl_obj_destroy( &p_adapter->obj );\r
+       ipoib_st_dev_rmv( p_stat );\r
 \r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
 }\r
 \r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
 }\r
@@ -645,7 +658,8 @@ __ipoib_pnp_cb(
 \r
                p_pnp_rec->context = p_port;\r
 \r
 \r
                p_pnp_rec->context = p_port;\r
 \r
-               p_adapter->p_stat->p_prev_port = p_adapter->p_port;\r
+               if ( p_adapter->p_stat ) \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
                p_adapter->p_port = p_port;\r
                cl_obj_unlock( &p_adapter->obj );\r
                break;\r
@@ -656,9 +670,10 @@ __ipoib_pnp_cb(
 \r
                cl_obj_lock( &p_adapter->obj );\r
                p_adapter->state = IB_PNP_PORT_REMOVE;\r
 \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
                p_port = p_adapter->p_port;\r
                p_adapter->p_port = NULL;\r
+               if ( p_adapter->p_stat ) \r
+                       p_adapter->p_stat->p_prev_port = p_port;\r
                cl_obj_unlock( &p_adapter->obj );\r
                ipoib_port_destroy( p_port );\r
                p_pnp_rec->context = NULL;\r
                cl_obj_unlock( &p_adapter->obj );\r
                ipoib_port_destroy( p_port );\r
                p_pnp_rec->context = NULL;\r
@@ -968,9 +983,10 @@ __ipoib_adapter_reset(
        state = p_adapter->state;\r
 \r
        /* Destroy the current port instance if it still exists. */\r
        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
        p_port = p_adapter->p_port;\r
        p_adapter->p_port = NULL;\r
+       if ( p_adapter->p_stat ) \r
+               p_adapter->p_stat->p_prev_port = p_port;\r
        cl_obj_unlock( &p_adapter->obj );\r
 \r
        if( p_port )\r
        cl_obj_unlock( &p_adapter->obj );\r
 \r
        if( p_port )\r
index 32cad65..a29347e 100644 (file)
@@ -791,10 +791,6 @@ ipoib_initialize(
                return NDIS_STATUS_FAILURE;\r
        }\r
 \r
                return NDIS_STATUS_FAILURE;\r
        }\r
 \r
-       p_adapter->p_stat = ipoib_st_dev_add();\r
-       if ( p_adapter->p_stat ) \r
-               p_adapter->p_stat->p_adapter = p_adapter;\r
-       \r
        ipoib_ref_ibat();\r
 \r
        IPOIB_PRINT_EXIT(TRACE_LEVEL_WARNING, IPOIB_DBG_INIT, \r
        ipoib_ref_ibat();\r
 \r
        IPOIB_PRINT_EXIT(TRACE_LEVEL_WARNING, IPOIB_DBG_INIT, \r
@@ -814,7 +810,6 @@ ipoib_halt(
        IN                              NDIS_HANDLE                                     adapter_context )\r
 {\r
        ipoib_adapter_t *p_adapter;\r
        IN                              NDIS_HANDLE                                     adapter_context )\r
 {\r
        ipoib_adapter_t *p_adapter;\r
-       PIPOIB_ST_DEVICE p_stat;\r
 \r
        IPOIB_ENTER( IPOIB_DBG_INIT );\r
 \r
 \r
        IPOIB_ENTER( IPOIB_DBG_INIT );\r
 \r
@@ -822,8 +817,6 @@ ipoib_halt(
 \r
        CL_ASSERT( adapter_context );\r
        p_adapter = (ipoib_adapter_t*)adapter_context;\r
 \r
        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
 \r
        IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Port %016I64x (CA %016I64x port %d) halting\n",\r
@@ -831,7 +824,6 @@ ipoib_halt(
                        p_adapter->guids.port_num) );\r
 \r
        ipoib_destroy_adapter( p_adapter );\r
                        p_adapter->guids.port_num) );\r
 \r
        ipoib_destroy_adapter( p_adapter );\r
-       ipoib_st_dev_rmv( p_stat );\r
 \r
        IPOIB_PRINT_EXIT(TRACE_LEVEL_WARNING, IPOIB_DBG_INIT, \r
                ("=====> ipoib_halt exited\n"));\r
 \r
        IPOIB_PRINT_EXIT(TRACE_LEVEL_WARNING, IPOIB_DBG_INIT, \r
                ("=====> ipoib_halt exited\n"));\r
@@ -1940,10 +1932,12 @@ ipoib_pnp_notify(
                cl_obj_unlock( &p_adapter->obj );\r
 \r
                ipoib_resume_oids( p_adapter );\r
                cl_obj_unlock( &p_adapter->obj );\r
 \r
                ipoib_resume_oids( p_adapter );\r
-               p_adapter->p_stat->n_pnp_irps++;\r
+               if ( p_adapter->p_stat ) \r
+                       p_adapter->p_stat->n_pnp_irps++;\r
        }\r
        else \r
        }\r
        else \r
-               p_adapter->p_stat->n_power_irps++;\r
+               if ( p_adapter->p_stat ) \r
+                       p_adapter->p_stat->n_power_irps++;\r
 \r
        IPOIB_PRINT_EXIT(TRACE_LEVEL_WARNING, IPOIB_DBG_PNP, \r
                ("=====> ipoib_pnp_notify exited, PnP event %d\n", pnp_event));\r
 \r
        IPOIB_PRINT_EXIT(TRACE_LEVEL_WARNING, IPOIB_DBG_PNP, \r
                ("=====> ipoib_pnp_notify exited, PnP event %d\n", pnp_event));\r
index 6f1d187..08e8350 100644 (file)
@@ -22,7 +22,7 @@ Notes:
 // restrictions\r
 //\r
 \r
 // restrictions\r
 //\r
 \r
-#define IPOIB_ST_MAX_DEVICES                   8\r
+#define IPOIB_ST_MAX_DEVICES                   16\r
 \r
 //\r
 // enums\r
 \r
 //\r
 // enums\r
@@ -39,12 +39,12 @@ typedef struct _ipoib_port ipoib_port_t;
 \r
 typedef struct _IPOIB_ST_DEVICE\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
+       boolean_t                       valid;                          // all the structure is valid\r
+       ipoib_adapter_t         *p_adapter;                     // current\r
+       ipoib_port_t            *p_prev_port;           // previous value of p_port in p_adapter\r
+       PRKTHREAD                       p_halt_thread;          // thread, calling ipoib_halt\r
+       int                                     n_power_irps;           // NdisDevicePnPEventPowerProfileChanged \r
+       int                                     n_pnp_irps;                     // NdisDevicePnPEventSurpriseRemoved \r
        \r
 } IPOIB_ST_DEVICE, *PIPOIB_ST_DEVICE;\r
 \r
        \r
 } IPOIB_ST_DEVICE, *PIPOIB_ST_DEVICE;\r
 \r
index 7c9eebd..31bd76f 100644 (file)
@@ -214,6 +214,10 @@ ipoib_create_adapter(
                }\r
        }\r
 \r
                }\r
        }\r
 \r
+       p_adapter->p_stat = ipoib_st_dev_add();\r
+       if ( p_adapter->p_stat ) \r
+               p_adapter->p_stat->p_adapter = p_adapter;\r
+\r
        *pp_adapter = p_adapter;\r
 \r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
        *pp_adapter = p_adapter;\r
 \r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
@@ -241,10 +245,19 @@ void
 ipoib_destroy_adapter(\r
        IN                              ipoib_adapter_t* const          p_adapter )\r
 {\r
 ipoib_destroy_adapter(\r
        IN                              ipoib_adapter_t* const          p_adapter )\r
 {\r
+       PIPOIB_ST_DEVICE p_stat;\r
+\r
        IPOIB_ENTER( IPOIB_DBG_INIT );\r
 \r
        CL_ASSERT( p_adapter );\r
 \r
        IPOIB_ENTER( IPOIB_DBG_INIT );\r
 \r
        CL_ASSERT( p_adapter );\r
 \r
+       // statistics\r
+       p_stat = p_adapter->p_stat;\r
+       if ( p_stat ) {\r
+               p_stat->p_halt_thread = KeGetCurrentThread();\r
+               p_stat->p_prev_port = p_adapter->p_port;\r
+       }\r
+\r
        /*\r
         * Flag the adapter as being removed.  We use the IB_PNP_PORT_REMOVE state\r
         * for this purpose.  Note that we protect this state change with both the\r
        /*\r
         * Flag the adapter as being removed.  We use the IB_PNP_PORT_REMOVE state\r
         * for this purpose.  Note that we protect this state change with both the\r
@@ -262,7 +275,6 @@ ipoib_destroy_adapter(
         * will cascade to child objects.  This prevents potential duplicate\r
         * destruction (or worse, stale pointer usage).\r
         */\r
         * 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
        p_adapter->p_port = NULL;\r
 \r
        cl_obj_unlock( &p_adapter->obj );\r
@@ -270,6 +282,7 @@ ipoib_destroy_adapter(
        KeReleaseMutex( &p_adapter->mutex, FALSE );\r
 \r
        cl_obj_destroy( &p_adapter->obj );\r
        KeReleaseMutex( &p_adapter->mutex, FALSE );\r
 \r
        cl_obj_destroy( &p_adapter->obj );\r
+       ipoib_st_dev_rmv( p_stat );\r
 \r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
 }\r
 \r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
 }\r
@@ -673,7 +686,7 @@ __ipoib_pnp_cb(
                }\r
 \r
                p_pnp_rec->context = p_port;\r
                }\r
 \r
                p_pnp_rec->context = p_port;\r
-               if ( p_adapter->p_stat )\r
+               if ( p_adapter->p_stat ) \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
                        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
@@ -692,10 +705,10 @@ __ipoib_pnp_cb(
 \r
                cl_obj_lock( &p_adapter->obj );\r
                p_adapter->state = IB_PNP_PORT_REMOVE;\r
 \r
                cl_obj_lock( &p_adapter->obj );\r
                p_adapter->state = IB_PNP_PORT_REMOVE;\r
-               if ( p_adapter->p_stat )\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
                p_port = p_adapter->p_port;\r
                p_adapter->p_port = NULL;\r
+               if ( p_adapter->p_stat ) \r
+                       p_adapter->p_stat->p_prev_port = p_port;\r
                cl_obj_unlock( &p_adapter->obj );\r
                ipoib_port_destroy( p_port );\r
                p_pnp_rec->context = NULL;\r
                cl_obj_unlock( &p_adapter->obj );\r
                ipoib_port_destroy( p_port );\r
                p_pnp_rec->context = NULL;\r
@@ -1030,10 +1043,10 @@ __ipoib_adapter_reset(
        state = p_adapter->state;\r
 \r
        /* Destroy the current port instance if it still exists. */\r
        state = p_adapter->state;\r
 \r
        /* Destroy the current port instance if it still exists. */\r
-       if ( p_adapter->p_stat )\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
        p_port = p_adapter->p_port;\r
        p_adapter->p_port = NULL;\r
+       if ( p_adapter->p_stat ) \r
+               p_adapter->p_stat->p_prev_port = p_port;\r
        cl_obj_unlock( &p_adapter->obj );\r
 \r
        if( p_port )\r
        cl_obj_unlock( &p_adapter->obj );\r
 \r
        if( p_port )\r
index 2976993..c739ea1 100644 (file)
@@ -232,7 +232,11 @@ typedef struct _ipoib_adapter
        ib_al_ifc_t                             *p_ifc;\r
 \r
        ULONG                                   sg_list_size;\r
        ib_al_ifc_t                             *p_ifc;\r
 \r
        ULONG                                   sg_list_size;\r
+\r
+       // statistics \r
        PIPOIB_ST_DEVICE                p_stat;\r
        PIPOIB_ST_DEVICE                p_stat;\r
+       ULONG                                   n_send_NBL;                     // number of send NBLs, gotten from NDIS\r
+       ULONG                                   n_send_NBL_done;        // number of send NBLs, completed\r
 \r
 }      ipoib_adapter_t;\r
 /*\r
 \r
 }      ipoib_adapter_t;\r
 /*\r
@@ -380,6 +384,10 @@ typedef struct _net_address_item
 *              The IP address represented as an array of bytes.\r
 *********/\r
 \r
 *              The IP address represented as an array of bytes.\r
 *********/\r
 \r
+static inline void ipoib_cnt_inc( PULONG p_cnt)\r
+{\r
+       ++*p_cnt;\r
+}\r
 \r
 ib_api_status_t\r
 ipoib_create_adapter(\r
 \r
 ib_api_status_t\r
 ipoib_create_adapter(\r
index 4c542fe..a266793 100644 (file)
@@ -2006,7 +2006,7 @@ if(cl_get_time_stamp_sec() < 30) {
                        return NDIS_STATUS_FAILURE;\r
                }\r
                p_adapter->ipoib_state = IPOIB_PAUSED;\r
                        return NDIS_STATUS_FAILURE;\r
                }\r
                p_adapter->ipoib_state = IPOIB_PAUSED;\r
-               \r
+\r
                status  = SetAttributes(p_adapter, h_adapter);\r
                if (status != NDIS_STATUS_SUCCESS) {\r
                        //ASSERT(FALSE);\r
                status  = SetAttributes(p_adapter, h_adapter);\r
                if (status != NDIS_STATUS_SUCCESS) {\r
                        //ASSERT(FALSE);\r
@@ -2059,10 +2059,6 @@ if(cl_get_time_stamp_sec() < 30) {
                        return NDIS_STATUS_FAILURE;\r
                }\r
 \r
                        return NDIS_STATUS_FAILURE;\r
                }\r
 \r
-               p_adapter->p_stat = ipoib_st_dev_add();\r
-               if ( p_adapter->p_stat ) \r
-                       p_adapter->p_stat->p_adapter = p_adapter;\r
-\r
                ipoib_ref_ibat();\r
        \r
                IPOIB_EXIT( IPOIB_DBG_INIT );\r
                ipoib_ref_ibat();\r
        \r
                IPOIB_EXIT( IPOIB_DBG_INIT );\r
@@ -2105,10 +2101,7 @@ ipoib_halt_ex(
        }\r
 #endif\r
 \r
        }\r
 #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_destroy_adapter( p_adapter );\r
-       ipoib_st_dev_rmv( p_stat );\r
 \r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
 }\r
 \r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
 }\r
@@ -3334,6 +3327,8 @@ ipoib_send_net_buffer_list(
        {\r
 \r
                ++g_NBL;\r
        {\r
 \r
                ++g_NBL;\r
+               ipoib_cnt_inc( &p_adapter->n_send_NBL );\r
+               \r
                next_net_buffer_list = NET_BUFFER_LIST_NEXT_NBL(curr_net_buffer_list);\r
         KeMemoryBarrierWithoutFence();\r
                // Important issue, break the connection between the different nbls\r
                next_net_buffer_list = NET_BUFFER_LIST_NEXT_NBL(curr_net_buffer_list);\r
         KeMemoryBarrierWithoutFence();\r
                // Important issue, break the connection between the different nbls\r
@@ -3365,6 +3360,8 @@ compl_status:
                                 curr_net_buffer_list = next_net_buffer_list)\r
                {\r
                        ++g_NBL;\r
                                 curr_net_buffer_list = next_net_buffer_list)\r
                {\r
                        ++g_NBL;\r
+                       ipoib_cnt_inc( &p_adapter->n_send_NBL );\r
+                       \r
                        next_net_buffer_list = NET_BUFFER_LIST_NEXT_NBL(curr_net_buffer_list);\r
                        NET_BUFFER_LIST_STATUS(curr_net_buffer_list) = status;\r
                        ipoib_inc_send_stat( p_adapter, IP_STAT_DROPPED, 0 );\r
                        next_net_buffer_list = NET_BUFFER_LIST_NEXT_NBL(curr_net_buffer_list);\r
                        NET_BUFFER_LIST_STATUS(curr_net_buffer_list) = status;\r
                        ipoib_inc_send_stat( p_adapter, IP_STAT_DROPPED, 0 );\r
@@ -3378,7 +3375,7 @@ compl_status:
                        NDIS_SET_SEND_COMPLETE_FLAG(send_complete_flags, NDIS_SEND_COMPLETE_FLAGS_DISPATCH_LEVEL);\r
                }\r
                NdisMSendNetBufferListsCompleteX(\r
                        NDIS_SET_SEND_COMPLETE_FLAG(send_complete_flags, NDIS_SEND_COMPLETE_FLAGS_DISPATCH_LEVEL);\r
                }\r
                NdisMSendNetBufferListsCompleteX(\r
-                       p_adapter->h_adapter,\r
+                       p_adapter,\r
                        net_buffer_list,\r
                        send_complete_flags); \r
        }\r
                        net_buffer_list,\r
                        send_complete_flags); \r
        }\r
@@ -3404,10 +3401,12 @@ ipoib_pnp_notify(
                cl_obj_unlock( &p_adapter->obj );\r
 \r
                ipoib_resume_oids( p_adapter );\r
                cl_obj_unlock( &p_adapter->obj );\r
 \r
                ipoib_resume_oids( p_adapter );\r
-               p_adapter->p_stat->n_pnp_irps++;\r
+               if ( p_adapter->p_stat ) \r
+                       p_adapter->p_stat->n_pnp_irps++;\r
        }\r
        else \r
        }\r
        else \r
-               p_adapter->p_stat->n_power_irps++;\r
+               if ( p_adapter->p_stat ) \r
+                       p_adapter->p_stat->n_power_irps++;\r
 \r
        IPOIB_EXIT( IPOIB_DBG_PNP );\r
 }\r
 \r
        IPOIB_EXIT( IPOIB_DBG_PNP );\r
 }\r
index 7b2413f..5c812dc 100644 (file)
@@ -5318,7 +5318,7 @@ ipoib_port_send(
                ipoib_inc_send_stat( p_port->p_adapter, IP_STAT_DROPPED, 0 );\r
                        \r
                NdisMSendNetBufferListsCompleteX(\r
                ipoib_inc_send_stat( p_port->p_adapter, IP_STAT_DROPPED, 0 );\r
                        \r
                NdisMSendNetBufferListsCompleteX(\r
-                       p_port->p_adapter->h_adapter,\r
+                       p_port->p_adapter,\r
                        p_net_buffer_list,\r
                        send_complete_flags);  \r
                \r
                        p_net_buffer_list,\r
                        send_complete_flags);  \r
                \r
@@ -5361,7 +5361,7 @@ ipoib_port_send(
                        ASSERT(FALSE);\r
                        NET_BUFFER_LIST_STATUS(p_net_buffer_list) = NDIS_STATUS_RESOURCES;\r
                        NdisMSendNetBufferListsCompleteX(\r
                        ASSERT(FALSE);\r
                        NET_BUFFER_LIST_STATUS(p_net_buffer_list) = NDIS_STATUS_RESOURCES;\r
                        NdisMSendNetBufferListsCompleteX(\r
-                               p_port->p_adapter->h_adapter,\r
+                               p_port->p_adapter,\r
                                p_net_buffer_list,\r
                                send_complete_flags);   \r
                                break;\r
                                p_net_buffer_list,\r
                                send_complete_flags);   \r
                                break;\r
@@ -5437,7 +5437,7 @@ ipoib_port_send(
                        /* fail net buffer list */\r
                        NET_BUFFER_LIST_STATUS(p_net_buffer_list) = status;\r
                        NdisMSendNetBufferListsCompleteX(\r
                        /* fail net buffer list */\r
                        NET_BUFFER_LIST_STATUS(p_net_buffer_list) = status;\r
                        NdisMSendNetBufferListsCompleteX(\r
-                               p_port->p_adapter->h_adapter,\r
+                               p_port->p_adapter,\r
                                p_net_buffer_list,\r
                                send_complete_flags);   \r
                                break;\r
                                p_net_buffer_list,\r
                                send_complete_flags);   \r
                                break;\r
@@ -5527,11 +5527,11 @@ __send_complete_net_buffer(
                \r
                if (bLock) {\r
                        cl_spinlock_release( &s_buf->p_port->send_lock );\r
                \r
                if (bLock) {\r
                        cl_spinlock_release( &s_buf->p_port->send_lock );\r
-                       NdisMSendNetBufferListsCompleteX( s_buf->p_port->p_adapter->h_adapter,\r
+                       NdisMSendNetBufferListsCompleteX( s_buf->p_port->p_adapter,\r
                                s_buf->p_nbl, compl_flags );\r
                        cl_spinlock_acquire( &s_buf->p_port->send_lock );  \r
                } else {\r
                                s_buf->p_nbl, compl_flags );\r
                        cl_spinlock_acquire( &s_buf->p_port->send_lock );  \r
                } else {\r
-                       NdisMSendNetBufferListsCompleteX( s_buf->p_port->p_adapter->h_adapter,\r
+                       NdisMSendNetBufferListsCompleteX( s_buf->p_port->p_adapter,\r
                                s_buf->p_nbl, compl_flags );\r
                }\r
        } \r
                                s_buf->p_nbl, compl_flags );\r
                }\r
        } \r
index 2d35ecd..db3f943 100644 (file)
@@ -911,31 +911,31 @@ __port_attr_to_mtu_size(uint32_t value)
 \r
 \r
 \r
 \r
 \r
 \r
-#if DBG\r
 // This function is only used to monitor send failures\r
 extern ULONG g_NBL_complete;\r
 extern ULONG g_NBL;\r
 \r
 static inline VOID NdisMSendNetBufferListsCompleteX(\r
 // This function is only used to monitor send failures\r
 extern ULONG g_NBL_complete;\r
 extern ULONG g_NBL;\r
 \r
 static inline VOID NdisMSendNetBufferListsCompleteX(\r
-       IN NDIS_HANDLE  MiniportAdapterHandle,\r
+       IN ipoib_adapter_t* p_adapter,\r
        IN PNET_BUFFER_LIST  NetBufferLists,\r
        IN ULONG  SendCompleteFlags\r
        ) \r
 {\r
        IN PNET_BUFFER_LIST  NetBufferLists,\r
        IN ULONG  SendCompleteFlags\r
        ) \r
 {\r
+       ++g_NBL_complete;\r
+       ipoib_cnt_inc( &p_adapter->n_send_NBL_done );\r
+\r
+#ifdef DBG     \r
        ASSERT(NET_BUFFER_LIST_NEXT_NBL(NetBufferLists) == NULL);\r
        ASSERT(NET_BUFFER_LIST_NEXT_NBL(NetBufferLists) == NULL);\r
-       \r
+\r
        if (NET_BUFFER_LIST_STATUS(NetBufferLists) != NDIS_STATUS_SUCCESS) {\r
        if (NET_BUFFER_LIST_STATUS(NetBufferLists) != NDIS_STATUS_SUCCESS) {\r
-       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_ALL,\r
-               ("NBL completed with error %d to NDIS\n", NET_BUFFER_LIST_STATUS(NetBufferLists)));\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_ALL,\r
+                       ("NBL completed with error %d to NDIS\n", NET_BUFFER_LIST_STATUS(NetBufferLists)));\r
        }\r
        }\r
-       \r
-       ++g_NBL_complete;\r
        IPOIB_PRINT( TRACE_LEVEL_VERBOSE, IPOIB_DBG_SEND,\r
                                ("Completing NBL=%x, g_NBL=%d, g_NBL_completed=%d \n", NetBufferLists, g_NBL, g_NBL_complete) );\r
        IPOIB_PRINT( TRACE_LEVEL_VERBOSE, IPOIB_DBG_SEND,\r
                                ("Completing NBL=%x, g_NBL=%d, g_NBL_completed=%d \n", NetBufferLists, g_NBL, g_NBL_complete) );\r
-       NdisMSendNetBufferListsComplete(MiniportAdapterHandle,NetBufferLists,SendCompleteFlags);\r
-}\r
-#else\r
-#define NdisMSendNetBufferListsCompleteX NdisMSendNetBufferListsComplete\r
 #endif\r
 \r
 #endif\r
 \r
+       NdisMSendNetBufferListsComplete(p_adapter->h_adapter,NetBufferLists,SendCompleteFlags);\r
+}\r
+\r
 #endif /* _IPOIB_PORT_H_ */\r
 #endif /* _IPOIB_PORT_H_ */\r
index 1854be4..8f2fa27 100644 (file)
@@ -22,7 +22,7 @@ Notes:
 // restrictions\r
 //\r
 \r
 // restrictions\r
 //\r
 \r
-#define IPOIB_ST_MAX_DEVICES                   8\r
+#define IPOIB_ST_MAX_DEVICES                   16\r
 \r
 //\r
 // enums\r
 \r
 //\r
 // enums\r
@@ -38,12 +38,12 @@ typedef struct _ipoib_port ipoib_port_t;
 \r
 typedef struct _IPOIB_ST_DEVICE\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
+       boolean_t                       valid;                          // all the structure is valid\r
+       ipoib_adapter_t         *p_adapter;                     // current\r
+       ipoib_port_t            *p_prev_port;           // previous value of p_port in p_adapter\r
+       PRKTHREAD                       p_halt_thread;          // thread, calling ipoib_halt\r
+       int                                     n_power_irps;           // NdisDevicePnPEventPowerProfileChanged \r
+       int                                     n_pnp_irps;                     // NdisDevicePnPEventSurpriseRemoved \r
        \r
 } IPOIB_ST_DEVICE, *PIPOIB_ST_DEVICE;\r
 \r
        \r
 } IPOIB_ST_DEVICE, *PIPOIB_ST_DEVICE;\r
 \r