This is a hard to hit corner case, because currently we recommend that
all handles to the kernel datapath be closed before trying to unload the
OVS extension.
Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
status = OvsTunnelFilterInitialize(gOvsExtDriverObject);
if (status != NDIS_STATUS_SUCCESS) {
OvsUninitSwitchContext(switchContext);
status = OvsTunnelFilterInitialize(gOvsExtDriverObject);
if (status != NDIS_STATUS_SUCCESS) {
OvsUninitSwitchContext(switchContext);
- OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG);
goto create_switch_done;
}
*switchContextOut = switchContext;
goto create_switch_done;
}
*switchContextOut = switchContext;
OvsTunnelFilterUninitialize(gOvsExtDriverObject);
OvsClearAllSwitchVports(switchContext);
OvsUninitSwitchContext(switchContext);
OvsTunnelFilterUninitialize(gOvsExtDriverObject);
OvsClearAllSwitchVports(switchContext);
OvsUninitSwitchContext(switchContext);
- OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG);
}
OVS_LOG_TRACE("Exit: deleted switch %p dpNo: %d", switchContext, dpNo);
}
}
OVS_LOG_TRACE("Exit: deleted switch %p dpNo: %d", switchContext, dpNo);
}
OvsReleaseSwitchContext(switchContext);
}
OvsReleaseSwitchContext(switchContext);
}
+/*
+ * --------------------------------------------------------------------------
+ * Frees up the contents of and also the switch context.
+ * --------------------------------------------------------------------------
+ */
+static VOID
OvsDeleteSwitchContext(POVS_SWITCH_CONTEXT switchContext)
{
OVS_LOG_TRACE("Enter: Delete switchContext:%p", switchContext);
OvsDeleteSwitchContext(POVS_SWITCH_CONTEXT switchContext)
{
OVS_LOG_TRACE("Enter: Delete switchContext:%p", switchContext);
switchContext->pidHashArray = NULL;
OvsDeleteFlowTable(&switchContext->datapath);
OvsCleanupBufferPool(switchContext);
switchContext->pidHashArray = NULL;
OvsDeleteFlowTable(&switchContext->datapath);
OvsCleanupBufferPool(switchContext);
+
+ OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG);
OVS_LOG_TRACE("Exit: Delete switchContext: %p", switchContext);
}
OVS_LOG_TRACE("Exit: Delete switchContext: %p", switchContext);
}