[dpdk-dev,v2] app/testpmd: disable latency stats by default

Message ID 1493915328-130956-1-git-send-email-pablo.de.lara.guarch@intel.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply patch file failure

Commit Message

De Lara Guarch, Pablo May 4, 2017, 4:28 p.m. UTC
  Disable latency stats gathering by default,
so there is not performance degradation if user
is not interested in them.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---

This patch depends on http://dpdk.org/dev/patchwork/patch/24064/

 app/test-pmd/testpmd.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
  

Comments

Jingjing Wu May 6, 2017, 1:10 a.m. UTC | #1
> -----Original Message-----
> From: De Lara Guarch, Pablo
> Sent: Friday, May 5, 2017 12:29 AM
> To: Wu, Jingjing <jingjing.wu@intel.com>; Pattan, Reshma
> <reshma.pattan@intel.com>
> Cc: dev@dpdk.org; De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Subject: [PATCH v2] app/testpmd: disable latency stats by default
> 
> Disable latency stats gathering by default, so there is not performance
> degradation if user is not interested in them.
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
  
Thomas Monjalon May 6, 2017, 7:38 a.m. UTC | #2
06/05/2017 03:10, Wu, Jingjing:
> 
> From: De Lara Guarch, Pablo
> > 
> > Disable latency stats gathering by default, so there is not performance
> > degradation if user is not interested in them.
> > 
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> Acked-by: Jingjing Wu <jingjing.wu@intel.com>

Applied, thanks
  

Patch

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 776b8dd..0a4f15d 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -971,7 +971,8 @@  run_pkt_fwd_on_lcore(struct fwd_lcore *fc, packet_fwd_t pkt_fwd)
 		}
 #endif
 #ifdef RTE_LIBRTE_LATENCY_STATS
-		if (latencystats_lcore_id == rte_lcore_id())
+		if (latencystats_enabled != 0 &&
+				latencystats_lcore_id == rte_lcore_id())
 			rte_latencystats_update();
 #endif
 
@@ -2238,10 +2239,13 @@  main(int argc, char** argv)
 		rte_panic("Empty set of forwarding logical cores - check the "
 			  "core mask supplied in the command parameters\n");
 
-	/* Bitrate stats disabled by default */
+	/* Bitrate/latency stats disabled by default */
 #ifdef RTE_LIBRTE_BITRATE
 	bitrate_enabled = 0;
 #endif
+#ifdef RTE_LIBRTE_LATENCY_STATS
+	latencystats_enabled = 0;
+#endif
 
 	argc -= diag;
 	argv += diag;