datapath-windows: Support for allocating/releasing memory with tag
authorSorin Vinturis <svinturis@cloudbasesolutions.com>
Thu, 26 Mar 2015 19:59:36 +0000 (19:59 +0000)
committerBen Pfaff <blp@nicira.com>
Thu, 26 Mar 2015 21:17:59 +0000 (14:17 -0700)
Added functions for allocating and releasing memory with specified
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>
datapath-windows/ovsext/Util.c
datapath-windows/ovsext/Util.h

index 2dfba8e..65dd132 100644 (file)
 
 extern NDIS_HANDLE gOvsExtDriverHandle;
 
+VOID*
+OvsAllocateMemoryWithTag(size_t size, ULONG tag)
+{
+    OVS_VERIFY_IRQL_LE(DISPATCH_LEVEL);
+    return NdisAllocateMemoryWithTagPriority(gOvsExtDriverHandle,
+        (UINT32)size, tag, NormalPoolPriority);
+}
+
+VOID
+OvsFreeMemoryWithTag(VOID *ptr, ULONG tag)
+{
+    ASSERT(ptr);
+    NdisFreeMemoryWithTagPriority(gOvsExtDriverHandle, ptr, tag);
+}
+
 VOID *
 OvsAllocateMemory(size_t size)
 {
index e752209..0303f46 100644 (file)
 #define OVS_OTHER_POOL_TAG              'MSVO'
 
 VOID *OvsAllocateMemory(size_t size);
+VOID *OvsAllocateMemoryWithTag(size_t size, ULONG tag);
 VOID *OvsAllocateAlignedMemory(size_t size, UINT16 align);
 VOID OvsFreeMemory(VOID *ptr);
+VOID OvsFreeMemoryWithTag(VOID *ptr, ULONG tag);
 VOID OvsFreeAlignedMemory(VOID *ptr);
 
 #define LIST_FORALL(_headPtr, _itemPtr) \