summaryrefslogtreecommitdiff
path: root/datapath-windows/ovsext/Switch.c
diff options
context:
space:
mode:
authorNithin Raju <nithin@vmware.com>2015-11-25 12:00:53 -0800
committerGurucharan Shetty <gshetty@nicira.com>2015-11-25 13:54:21 -0800
commit13165df937f24b91fc5b3c31be2f7b424eb12104 (patch)
treec7cc1d904cdfa705b27e9b2599b3c38c02f58364 /datapath-windows/ovsext/Switch.c
parent96cabc29d29dfe4cc84385ce41f6828d9eba4fd4 (diff)
downloadopenvswitch-13165df937f24b91fc5b3c31be2f7b424eb12104.tar.gz
datapath-windows: refactor port enumeration code
We already have functions HvCreatePort() and HvCreateNic() to do the work. Might as well use that during port enumeration. More refactoring in later patches. Signed-off-by: Nithin Raju <nithin@vmware.com> Acked-by: Sairam Venugopal <vsairam@vmware.com> Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Diffstat (limited to 'datapath-windows/ovsext/Switch.c')
-rw-r--r--datapath-windows/ovsext/Switch.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c
index 2878e9192..a783ea19f 100644
--- a/datapath-windows/ovsext/Switch.c
+++ b/datapath-windows/ovsext/Switch.c
@@ -549,6 +549,7 @@ OvsActivateSwitch(POVS_SWITCH_CONTEXT switchContext)
OVS_LOG_TRACE("Enter: activate switch %p, dpNo: %ld",
switchContext, switchContext->dpNo);
+ switchContext->isActivated = TRUE;
status = OvsAddConfiguredSwitchPorts(switchContext);
if (status != NDIS_STATUS_SUCCESS) {
@@ -563,10 +564,13 @@ OvsActivateSwitch(POVS_SWITCH_CONTEXT switchContext)
OvsClearAllSwitchVports(switchContext);
goto cleanup;
}
- switchContext->isActivated = TRUE;
OvsPostEvent(OVS_DEFAULT_PORT_NO, OVS_DEFAULT_EVENT_STATUS);
cleanup:
+ if (status != NDIS_STATUS_SUCCESS) {
+ switchContext->isActivated = TRUE;
+ }
+
OVS_LOG_TRACE("Exit: activate switch:%p, isActivated: %s, status = %lx",
switchContext,
(switchContext->isActivated ? "TRUE" : "FALSE"), status);