[ofw] [Patch][IPoIB_NDIS6_CM] Reset flow wrong assertion

Alex Naslednikov xalex at mellanox.co.il
Wed Nov 17 05:57:27 PST 2010


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 possibilites:
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

Signed-off by: Alexander Naslednikov (xalex at mellanox.co.il)
Index: ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp
===================================================================
--- ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp         (revision 2987)
+++ ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp      (working copy)
@@ -1138,12 +1138,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);
                                                IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,
                                                                ("__ipoib_pnp_reg returned %s\n",
                                                                p_adapter->p_ifc->get_err_str( status )) );
@@ -1152,6 +1153,7 @@
                }
                else
                {
+                             ASSERT(p_adapter->reset == TRUE);
                                __ipoib_complete_reset( p_adapter, NDIS_STATUS_SUCCESS );
                                status = IB_SUCCESS;
                }

Alexander (XaleX) Naslednikov
SW Networking Team
Mellanox Technologies

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20101117/e844ba8e/attachment.html>


More information about the ofw mailing list