diff options
author | Sorin Vinturis <svinturis@cloudbasesolutions.com> | 2015-03-26 19:59:37 +0000 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2015-03-26 14:18:56 -0700 |
commit | 5b55d0abac9a20aeaf0820baf6b3954bf88efe58 (patch) | |
tree | 830784ca76c83190f2c671ace9bcadd11255f9f5 /datapath-windows/ovsext/Oid.c | |
parent | f68ddba96638e82bb1c43a2649e08c94aef3cdff (diff) | |
download | openvswitch-5b55d0abac9a20aeaf0820baf6b3954bf88efe58.tar.gz |
datapath-windows: Added specific pool tag for oid code
All memory allocations within oid code have 'ASVO' pool tag.
Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/56
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath-windows/ovsext/Oid.c')
-rw-r--r-- | datapath-windows/ovsext/Oid.c | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/datapath-windows/ovsext/Oid.c b/datapath-windows/ovsext/Oid.c index 83fa1e306..ea187906d 100644 --- a/datapath-windows/ovsext/Oid.c +++ b/datapath-windows/ovsext/Oid.c @@ -605,7 +605,7 @@ OvsIssueOidRequest(POVS_SWITCH_CONTEXT switchContext, NDIS_STATUS status; PNDIS_OID_REQUEST oidRequest; POVS_OID_CONTEXT oidContext; - ULONG OvsExtOidRequestId = 'ISVO'; + ULONG OvsExtOidRequestId = 'ISVO'; DBG_UNREFERENCED_PARAMETER(inputSize); DBG_UNREFERENCED_PARAMETER(oidInputBuffer); @@ -617,15 +617,17 @@ OvsIssueOidRequest(POVS_SWITCH_CONTEXT switchContext, ASSERT(oidOutputBuffer == NULL || outputSize != 0); ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); - oidRequest = OvsAllocateMemory(sizeof *oidRequest); + oidRequest = OvsAllocateMemoryWithTag(sizeof *oidRequest, + OVS_OID_POOL_TAG); if (!oidRequest) { status = NDIS_STATUS_RESOURCES; goto done; } - oidContext = OvsAllocateMemory(sizeof *oidContext); + oidContext = OvsAllocateMemoryWithTag(sizeof *oidContext, + OVS_OID_POOL_TAG); if (!oidContext) { - OvsFreeMemory(oidRequest); + OvsFreeMemoryWithTag(oidRequest, OVS_OID_POOL_TAG); status = NDIS_STATUS_RESOURCES; goto done; } @@ -684,8 +686,8 @@ OvsIssueOidRequest(POVS_SWITCH_CONTEXT switchContext, status = oidContext->status; ASSERT(status != NDIS_STATUS_PENDING); - OvsFreeMemory(oidRequest); - OvsFreeMemory(oidContext); + OvsFreeMemoryWithTag(oidRequest, OVS_OID_POOL_TAG); + OvsFreeMemoryWithTag(oidContext, OVS_OID_POOL_TAG); done: OVS_LOG_TRACE("Exit: status %8x.", status); @@ -710,7 +712,8 @@ OvsQuerySwitchActivationComplete(POVS_SWITCH_CONTEXT switchContext, OVS_LOG_TRACE("Enter: switchContext: %p, switchActive: %p", switchContext, switchActive); - switchParams = OvsAllocateMemory(sizeof *switchParams); + switchParams = OvsAllocateMemoryWithTag(sizeof *switchParams, + OVS_OID_POOL_TAG); if (!switchParams) { status = NDIS_STATUS_RESOURCES; goto done; @@ -741,7 +744,7 @@ OvsQuerySwitchActivationComplete(POVS_SWITCH_CONTEXT switchContext, *switchActive = switchParams->IsActive; } - OvsFreeMemory(switchParams); + OvsFreeMemoryWithTag(switchParams, OVS_OID_POOL_TAG); done: OVS_LOG_TRACE("Exit: status %8x, switchActive: %d.", @@ -769,7 +772,7 @@ OvsGetPortsOnSwitch(POVS_SWITCH_CONTEXT switchContext, do { UINT32 reqdArraySize; - portArray = OvsAllocateMemory(arraySize); + portArray = OvsAllocateMemoryWithTag(arraySize, OVS_OID_POOL_TAG); if (!portArray) { status = NDIS_STATUS_RESOURCES; goto done; @@ -794,7 +797,7 @@ OvsGetPortsOnSwitch(POVS_SWITCH_CONTEXT switchContext, break; } - OvsFreeMemory(portArray); + OvsFreeMemoryWithTag(portArray, OVS_OID_POOL_TAG); arraySize = reqdArraySize; if (status != NDIS_STATUS_INVALID_LENGTH) { break; @@ -827,7 +830,7 @@ OvsGetNicsOnSwitch(POVS_SWITCH_CONTEXT switchContext, do { UINT32 reqdArraySize; - nicArray = OvsAllocateMemory(arraySize); + nicArray = OvsAllocateMemoryWithTag(arraySize, OVS_OID_POOL_TAG); if (!nicArray) { status = NDIS_STATUS_RESOURCES; goto done; @@ -852,7 +855,7 @@ OvsGetNicsOnSwitch(POVS_SWITCH_CONTEXT switchContext, break; } - OvsFreeMemory(nicArray); + OvsFreeMemoryWithTag(nicArray, OVS_OID_POOL_TAG); arraySize = reqdArraySize; if (status != NDIS_STATUS_INVALID_LENGTH) { break; @@ -863,3 +866,17 @@ done: OVS_LOG_TRACE("Exit: status %8x.", status); return status; } + +VOID OvsFreeSwitchPortsArray(PNDIS_SWITCH_PORT_ARRAY portsArray) +{ + if (portsArray) { + OvsFreeMemoryWithTag(portsArray, OVS_OID_POOL_TAG); + } +} + +VOID OvsFreeSwitchNicsArray(PNDIS_SWITCH_NIC_ARRAY nicsArray) +{ + if (nicsArray) { + OvsFreeMemoryWithTag(nicsArray, OVS_OID_POOL_TAG); + } +} |