[ofw] [Patch][IPoIB]
Alex Naslednikov
xalex at mellanox.co.il
Mon Jan 3 07:46:07 PST 2011
[IPoIB]
This is the merge of commit from NDIS6 tree
The purpose of __ipoib_complete_reset() is to send to NDIS async compete on reset process accomplishment and set "p_adapter->reset = FALSE";
But __ipoib_complete_reset() can be called independently from several async threads (i.e. running in parallel), where the main of them are:
1. __ipoib_adapter_reset()
2. Ipoib_pnp_cb()
It seems like bug, but:
1. We check for adapter state within __ipoib_complete_reset() . This is to sync between NDIS and IBAL async PNP events !!
2. According to the status, we have 2 possibilities:
a. State == IB_PNP_PORT_REMOVE - than complete the reset now (and ASSERT(p_adapter->reset == TRUE) should be true there))
b. Otherwise (IB_PNP_PORT_ADD), register back to pnp events
i. If succeed, do not complete reset here - reset process will be completed by ipoib_pnp_cb() thread.
ii. If not, reset process will be completed now (ASSERT(p_adapter->reset == TRUE) should be true there)
How it can happen ?
NDIS detected checked_for_hung while IPoIB get PORT_DOWN/UP pnp events
Index: B:/users/xalex/WoF-trunk/ulp/ipoib/kernel/ipoib_adapter.c
===================================================================
--- B:/users/xalex/WoF-trunk/ulp/ipoib/kernel/ipoib_adapter.c (revision 3053)
+++ B:/users/xalex/WoF-trunk/ulp/ipoib/kernel/ipoib_adapter.c (working copy)
@@ -994,12 +994,13 @@
if( p_port )
ipoib_port_destroy( p_port );
- ASSERT(p_adapter->reset == TRUE);
+
if( state != IB_PNP_PORT_REMOVE )
{
status = __ipoib_pnp_reg( p_adapter, IB_PNP_FLAG_REG_COMPLETE );
if( status != IB_SUCCESS )
{
+ ASSERT( p_adapter->reset == TRUE );
p_adapter->reset = FALSE;
IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,
("__ipoib_pnp_reg returned %s\n",
@@ -1010,6 +1011,7 @@
}
else
{
+ ASSERT( p_adapter->reset == TRUE );
p_adapter->reset = FALSE;
NdisMResetComplete(
p_adapter->h_adapter, NDIS_STATUS_SUCCESS, TRUE );
Alexander (XaleX) Naslednikov
SW Networking Team
Mellanox Technologies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20110103/64c72429/attachment.html>
More information about the ofw
mailing list