Message ID | 20180228045940.7244-1-kumaranand@vmware.com |
---|---|
State | Accepted |
Headers | show |
Series | [ovs-dev,v2] datapath-windows: On Debug builds, dump NBL info based on OVS_DBG_DEFAULT macro | expand |
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org> -----Mesaj original----- De la: ovs-dev-bounces@openvswitch.org [mailto:ovs-dev-bounces@openvswitch.org] În numele Anand Kumar Trimis: Wednesday, February 28, 2018 7:00 AM Către: dev@openvswitch.org Subiect: [ovs-dev] [PATCH v2] datapath-windows: On Debug builds, dump NBL info based on OVS_DBG_DEFAULT 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> --- datapath-windows/ovsext/BufferMgmt.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
Thanks for the patch Anand.
I applied it on master.
Alin.
-----Mesaj original-----
De la: ovs-dev-bounces@openvswitch.org
[mailto:ovs-dev-bounces@openvswitch.org] În numele Anand Kumar
Trimis: Wednesday, February 28, 2018 7:00 AM
Către: dev@openvswitch.org
Subiect: [ovs-dev] [PATCH v2] datapath-windows: On Debug builds, dump NBL
info based on OVS_DBG_DEFAULT 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>
diff --git a/datapath-windows/ovsext/BufferMgmt.c b/datapath-windows/ovsext/BufferMgmt.c index 03470d7..448cd76 100644 --- a/datapath-windows/ovsext/BufferMgmt.c +++ b/datapath-windows/ovsext/BufferMgmt.c @@ -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) { @@ -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"); @@ -300,6 +304,9 @@ OvsDumpNBLContext(PNET_BUFFER_LIST nbl) nbl, ctx, ctx->Size, ctx->Offset); ctx = ctx->Next; } +#else + UNREFERENCED_PARAMETER(nbl); +#endif } @@ -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", @@ -349,6 +357,9 @@ OvsDumpNetBufferList(PNET_BUFFER_LIST nbl) OvsDumpNetBuffer(nb); nb = NET_BUFFER_NEXT_NB(nb); } +#else + UNREFERENCED_PARAMETER(nbl); +#endif } /*
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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)