[ovs-dev] [PATCH v2] datapath-windows: Pause switch state on PnP event
Sairam Venugopal
vsairam at vmware.com
Mon Apr 25 21:38:18 UTC 2016
Thanks for incorporating the review comments. I noticed that V2 hasn¹t
been ACKED yet.
Acked-by: Sairam Venugopal <vsairam at vmware.com>
On 3/10/16, 5:33 AM, "Alin Serdean" <aserdean at cloudbasesolutions.com>
wrote:
>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 at cloudbasesolutions.com>
>---
>v2: Address comments
>---
> datapath-windows/ovsext/Switch.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
>diff --git a/datapath-windows/ovsext/Switch.c
>b/datapath-windows/ovsext/Switch.c
>index 77bafb4..2a19988 100644
>--- a/datapath-windows/ovsext/Switch.c
>+++ b/datapath-windows/ovsext/Switch.c
>@@ -345,14 +345,13 @@ OvsExtPause(NDIS_HANDLE filterModuleContext,
> OVS_LOG_TRACE("Enter: filterModuleContext %p",
> filterModuleContext);
>
>- ASSERT(switchContext->dataFlowState == OvsSwitchRunning);
> switchContext->dataFlowState = OvsSwitchPaused;
> KeMemoryBarrier();
> while(switchContext->pendingOidCount > 0) {
> NdisMSleep(1000);
> }
>
>- OVS_LOG_TRACE("Exit: OvsDetach Successfully");
>+ OVS_LOG_TRACE("Exit: OvsExtPause Successfully");
> return NDIS_STATUS_SUCCESS;
> }
>
>@@ -605,6 +604,11 @@ OvsExtNetPnPEvent(NDIS_HANDLE filterModuleContext,
> }
> }
>
>+ if (netPnPEvent->NetPnPEvent.NetEvent == NetEventFilterPreDetach) {
>+ switchContext->dataFlowState = OvsSwitchPaused;
>+ KeMemoryBarrier();
>+ }
>+
> status = NdisFNetPnPEvent(switchContext->NdisFilterHandle,
> netPnPEvent);
> OVS_LOG_TRACE("Exit: OvsExtNetPnPEvent");
>--
>1.9.5.msysgit.0
>_______________________________________________
>dev mailing list
>dev at openvswitch.org
>http://openvswitch.org/mailman/listinfo/dev
More information about the dev
mailing list