diff options
author | Nithin Raju <nithin@vmware.com> | 2015-04-22 17:10:10 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2015-04-23 11:01:38 -0700 |
commit | e1e29b268c77c862f2827beeb4f319396dc66ef2 (patch) | |
tree | b8a41b91ef48d32cae2a1ba9de5f17b87f6cfc74 /datapath-windows/ovsext/Switch.c | |
parent | 83e09b5dfa35b95e9995713bdfcb9a27f9b4ed7f (diff) | |
download | openvswitch-e1e29b268c77c862f2827beeb4f319396dc66ef2.tar.gz |
datapath-windows: don't free switch cxt until ref == 0
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>
Diffstat (limited to 'datapath-windows/ovsext/Switch.c')
-rw-r--r-- | datapath-windows/ovsext/Switch.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/datapath-windows/ovsext/Switch.c b/datapath-windows/ovsext/Switch.c index 11092dec1..9e1e9a4c0 100644 --- a/datapath-windows/ovsext/Switch.c +++ b/datapath-windows/ovsext/Switch.c @@ -211,7 +211,6 @@ OvsCreateSwitch(NDIS_HANDLE ndisFilterHandle, status = OvsTunnelFilterInitialize(gOvsExtDriverObject); if (status != NDIS_STATUS_SUCCESS) { OvsUninitSwitchContext(switchContext); - OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG); goto create_switch_done; } *switchContextOut = switchContext; @@ -270,7 +269,6 @@ OvsDeleteSwitch(POVS_SWITCH_CONTEXT switchContext) OvsTunnelFilterUninitialize(gOvsExtDriverObject); OvsClearAllSwitchVports(switchContext); OvsUninitSwitchContext(switchContext); - OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG); } OVS_LOG_TRACE("Exit: deleted switch %p dpNo: %d", switchContext, dpNo); } @@ -441,7 +439,12 @@ OvsUninitSwitchContext(POVS_SWITCH_CONTEXT switchContext) OvsReleaseSwitchContext(switchContext); } -VOID +/* + * -------------------------------------------------------------------------- + * 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); @@ -467,6 +470,8 @@ OvsDeleteSwitchContext(POVS_SWITCH_CONTEXT switchContext) switchContext->pidHashArray = NULL; OvsDeleteFlowTable(&switchContext->datapath); OvsCleanupBufferPool(switchContext); + + OvsFreeMemoryWithTag(switchContext, OVS_SWITCH_POOL_TAG); OVS_LOG_TRACE("Exit: Delete switchContext: %p", switchContext); } |