Skip to content

Commit

Permalink
datapath-windows: On Debug builds, dump NBL info based on OVS_DBG_DEF…
Browse files Browse the repository at this point in the history
…AULT macro

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>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
  • Loading branch information
Anandkumar26 authored and aserdean committed Mar 1, 2018
1 parent d9cea8f commit 34825d5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion datapath-windows/ovsext/BufferMgmt.c
Expand Up @@ -273,6 +273,7 @@ OvsInitNBLContext(POVS_BUFFER_CONTEXT ctx,
static VOID
OvsDumpForwardingDetails(PNET_BUFFER_LIST nbl)
{
#if OVS_DBG_DEFAULT >= OVS_DBG_LOUD
PNDIS_SWITCH_FORWARDING_DETAIL_NET_BUFFER_LIST_INFO info;
info = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(nbl);
if (info == NULL) {
Expand All @@ -284,12 +285,15 @@ OvsDumpForwardingDetails(PNET_BUFFER_LIST nbl)
info->SourceNicIndex,
info->IsPacketDataSafe ? "TRUE" : "FALSE",
info->IsPacketDataSafe ? 0 : info->SafePacketDataSize);

#else
UNREFERENCED_PARAMETER(nbl);
#endif
}

static VOID
OvsDumpNBLContext(PNET_BUFFER_LIST nbl)
{
#if OVS_DBG_DEFAULT >= OVS_DBG_LOUD
PNET_BUFFER_LIST_CONTEXT ctx = nbl->Context;
if (ctx == NULL) {
OVS_LOG_INFO("No Net Buffer List context");
Expand All @@ -300,6 +304,9 @@ OvsDumpNBLContext(PNET_BUFFER_LIST nbl)
nbl, ctx, ctx->Size, ctx->Offset);
ctx = ctx->Next;
}
#else
UNREFERENCED_PARAMETER(nbl);
#endif
}


Expand Down Expand Up @@ -337,6 +344,7 @@ OvsDumpNetBuffer(PNET_BUFFER nb)
static VOID
OvsDumpNetBufferList(PNET_BUFFER_LIST nbl)
{
#if OVS_DBG_DEFAULT >= OVS_DBG_LOUD
PNET_BUFFER nb;
OVS_LOG_INFO("NBL: %p, parent: %p, SrcHandle: %p, ChildCount:%d "
"poolHandle: %p",
Expand All @@ -349,6 +357,9 @@ OvsDumpNetBufferList(PNET_BUFFER_LIST nbl)
OvsDumpNetBuffer(nb);
nb = NET_BUFFER_NEXT_NB(nb);
}
#else
UNREFERENCED_PARAMETER(nbl);
#endif
}

/*
Expand Down

0 comments on commit 34825d5

Please sign in to comment.