> -----Original Message-----
> From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Remy Horton
> Sent: Monday, January 16, 2017 4:20 PM
> To: dev@dpdk.org
> Cc: Pattan, Reshma <reshma.pat...@intel.com>; Thomas Monjalon 
> <thomas.monja...@6wind.com>
> Subject: [dpdk-dev] [PATCH v7 6/6] app/test-pmd: add latency statistics 
> calculation
> 
> From: Reshma Pattan <reshma.pat...@intel.com>
> 
> Modify testpmd code to initialize/uninitialize latency statistics
> calulation.
> 
> Signed-off-by: Reshma Pattan <reshma.pat...@intel.com>
> Signed-off-by: Remy Horton <remy.hor...@intel.com>

Comment inline.

> ---
>  app/test-pmd/testpmd.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index a0b7430..2874ce4 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -83,6 +83,10 @@
>  #ifdef RTE_LIBRTE_BITRATE
>  #include <rte_bitrate.h>
>  #endif
> +#include <rte_metrics.h>
> +#ifdef RTE_LIBRTE_LATENCY_STATS
> +#include <rte_latencystats.h>
> +#endif
> 
>  #include "testpmd.h"
> 
> @@ -2108,6 +2112,9 @@ signal_handler(int signum)
>               /* uninitialize packet capture framework */
>               rte_pdump_uninit();
>  #endif
> +#ifdef RTE_LIBRTE_LATENCY_STATS
> +             rte_latencystats_uninit();
> +#endif
>               force_quit();
>               /* exit with the expected status */
>               signal(signum, SIG_DFL);
> @@ -2165,6 +2172,9 @@ main(int argc, char** argv)
>       /* set all ports to promiscuous mode by default */
>       FOREACH_PORT(port_id, ports)
>               rte_eth_promiscuous_enable(port_id);
> +#ifdef RTE_LIBRTE_LATENCY_STATS
> +     rte_latencystats_init(1, NULL);
> +#endif

The 1 here represents reporting time in ns correct? 1 ns seems a very short 
amount of time.
Perhaps clarify (here or in the header) what exactly this number does, or set 
it to 0 for "as fast as possible"?

> 
>       /* Setup bitrate stats */
>  #ifdef RTE_LIBRTE_BITRATE
> --
> 2.5.5

Reply via email to