diff mbox series

[ovs-dev] datapath-windows: On Debug builds, dump NBL info based on OVS_DBG_DEFAULT macro

Message ID 20180227043435.2320-1-kumaranand@vmware.com
State Changes Requested
Headers show
Series [ovs-dev] datapath-windows: On Debug builds, dump NBL info based on OVS_DBG_DEFAULT macro | expand

Commit Message

Anand Kumar Feb. 27, 2018, 4:34 a.m. UTC
Currently nbl information is getting dumped whenever a nbl is copied or
allocated, since OVS_DBG_DEFAULT is set to OVS_DBG_INFO for debug builds,
which affects the ovs performance. Instead dump nbl information only when
OVS_DBG_DEFAULT is set to OVS_LOG_LOUD

Signed-off-by: Anand Kumar <kumaranand@vmware.com>
---
 datapath-windows/ovsext/BufferMgmt.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/datapath-windows/ovsext/BufferMgmt.c b/datapath-windows/ovsext/BufferMgmt.c
index 03470d7..d51dafd 100644
--- a/datapath-windows/ovsext/BufferMgmt.c
+++ b/datapath-windows/ovsext/BufferMgmt.c
@@ -412,9 +412,11 @@  OvsAllocateFixSizeNBL(PVOID ovsContext,
 
 #ifdef DBG
     InterlockedIncrement((LONG volatile *)&ovsPool->fixNBLCount);
+#if OVS_DBG_DEFAULT >= OVS_DBG_LOUD
     OvsDumpNetBufferList(nbl);
     OvsDumpForwardingDetails(nbl);
 #endif
+#endif
 
     ctx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl);
     ASSERT(ctx);
@@ -525,9 +527,11 @@  OvsAllocateVariableSizeNBL(PVOID ovsContext,
 
 #ifdef DBG
     InterlockedIncrement((LONG volatile *)&ovsPool->zeroNBLCount);
+#if OVS_DBG_DEFAULT >= OVS_DBG_LOUD
     OvsDumpNetBufferList(nbl);
     OvsDumpForwardingDetails(nbl);
 #endif
+#endif
 
     ctx = (POVS_BUFFER_CONTEXT)NET_BUFFER_LIST_CONTEXT_DATA_START(nbl);
 
@@ -574,7 +578,9 @@  OvsInitExternalNBLContext(PVOID ovsContext,
         return NULL;
     }
 #ifdef DBG
+#if OVS_DBG_DEFAULT >= OVS_DBG_LOUD
     OvsDumpNBLContext(nbl);
+#endif
     InterlockedIncrement((LONG volatile *)&context->ovsPool.sysNBLCount);
 #endif
     flags = isRecv ? OVS_BUFFER_RECV_BUFFER : OVS_BUFFER_SEND_BUFFER;
@@ -809,12 +815,14 @@  OvsPartialCopyNBL(PVOID ovsContext,
     InterlockedIncrement((LONG volatile *)&srcCtx->refCount);
 
 #ifdef DBG
+#if OVS_DBG_DEFAULT >= OVS_DBG_LOUD
     OvsDumpNetBufferList(nbl);
     OvsDumpForwardingDetails(nbl);
 
     OvsDumpNetBufferList(newNbl);
     OvsDumpForwardingDetails(newNbl);
 #endif
+#endif
 
     OVS_LOG_LOUD("Partial Copy new NBL: %p", newNbl);
     return newNbl;
@@ -942,9 +950,11 @@  OvsCopySinglePacketNBL(PVOID ovsContext,
     dstCtx->flags |= srcCtx->flags & (OVS_BUFFER_RECV_BUFFER |
                                       OVS_BUFFER_SEND_BUFFER);
 #ifdef DBG
+#if OVS_DBG_DEFAULT >= OVS_DBG_LOUD
     OvsDumpNetBufferList(newNbl);
     OvsDumpForwardingDetails(newNbl);
 #endif
+#endif
     OVS_LOG_LOUD("Copy single nb to new NBL: %p", newNbl);
     return newNbl;
 }
@@ -1064,8 +1074,10 @@  OvsFullCopyNBL(PVOID ovsContext,
                       OVS_DPPORT_NUMBER_INVALID);
 
 #ifdef DBG
+#if OVS_DBG_DEFAULT >= OVS_DBG_LOUD
     OvsDumpNetBufferList(nbl);
     OvsDumpForwardingDetails(nbl);
+#endif
     InterlockedIncrement((LONG volatile *)&ovsPool->nblOnlyCount);
 #endif
     OVS_LOG_LOUD("newNbl: %p", newNbl);
@@ -1466,13 +1478,14 @@  OvsFragmentNBL(PVOID ovsContext,
     InterlockedIncrement((LONG volatile *)&srcCtx->refCount);
 #ifdef DBG
     InterlockedIncrement((LONG volatile *)&ovsPool->fragNBLCount);
-
+#if OVS_DBG_DEFAULT >= OVS_DBG_LOUD
     OvsDumpNetBufferList(nbl);
     OvsDumpForwardingDetails(nbl);
 
     OvsDumpNetBufferList(newNbl);
     OvsDumpForwardingDetails(newNbl);
 #endif
+#endif
     OVS_LOG_TRACE("Fragment nbl %p to newNbl: %p", nbl, newNbl);
     return newNbl;