[ofw] [Patch][IPoIB_NIDS6_CM] Adding shutter_shut for Adapter Reset flow
Alex Naslednikov
xalex at mellanox.co.il
Wed Oct 6 04:12:39 PDT 2010
The patch below prevents race with BSOD when NDIS call receive callback of ipoib while
some ipoib global objects are under destruction (like p_adapter ->p_port).
It was tested by night regression run on IPoIB driver
---
Adding shutter_shut for Adapter Reset flow
Signed-off by: Alexander Naslednikov (xalex at mellanox.co.il)
Index: kernel/ipoib_adapter.cpp
===================================================================
--- kernel/ipoib_adapter.cpp (revision 2938)
+++ kernel/ipoib_adapter.cpp (working copy)
@@ -988,10 +988,13 @@
p_adapter->reset = TRUE;
if( p_adapter->h_pnp )
- {
+ {
+
h_pnp = p_adapter->h_pnp;
p_adapter->h_pnp = NULL;
status = p_adapter->p_ifc->dereg_pnp( h_pnp, __ipoib_pnp_dereg );
+ // Wait until NDIS will return all indicated NBLs that were received
+ shutter_shut( &p_adapter->recv_shutter );
if( status == IB_SUCCESS )
status = IB_NOT_DONE;
}
Index: kernel/ipoib_port.cpp
===================================================================
--- kernel/ipoib_port.cpp (revision 2946)
+++ kernel/ipoib_port.cpp (working copy)
@@ -830,11 +830,15 @@
IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_OBJ,
("ref type %d ref_cnt %d\n", ref_init, p_port->obj.ref_cnt) );
#endif
- // The port is started as paused and NDIS calls latter to ipoib_restart. We
- // shut the recv_shuter for now and alive it on ipoib_restart. We did
- // it in this way since MpInitializeInternal also calls in reset and than
- // we need to set the rec ref count to 1 //TODO !!!!!!!!!!1
- //
+ /* The steps of the initialization are as depicted below:
+ I. adapter_init() calls shutter_init(), the shutter counter is set to 0
+ II. ipoib_pnp_cb() calls to ipoib_port_init() that calls to __port_init() that SHOULD set shutter counter to -MAX_OPERATIONS
+ That is, the code below should call to shutter_shut()
+ III.NDIS calls to ipoib_restart() that calls to shutter_alive. Now, shutter_counter is again 0.
+ IV. NDIS call to ipoib_pause() that sets the adapter to pause state, calls to shutter_shut.
+ Now, the counter is again equals to -MAX_OPERATIONS
+ V. NDIS calls to ipoib_restart that calls to shutter_alive. Shutter counter is 0 and we can start working
+ */
if ( p_adapter->ipoib_state == IPOIB_INIT) {
IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,
Alexander (XaleX) Naslednikov
SW Networking Team
Mellanox Technologies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20101006/8c04186a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IPoIB_Shutter.patch
Type: application/octet-stream
Size: 2143 bytes
Desc: IPoIB_Shutter.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20101006/8c04186a/attachment.obj>
More information about the ofw
mailing list