From a4dabb3df5d000e689915ff9f1df1d21ece0d496 Mon Sep 17 00:00:00 2001 From: Shashank Ram Date: Thu, 10 Nov 2016 16:38:05 -0800 Subject: [PATCH] datapath-windows: Fix the isActivated flag in OvsActivateSwitch Previously, the driver would enter a deadlock because the OvsInitConfiguredSwitchNics() function would wait till switchContext->isActivated flag is set. Signed-off-by: Shashank Ram Acked-by: Sairam Venugopal Signed-off-by: Gurucharan Shetty --- 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 49711a9ef..bb296fadc 100644 --- a/datapath-windows/ovsext/Switch.c +++ b/datapath-windows/ovsext/Switch.c @@ -553,6 +553,8 @@ OvsActivateSwitch(POVS_SWITCH_CONTEXT switchContext) ASSERT(!switchContext->isActivated); + switchContext->isActivated = TRUE; + OVS_LOG_TRACE("Enter: activate switch %p, dpNo: %ld", switchContext, switchContext->dpNo); @@ -571,9 +573,11 @@ OvsActivateSwitch(POVS_SWITCH_CONTEXT switchContext) goto cleanup; } - switchContext->isActivated = TRUE; - cleanup: + if (status != NDIS_STATUS_SUCCESS) { + switchContext->isActivated = FALSE; + } + OVS_LOG_TRACE("Exit: activate switch:%p, isActivated: %s, status = %lx", switchContext, (switchContext->isActivated ? "TRUE" : "FALSE"), status); -- 2.39.5