[ovs-dev] [PATCH 01/11] datapath-windows: Support for allocating/releasing memory with tag
Alin Serdean
aserdean at cloudbasesolutions.com
Thu Mar 26 15:53:06 UTC 2015
Acked-by: Alin Gabriel Serdean <aserdean at cloudbasesolutions.com>
-----Mesaj original-----
De la: dev [mailto:dev-bounces at openvswitch.org] În numele Sorin Vinturis
Trimis: Wednesday, March 25, 2015 10:14 PM
Către: dev at openvswitch.org
Subiect: [ovs-dev] [PATCH 01/11] datapath-windows: Support for allocating/releasing memory with tag
Added functions for allocating and releasing memory with specified tag.
Signed-off-by: Sorin Vinturis <svinturis at cloudbasesolutions.com>
Reported-by: Alin Gabriel Serdean <aserdean at cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/56
---
datapath-windows/ovsext/Util.c | 15 +++++++++++++++ datapath-windows/ovsext/Util.h | 2 ++
2 files changed, 17 insertions(+)
diff --git a/datapath-windows/ovsext/Util.c b/datapath-windows/ovsext/Util.c index 2dfba8e..65dd132 100644
--- a/datapath-windows/ovsext/Util.c
+++ b/datapath-windows/ovsext/Util.c
@@ -24,6 +24,21 @@
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)
{
diff --git a/datapath-windows/ovsext/Util.h b/datapath-windows/ovsext/Util.h index e752209..0303f46 100644
--- a/datapath-windows/ovsext/Util.h
+++ b/datapath-windows/ovsext/Util.h
@@ -25,8 +25,10 @@
#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) \
--
1.9.0.msysgit.0
_______________________________________________
dev mailing list
dev at openvswitch.org
http://openvswitch.org/mailman/listinfo/dev
More information about the dev
mailing list