Applied at 3000 ! From: Smith, Stan [mailto:[email protected]] Sent: Thursday, November 18, 2010 7:57 PM To: Alex Naslednikov; [email protected] Subject: RE: [ofw] [Patch][IPoIB_NDIS6_CM] Reset flow wrong assertion
Looks reasonable. ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of Alex Naslednikov Sent: Wednesday, November 17, 2010 5:57 AM To: [email protected] Subject: [ofw] [Patch][IPoIB_NDIS6_CM] Reset flow wrong assertion 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
_______________________________________________ ofw mailing list [email protected] http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
