diff mbox

[ovs-dev] datapath-windows: Pause switch state

Message ID 1456495704-9616-1-git-send-email-aserdean@cloudbasesolutions.com
State Changes Requested
Headers show

Commit Message

Alin Serdean Feb. 26, 2016, 2:08 p.m. UTC
A PnP(plug and play) event will be triggered before trying to disable
the extension. We could use this PnP event to prepare for detaching
the datapath.

This patch sets the switch into a paused state so no more net buffers
are queued.

Also clean some commentaries.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
---
 datapath-windows/ovsext/Switch.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c
index 77bafb4..882d587 100644
--- a/datapath-windows/ovsext/Switch.c
+++ b/datapath-windows/ovsext/Switch.c
@@ -352,7 +352,7 @@  OvsExtPause(NDIS_HANDLE filterModuleContext,
         NdisMSleep(1000);
     }
 
-    OVS_LOG_TRACE("Exit: OvsDetach Successfully");
+    OVS_LOG_TRACE("Exit: OvsExtPause Successfully");
     return NDIS_STATUS_SUCCESS;
 }
 
@@ -605,6 +605,10 @@  OvsExtNetPnPEvent(NDIS_HANDLE filterModuleContext,
         }
     }
 
+    if (netPnPEvent->NetPnPEvent.NetEvent == NetEventFilterPreDetach) {
+        switchContext->dataFlowState = OvsSwitchPaused;
+    }
+
     status = NdisFNetPnPEvent(switchContext->NdisFilterHandle,
                               netPnPEvent);
     OVS_LOG_TRACE("Exit: OvsExtNetPnPEvent");