From 59a33335dcc5c750b55dbd2a7961e91a816697b7 Mon Sep 17 00:00:00 2001 From: Sorin Vinturis Date: Tue, 24 Mar 2015 14:53:11 +0000 Subject: datapath-windows: Updated WFP system provider handling If the Base Filtering Engine (BFE) is not started, the WFP system provider failed to be added because no session to the engine could be acquired. The solution for this was to registered a BFE notification callback that is called whenever the BFE's state changes. Only if the BFE's state is running the WFP system provider is added. Signed-off-by: Sorin Vinturis Reported-by: Sorin Vinturis Reported-at: https://github.com/openvswitch/ovs-issues/issues/65 Acked-by: Eitan Eliahu Signed-off-by: Ben Pfaff --- datapath-windows/ovsext/Datapath.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'datapath-windows/ovsext/Datapath.c') diff --git a/datapath-windows/ovsext/Datapath.c b/datapath-windows/ovsext/Datapath.c index 8eb13f14a..c6fe89eb7 100644 --- a/datapath-windows/ovsext/Datapath.c +++ b/datapath-windows/ovsext/Datapath.c @@ -353,35 +353,19 @@ PNDIS_SPIN_LOCK gOvsCtrlLock; VOID OvsInit() { - HANDLE handle = NULL; - gOvsCtrlLock = &ovsCtrlLockObj; NdisAllocateSpinLock(gOvsCtrlLock); OvsInitEventQueue(); - - OvsTunnelEngineOpen(&handle); - if (handle) { - OvsTunnelAddSystemProvider(handle); - } - OvsTunnelEngineClose(&handle); } VOID OvsCleanup() { - HANDLE handle = NULL; - OvsCleanupEventQueue(); if (gOvsCtrlLock) { NdisFreeSpinLock(gOvsCtrlLock); gOvsCtrlLock = NULL; } - - OvsTunnelEngineOpen(&handle); - if (handle) { - OvsTunnelRemoveSystemProvider(handle); - } - OvsTunnelEngineClose(&handle); } VOID @@ -448,6 +432,8 @@ OvsCreateDeviceObject(NDIS_HANDLE ovsExtDriverHandle) if (ovsExt) { ovsExt->numberOpenInstance = 0; } + } else { + OvsRegisterSystemProvider((PVOID)gOvsDeviceObject); } OVS_LOG_TRACE("DeviceObject: %p", gOvsDeviceObject); @@ -471,6 +457,8 @@ OvsDeleteDeviceObject() NdisDeregisterDeviceEx(gOvsDeviceHandle); gOvsDeviceHandle = NULL; gOvsDeviceObject = NULL; + + OvsUnregisterSystemProvider(); } } -- cgit v1.2.1