diff options
author | Sorin Vinturis <svinturis@cloudbasesolutions.com> | 2015-04-23 20:27:53 +0000 |
---|---|---|
committer | Gurucharan Shetty <gshetty@nicira.com> | 2015-04-23 14:49:33 -0700 |
commit | 3ed424e5e5d614e08a58ffe700bbe88ed0514a7b (patch) | |
tree | 6a064375ebbe3686970f6b77a77d2cf4a0fffea4 /datapath-windows/ovsext/User.c | |
parent | dd92c6165ddb53922562c43fdcc8845dc4bb435a (diff) | |
download | openvswitch-3ed424e5e5d614e08a58ffe700bbe88ed0514a7b.tar.gz |
datapath-windows: Removed gOvsCtrlLock global spinlock
There is no need to use gOvsCtrlLock spinlock to guard the switch
context, as there is now the switch context's reference count used
for this purpose.
Now the gOvsCtrlLock spinlock guards only one shared resource, the
OVS_OPEN_INSTANCE global instance array.
Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Diffstat (limited to 'datapath-windows/ovsext/User.c')
-rw-r--r-- | datapath-windows/ovsext/User.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c index 03f0377d9..53c41f434 100644 --- a/datapath-windows/ovsext/User.c +++ b/datapath-windows/ovsext/User.c @@ -142,14 +142,12 @@ OvsCleanupPacketQueue(POVS_OPEN_INSTANCE instance) } /* Verify if gOvsSwitchContext exists. */ - OvsAcquireCtrlLock(); if (gOvsSwitchContext) { /* Remove the instance from pidHashArray */ OvsAcquirePidHashLock(); OvsDelPidInstance(gOvsSwitchContext, instance->pid); OvsReleasePidHashLock(); } - OvsReleaseCtrlLock(); } NTSTATUS @@ -447,11 +445,9 @@ OvsExecuteDpIoctl(OvsPacketExecute *execute) OVS_PACKET_HDR_INFO layers; POVS_VPORT_ENTRY vport; - NdisAcquireSpinLock(gOvsCtrlLock); - if (execute->packetLen == 0) { status = STATUS_INVALID_PARAMETER; - goto unlock; + goto exit; } actions = execute->actions; @@ -466,7 +462,7 @@ OvsExecuteDpIoctl(OvsPacketExecute *execute) execute->packetLen); if (pNbl == NULL) { status = STATUS_NO_MEMORY; - goto unlock; + goto exit; } fwdDetail = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(pNbl); @@ -481,11 +477,9 @@ OvsExecuteDpIoctl(OvsPacketExecute *execute) // XXX: Figure out if any of the other members of fwdDetail need to be set. ndisStatus = OvsExtractFlow(pNbl, fwdDetail->SourcePortId, &key, &layers, - NULL); + NULL); if (ndisStatus == NDIS_STATUS_SUCCESS) { - ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL); - NdisAcquireRWLockRead(gOvsSwitchContext->dispatchLock, &lockState, - NDIS_RWL_AT_DISPATCH_LEVEL); + NdisAcquireRWLockRead(gOvsSwitchContext->dispatchLock, &lockState, 0); ndisStatus = OvsActionsExecute(gOvsSwitchContext, NULL, pNbl, vport ? vport->portNo : OVS_DEFAULT_PORT_NO, @@ -506,8 +500,7 @@ OvsExecuteDpIoctl(OvsPacketExecute *execute) if (pNbl) { OvsCompleteNBL(gOvsSwitchContext, pNbl, TRUE); } -unlock: - NdisReleaseSpinLock(gOvsCtrlLock); +exit: return status; } @@ -630,7 +623,6 @@ OvsGetNextPacket(POVS_OPEN_INSTANCE instance) /* * --------------------------------------------------------------------------- * Given a pid, returns the corresponding USER_PACKET_QUEUE. - * gOvsCtrlLock must be acquired before calling this API. * --------------------------------------------------------------------------- */ POVS_USER_PACKET_QUEUE |