[ovs-dev] [PATCH 03/11] datapath-windows: Added specific pool tag for buffermgmt code

Alin Serdean aserdean at cloudbasesolutions.com
Thu Mar 26 15:52:58 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 03/11] datapath-windows: Added specific pool tag for buffermgmt code

All MDL memory allocations within buffermgmt code have 'BSVO' pool 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/BufferMgmt.c | 6 +++---
 datapath-windows/ovsext/Util.h       | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/datapath-windows/ovsext/BufferMgmt.c b/datapath-windows/ovsext/BufferMgmt.c
index e0377c1..572b298 100644
--- a/datapath-windows/ovsext/BufferMgmt.c
+++ b/datapath-windows/ovsext/BufferMgmt.c
@@ -433,14 +433,14 @@ OvsAllocateMDLAndData(NDIS_HANDLE ndisHandle,
     PMDL mdl;
     PVOID data;
 
-    data = OvsAllocateMemory(dataSize);
+    data = OvsAllocateMemoryWithTag(dataSize, OVS_MDL_POOL_TAG);
     if (data == NULL) {
         return NULL;
     }
 
     mdl = NdisAllocateMdl(ndisHandle, data, dataSize);
     if (mdl == NULL) {
-        OvsFreeMemory(data);
+        OvsFreeMemoryWithTag(data, OVS_MDL_POOL_TAG);
     }
 
     return mdl;
@@ -454,7 +454,7 @@ OvsFreeMDLAndData(PMDL mdl)
 
     data = MmGetMdlVirtualAddress(mdl);
     NdisFreeMdl(mdl);
-    OvsFreeMemory(data);
+    OvsFreeMemoryWithTag(data, OVS_MDL_POOL_TAG);
 }
 
 
diff --git a/datapath-windows/ovsext/Util.h b/datapath-windows/ovsext/Util.h index 0f32654..6a9c169 100644
--- a/datapath-windows/ovsext/Util.h
+++ b/datapath-windows/ovsext/Util.h
@@ -23,6 +23,7 @@
 #define OVS_NBL_ONLY_POOL_TAG           'OSVO'
 #define OVS_NET_BUFFER_POOL_TAG         'NSVO'
 #define OVS_OTHER_POOL_TAG              'MSVO'
+#define OVS_MDL_POOL_TAG                'BSVO'
 #define OVS_DATAPATH_POOL_TAG           'DSVO'
 
 VOID *OvsAllocateMemory(size_t size);
--
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