[dpdk-dev] [PATCH v7 6/6] app/test-pmd: add latency statistics calculation
Van Haaren, Harry
harry.van.haaren at intel.com
Tue Jan 17 12:45:20 CET 2017
> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Remy Horton
> Sent: Monday, January 16, 2017 4:20 PM
> To: dev at dpdk.org
> Cc: Pattan, Reshma <reshma.pattan at intel.com>; Thomas Monjalon <thomas.monjalon at 6wind.com>
> Subject: [dpdk-dev] [PATCH v7 6/6] app/test-pmd: add latency statistics calculation
>
> From: Reshma Pattan <reshma.pattan at intel.com>
>
> Modify testpmd code to initialize/uninitialize latency statistics
> calulation.
>
> Signed-off-by: Reshma Pattan <reshma.pattan at intel.com>
> Signed-off-by: Remy Horton <remy.horton at 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
More information about the dev
mailing list