[dpdk-dev] [PATCH v1] app/testpmd: add bitrate stats option

Wu, Jingjing jingjing.wu at intel.com
Fri Apr 28 10:21:23 CEST 2017



> -----Original Message-----
> From: Horton, Remy
> Sent: Wednesday, April 26, 2017 9:03 PM
> To: dev at dpdk.org
> Cc: Wu, Jingjing <jingjing.wu at intel.com>
> Subject: [PATCH v1] app/testpmd: add bitrate stats option
> 
> Bit-rate collation should only be done by one core. This patch adds an option to
> select which core performs the bit-rate calculation, which is also disabled by
> default.
> 
> Fixes: 7e4441c8efb9 ("app/testpmd: add bitrate statistics calculation")
> 
> Signed-off-by: Remy Horton <remy.horton at intel.com>
> ---
>  app/test-pmd/parameters.c | 15 +++++++++++++++
>  app/test-pmd/testpmd.c    | 36 ++++++++++++++++++++++++++----------
>  app/test-pmd/testpmd.h    |  5 +++++
>  3 files changed, 46 insertions(+), 10 deletions(-)
> 
> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index
> 3f4d3a2..a6140b5 100644
> --- a/app/test-pmd/parameters.c
> +++ b/app/test-pmd/parameters.c
> @@ -536,6 +536,9 @@ launch_args_parse(int argc, char** argv)  #ifdef
> RTE_LIBRTE_LATENCY_STATS
>  		{ "latencystats",               1, 0, 0 },
>  #endif
> +#ifdef RTE_LIBRTE_BITRATE
> +		{ "bitratestats",               1, 0, 0 },
> +#endif
>  		{ "disable-crc-strip",          0, 0, 0 },
>  		{ "enable-lro",                 0, 0, 0 },
>  		{ "enable-rx-cksum",            0, 0, 0 },
> @@ -793,6 +796,18 @@ launch_args_parse(int argc, char** argv)
>  						 " must be >= 0\n", n);
>  			}
Please add description printing in function usage.


>  #ifdef RTE_LIBRTE_LATENCY_STATS
> @@ -2238,6 +2248,9 @@ 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_enabled = 0;
You can assign it at the definition.
> +

Don't forget the testpmd doc to describe the parameters.

Thanks
Jingjing


More information about the dev mailing list