]> git.proxmox.com Git - ovs.git/commitdiff
datapath-windows: Fix CtrlLock acquire issue in OvsReadEventCmdHandler
authorAnkur Sharma <ankursharma@vmware.com>
Tue, 14 Oct 2014 17:16:00 +0000 (10:16 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 14 Oct 2014 19:44:21 +0000 (12:44 -0700)
OvsReadEventCmdHandler was calling OvsRemoveEventEntry after acquiring
CtrlLock. OvsRemoveEventEntry in turn also tries to acquire the same lock.

Added a new lock in Event.c for the eventQueue.

Signed-off-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows/ovsext/Event.c

index 467771de332ab35bec751e9f99bb9d9d91efd3ba..d80f3fd0e7551e0826ea64bfe5be514fcbe3f482 100644 (file)
 #include "Debug.h"
 
 LIST_ENTRY ovsEventQueue;
+static NDIS_SPIN_LOCK eventQueueLock;
 UINT32 ovsNumEventQueue;
 UINT32 ovsNumPollAll;
 
-extern PNDIS_SPIN_LOCK gOvsCtrlLock;
-
 NTSTATUS
 OvsInitEventQueue()
 {
     InitializeListHead(&ovsEventQueue);
+    NdisAllocateSpinLock(&eventQueueLock);
     return STATUS_SUCCESS;
 }
 
@@ -45,18 +45,19 @@ OvsCleanupEventQueue()
 {
     ASSERT(IsListEmpty(&ovsEventQueue));
     ASSERT(ovsNumEventQueue == 0);
+    NdisFreeSpinLock(&eventQueueLock);
 }
 
 static __inline VOID
 OvsAcquireEventQueueLock()
 {
-    NdisAcquireSpinLock(gOvsCtrlLock);
+    NdisAcquireSpinLock(&eventQueueLock);
 }
 
 static __inline VOID
 OvsReleaseEventQueueLock()
 {
-   NdisReleaseSpinLock(gOvsCtrlLock);
+   NdisReleaseSpinLock(&eventQueueLock);
 }
 
 /*