[ofw] [Patch][IPoIB_NDIS6_CM] __recv_cb_internal() revisited
Alex Naslednikov
xalex at mellanox.co.il
Mon Dec 27 05:43:10 PST 2010
Applied at 3046
-----Original Message-----
From: Alex Naslednikov
Sent: Wednesday, December 22, 2010 12:33 PM
To: Alex Naslednikov; ofw at lists.openfabrics.org
Subject: RE: [ofw][Patch][IPoIB_NDIS6_CM] __recv_cb_internal() revisited
Adding MACRO definitions to the previous patches
Index: B:/users/xalex/MLNX_VPI_trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp
===================================================================
--- B:/users/xalex/MLNX_VPI_trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp (revision 7041)
+++ B:/users/xalex/MLNX_VPI_trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp (revision 7042)
@@ -2167,8 +2167,8 @@
{
/* We may have thrown away packets, and have a shortage */
cl_perf_start( RepostRecv );
- IPOIB_PRINT_EXIT( TRACE_LEVEL_WARNING, IPOIB_DBG_ALL,
- ("Out of recv descriptors, reposting again\n") )
+ IPOIB_PRINT( TRACE_LEVEL_WARNING, IPOIB_DBG_ALL,
+ ("Out of recv descriptors, reposting again\n") );
shortage = __recv_mgr_repost( p_port );
cl_perf_stop( &p_port->p_adapter->perf, RepostRecv );
}
Index: B:/users/xalex/MLNX_VPI_trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_debug.h
===================================================================
--- B:/users/xalex/MLNX_VPI_trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_debug.h (revision 7041)
+++ B:/users/xalex/MLNX_VPI_trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_debug.h (revision 7042)
@@ -52,7 +52,6 @@
extern uint32_t g_ipoib_dbg_level;
extern uint32_t g_ipoib_dbg_flags;
-
#if defined(EVENT_TRACING)
//
// Software Tracing Definitions
@@ -74,10 +73,11 @@
WPP_DEFINE_BIT(IPOIB_DBG_IOCTL) \
WPP_DEFINE_BIT(IPOIB_DBG_STAT) \
WPP_DEFINE_BIT(IPOIB_DBG_OBJ) \
- WPP_DEFINE_BIT(IPOIB_DBG_SHUTTER))
+ WPP_DEFINE_BIT(IPOIB_DBG_SHUTTER) \
+ WPP_DEFINE_BIT(IPOIB_DBG_ALL) \
+ )
-
#define WPP_LEVEL_FLAGS_ENABLED(lvl, flags) \
(WPP_LEVEL_ENABLED(flags) && WPP_CONTROL(WPP_BIT_ ## flags).Level >= lvl) #define WPP_LEVEL_FLAGS_LOGGER(lvl,flags) WPP_LEVEL_LOGGER(flags)
-----Original Message-----
From: Alex Naslednikov
Sent: Wednesday, December 22, 2010 12:27 PM
To: Alex Naslednikov; ofw at lists.openfabrics.org
Subject: [ofw][Patch][IPoIB_NDIS6_CM] __recv_cb_internal() revisited
__recv_cb_internal revisited
Code clean-up and rearrange
Update shortage counter when reposting recv descriptors again Signed-off by: Alexander Naslednikov (xalex at mellanox.co.il)
Index: ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp
===================================================================
--- ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp (revision 3033)
+++ ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp (working copy)
@@ -2143,12 +2143,6 @@
cl_perf_start( RepostRecv );
shortage = __recv_mgr_repost( p_port );
- if( shortage > 0 )
- {
- recv_complete_flags |= NDIS_RECEIVE_FLAGS_RESOURCES;
- cl_dbg_out("Got SHORTAGE=%d\n",shortage);
- }
-
cl_perf_stop( &p_port->p_adapter->perf, RepostRecv );
cl_perf_start( BuildNBLArray );
@@ -2161,12 +2155,13 @@
{
/* We may have thrown away packets, and have a shortage */
cl_perf_start( RepostRecv );
- __recv_mgr_repost( p_port );
+ IPOIB_PRINT_EXIT( TRACE_LEVEL_WARNING, IPOIB_DBG_ALL,
+ ("Out of recv descriptors, reposting again\n") )
+ shortage = __recv_mgr_repost( p_port );
cl_perf_stop( &p_port->p_adapter->perf, RepostRecv );
}
if( !NBL_cnt ) {
- //cl_dbg_out("NBL cnt == 0 :-(\n");
break;
}
@@ -2174,7 +2169,8 @@
cl_perf_start( RecvNdisIndicate );
- if (shortage <= 0) {
+ if (shortage <= 0)
+ {
res = shutter_add( &p_port->p_adapter->recv_shutter, NBL_cnt );
if (res)
@@ -2191,14 +2187,16 @@
__free_received_NBL( p_port, p_port->recv_mgr.recv_NBL_array[0] );
cl_spinlock_release( &p_port->recv_lock );
}
-
- } else {
- /* If shortage >0, we already set the status to
- NDIS_RECEIVE_FLAGS_RESOURCES. That is, IPoIB driver regain
+ cl_perf_stop( &p_port->p_adapter->perf, RecvNdisIndicate );
+ }
+ else
+ {
+ /* If shortage >0, IPoIB driver should regain
ownership of the NET_BUFFER_LIST structures immediately.
*/
res = shutter_add( &p_port->p_adapter->recv_shutter, 1 );
if (res) {
+ recv_complete_flags |= NDIS_RECEIVE_FLAGS_RESOURCES;
NdisMIndicateReceiveNetBufferLists(
p_port->p_adapter->h_adapter,
p_port->recv_mgr.recv_NBL_array[0],
@@ -2207,20 +2205,18 @@
recv_complete_flags );
shutter_sub( &p_port->p_adapter->recv_shutter, -1 );
}
- }
+ cl_perf_stop( &p_port->p_adapter->perf, RecvNdisIndicate );
- cl_perf_stop( &p_port->p_adapter->perf, RecvNdisIndicate );
-
- /*
- * Cap the number of receives to put back to what we just indicated
- * with NDIS_STATUS_RESOURCES.
- */
- if( shortage > 0 )
- {
- cl_dbg_out("GOT SHORTAGE <===============\n");
+ /*
+ * Cap the number of receives to put back to what we just indicated
+ * with NDIS_STATUS_RESOURCES.
+ */
+
+ IPOIB_PRINT_EXIT( TRACE_LEVEL_WARNING, IPOIB_DBG_ALL,
+ ("Out of recv descriptors, SHORTAGE=%d\n",shortage) );
+
/* Return all but the last packet to the pool. */
cl_spinlock_acquire( &p_port->recv_lock );
- //while( shortage-- > 1 )
while ( NBL_cnt-- > 0)
{
__buf_mgr_put_recv(
@@ -2232,12 +2228,8 @@
__recv_mgr_repost( p_port );
cl_spinlock_release( &p_port->recv_lock );
- /*
- * Return the last packet as if NDIS returned it, so that we repost
- * and report any other pending receives.
- */
- //ipoib_return_net_buffer_list( p_port, p_port->recv_mgr.recv_NBL_array[0],recv_complete_flags );
}
+
cl_spinlock_acquire( &p_port->recv_lock );
} while( NBL_cnt );
More information about the ofw
mailing list