[3/5] doc: add cycles per packet in testpmd user guide

Message ID 20200506215847.7628-3-dharmik.thakkar@arm.com (mailing list archive)
State Superseded, archived
Headers
Series [1/5] app/testpmd: print clock with CPU cycles per pkt |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Dharmik Thakkar May 6, 2020, 9:58 p.m. UTC
  Update documentation for 'show fwd' testpmd runtime function to show
CPU cycles/packet example.

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
---
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 51 +++++++++++++--------
 1 file changed, 31 insertions(+), 20 deletions(-)
  

Comments

Jerin Jacob May 7, 2020, 5:24 a.m. UTC | #1
On Thu, May 7, 2020 at 3:30 AM Dharmik Thakkar <dharmik.thakkar@arm.com> wrote:
>
> Update documentation for 'show fwd' testpmd runtime function to show
> CPU cycles/packet example.
>
> Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Reviewed-by: Phil Yang <phil.yang@arm.com>
> ---
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst | 51 +++++++++++++--------
>  1 file changed, 31 insertions(+), 20 deletions(-)
>
> diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> index a360ecccfd3f..2e565ccdbcd4 100644
> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> @@ -351,26 +351,37 @@ Example for the io forwarding engine, with some packet drops on the tx side::
>
>     testpmd> show fwd stats all
>
> -     ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
> -     RX-packets: 274293770      TX-packets: 274293642      TX-dropped: 128
> -
> -     ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
> -     RX-packets: 274301850      TX-packets: 274301850      TX-dropped: 0
> -
> -     ---------------------- Forward statistics for port 0  ----------------------
> -     RX-packets: 274293802      RX-dropped: 0             RX-total: 274293802
> -     TX-packets: 274301862      TX-dropped: 0             TX-total: 274301862
> -     ----------------------------------------------------------------------------
> -
> -     ---------------------- Forward statistics for port 1  ----------------------
> -     RX-packets: 274301894      RX-dropped: 0             RX-total: 274301894
> -     TX-packets: 274293706      TX-dropped: 128           TX-total: 274293834
> -     ----------------------------------------------------------------------------
> -
> -     +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
> -     RX-packets: 548595696      RX-dropped: 0             RX-total: 548595696
> -     TX-packets: 548595568      TX-dropped: 128           TX-total: 548595696
> -     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +     ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
> +     RX-packets: 43536504       TX-packets: 43536488       TX-dropped: 0
> +
> +     ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
> +     RX-packets: 149738504      TX-packets: 149738504      TX-dropped: 0
> +
> +     ------- Forward Stats for RX Port= 1/Queue= 1 -> TX Port= 0/Queue= 1 -------
> +     RX-packets: 149753052      TX-packets: 149753052      TX-dropped: 0
> +
> +     ---------------------- Forward statistics for port 0  ----------------------
> +     RX-packets: 43538881       RX-dropped: 72            RX-total: 43538953
> +     TX-packets: 299491753      TX-dropped: 0             TX-total: 299491753
> +     ----------------------------------------------------------------------------
> +
> +     ---------------------- Forward statistics for port 1  ----------------------
> +     RX-packets: 299493085      RX-dropped: 8357          RX-total: 299501442
> +     TX-packets: 43539683       TX-dropped: 0             TX-total: 43539683
> +     ----------------------------------------------------------------------------
> +
> +     +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
> +     RX-packets: 343031966      RX-dropped: 8429          RX-total: 343040395
> +     TX-packets: 343031436      TX-dropped: 0             TX-total: 343031436
> +     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +
> +     CPU cycles/packet=14.28 (total cycles=4899533541 / total RX packets=343031966) at 200 MHz
> +
> +.. note::
> +
> +   Measuring CPU cycles/packet requires enabling CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES configuration option.

IMO, it a very useful feature for CI/CD and development as we don't
need to see any Traffic generator to see any regression.

I think, enabling CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES
configuration is overhead to use in all the environments.

How about adding a "new forward" engine with and remove
CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES.
The new forward engine will have
CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES code enabled.
So the application can use the forward engine dynamically. aka the
same build works for both cases.


> +   On aarch64 platforms, by default, the cycles are counted using generic counter which runs at a lower frequency than the CPU clock.
> +   To get the cycles/packet at CPU clock frequency, please scale the cycles/packet to CPU clock frequency. Alternatively, use the PMU based cycle counter.
>
>  clear fwd
>  ~~~~~~~~~
> --
> 2.20.1
>
  
Iremonger, Bernard May 7, 2020, 2:30 p.m. UTC | #2
Hi Dharmik,


> -----Original Message-----
> From: Dharmik Thakkar <dharmik.thakkar@arm.com>
> Sent: Wednesday, May 6, 2020 10:59 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>; Mcnamara, John
> <john.mcnamara@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>
> Cc: dev@dpdk.org; nd@arm.com; Dharmik Thakkar
> <dharmik.thakkar@arm.com>
> Subject: [PATCH 3/5] doc: add cycles per packet in testpmd user guide
> 
> Update documentation for 'show fwd' testpmd runtime function to show
> CPU cycles/packet example.
> 
> Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Reviewed-by: Phil Yang <phil.yang@arm.com>
> ---
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst | 51 +++++++++++++------
> --
>  1 file changed, 31 insertions(+), 20 deletions(-)
> 
> diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> index a360ecccfd3f..2e565ccdbcd4 100644
> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> @@ -351,26 +351,37 @@ Example for the io forwarding engine, with some
> packet drops on the tx side::
> 
>     testpmd> show fwd stats all
> 
> -     ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -----
> --
> -     RX-packets: 274293770      TX-packets: 274293642      TX-dropped: 128
> -
> -     ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -----
> --
> -     RX-packets: 274301850      TX-packets: 274301850      TX-dropped: 0
> -
> -     ---------------------- Forward statistics for port 0  ----------------------
> -     RX-packets: 274293802      RX-dropped: 0             RX-total: 274293802
> -     TX-packets: 274301862      TX-dropped: 0             TX-total: 274301862
> -     ----------------------------------------------------------------------------
> -
> -     ---------------------- Forward statistics for port 1  ----------------------
> -     RX-packets: 274301894      RX-dropped: 0             RX-total: 274301894
> -     TX-packets: 274293706      TX-dropped: 128           TX-total: 274293834
> -     ----------------------------------------------------------------------------
> -
> -     +++++++++++++++ Accumulated forward statistics for all
> ports+++++++++++++++
> -     RX-packets: 548595696      RX-dropped: 0             RX-total: 548595696
> -     TX-packets: 548595568      TX-dropped: 128           TX-total: 548595696
> -
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++++++++++++
> +     ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 ----
> ---
> +     RX-packets: 43536504       TX-packets: 43536488       TX-dropped:
> + 0
> +
> +     ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 ----
> ---
> +     RX-packets: 149738504      TX-packets: 149738504      TX-dropped:
> + 0
> +
> +     ------- Forward Stats for RX Port= 1/Queue= 1 -> TX Port= 0/Queue= 1 ----
> ---
> +     RX-packets: 149753052      TX-packets: 149753052      TX-dropped:
> + 0
> +
> +     ---------------------- Forward statistics for port 0  ----------------------
> +     RX-packets: 43538881       RX-dropped: 72            RX-total: 43538953
> +     TX-packets: 299491753      TX-dropped: 0             TX-total: 299491753
> +
> + ----------------------------------------------------------------------
> + ------
> +
> +     ---------------------- Forward statistics for port 1  ----------------------
> +     RX-packets: 299493085      RX-dropped: 8357          RX-total: 299501442
> +     TX-packets: 43539683       TX-dropped: 0             TX-total: 43539683
> +
> + ----------------------------------------------------------------------
> + ------
> +
> +     +++++++++++++++ Accumulated forward statistics for all
> ports+++++++++++++++
> +     RX-packets: 343031966      RX-dropped: 8429          RX-total: 343040395
> +     TX-packets: 343031436      TX-dropped: 0             TX-total: 343031436
> +
> +
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++++++
> + ++++++
> +
> +     CPU cycles/packet=14.28 (total cycles=4899533541 / total RX
> + packets=343031966) at 200 MHz
> +
> +.. note::
> +
> +   Measuring CPU cycles/packet requires enabling
> CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES configuration option.
> +   On aarch64 platforms, by default, the cycles are counted using generic
> counter which runs at a lower frequency than the CPU clock.
> +   To get the cycles/packet at CPU clock frequency, please scale the
> cycles/packet to CPU clock frequency. Alternatively, use the PMU based
> cycle counter.

It is preferred to use shorter lines in .rst file, preferably  <= 80, up to 100 is acceptable.

> 
>  clear fwd
>  ~~~~~~~~~
> --
> 2.20.1

Regards,

Bernard.
  
Dharmik Thakkar May 7, 2020, 10:27 p.m. UTC | #3
Hi Jerin,

> On May 7, 2020, at 12:24 AM, Jerin Jacob <jerinjacobk@gmail.com> wrote:
> 
> On Thu, May 7, 2020 at 3:30 AM Dharmik Thakkar <dharmik.thakkar@arm.com> wrote:
>> 
>> Update documentation for 'show fwd' testpmd runtime function to show
>> CPU cycles/packet example.
>> 
>> Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
>> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
>> Reviewed-by: Phil Yang <phil.yang@arm.com>
>> ---
>> doc/guides/testpmd_app_ug/testpmd_funcs.rst | 51 +++++++++++++--------
>> 1 file changed, 31 insertions(+), 20 deletions(-)
>> 
>> diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>> index a360ecccfd3f..2e565ccdbcd4 100644
>> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>> @@ -351,26 +351,37 @@ Example for the io forwarding engine, with some packet drops on the tx side::
>> 
>>    testpmd> show fwd stats all
>> 
>> -     ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
>> -     RX-packets: 274293770      TX-packets: 274293642      TX-dropped: 128
>> -
>> -     ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
>> -     RX-packets: 274301850      TX-packets: 274301850      TX-dropped: 0
>> -
>> -     ---------------------- Forward statistics for port 0  ----------------------
>> -     RX-packets: 274293802      RX-dropped: 0             RX-total: 274293802
>> -     TX-packets: 274301862      TX-dropped: 0             TX-total: 274301862
>> -     ----------------------------------------------------------------------------
>> -
>> -     ---------------------- Forward statistics for port 1  ----------------------
>> -     RX-packets: 274301894      RX-dropped: 0             RX-total: 274301894
>> -     TX-packets: 274293706      TX-dropped: 128           TX-total: 274293834
>> -     ----------------------------------------------------------------------------
>> -
>> -     +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
>> -     RX-packets: 548595696      RX-dropped: 0             RX-total: 548595696
>> -     TX-packets: 548595568      TX-dropped: 128           TX-total: 548595696
>> -     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> +     ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
>> +     RX-packets: 43536504       TX-packets: 43536488       TX-dropped: 0
>> +
>> +     ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
>> +     RX-packets: 149738504      TX-packets: 149738504      TX-dropped: 0
>> +
>> +     ------- Forward Stats for RX Port= 1/Queue= 1 -> TX Port= 0/Queue= 1 -------
>> +     RX-packets: 149753052      TX-packets: 149753052      TX-dropped: 0
>> +
>> +     ---------------------- Forward statistics for port 0  ----------------------
>> +     RX-packets: 43538881       RX-dropped: 72            RX-total: 43538953
>> +     TX-packets: 299491753      TX-dropped: 0             TX-total: 299491753
>> +     ----------------------------------------------------------------------------
>> +
>> +     ---------------------- Forward statistics for port 1  ----------------------
>> +     RX-packets: 299493085      RX-dropped: 8357          RX-total: 299501442
>> +     TX-packets: 43539683       TX-dropped: 0             TX-total: 43539683
>> +     ----------------------------------------------------------------------------
>> +
>> +     +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
>> +     RX-packets: 343031966      RX-dropped: 8429          RX-total: 343040395
>> +     TX-packets: 343031436      TX-dropped: 0             TX-total: 343031436
>> +     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> +
>> +     CPU cycles/packet=14.28 (total cycles=4899533541 / total RX packets=343031966) at 200 MHz
>> +
>> +.. note::
>> +
>> +   Measuring CPU cycles/packet requires enabling CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES configuration option.
> 
> IMO, it a very useful feature for CI/CD and development as we don't
> need to see any Traffic generator to see any regression.
> 
> I think, enabling CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES
> configuration is overhead to use in all the environments.
> 
> How about adding a "new forward" engine with and remove
> CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES.
> The new forward engine will have
> CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES code enabled.
> So the application can use the forward engine dynamically. aka the
> same build works for both cases.

Yes, this can be done as a separate patch.
The idea of this patch is to update the documentation with the missing CPU cycles/packet information.

> 
> 
>> +   On aarch64 platforms, by default, the cycles are counted using generic counter which runs at a lower frequency than the CPU clock.
>> +   To get the cycles/packet at CPU clock frequency, please scale the cycles/packet to CPU clock frequency. Alternatively, use the PMU based cycle counter.
>> 
>> clear fwd
>> ~~~~~~~~~
>> --
>> 2.20.1
  

Patch

diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index a360ecccfd3f..2e565ccdbcd4 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -351,26 +351,37 @@  Example for the io forwarding engine, with some packet drops on the tx side::
 
    testpmd> show fwd stats all
 
-     ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
-     RX-packets: 274293770      TX-packets: 274293642      TX-dropped: 128
-
-     ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
-     RX-packets: 274301850      TX-packets: 274301850      TX-dropped: 0
-
-     ---------------------- Forward statistics for port 0  ----------------------
-     RX-packets: 274293802      RX-dropped: 0             RX-total: 274293802
-     TX-packets: 274301862      TX-dropped: 0             TX-total: 274301862
-     ----------------------------------------------------------------------------
-
-     ---------------------- Forward statistics for port 1  ----------------------
-     RX-packets: 274301894      RX-dropped: 0             RX-total: 274301894
-     TX-packets: 274293706      TX-dropped: 128           TX-total: 274293834
-     ----------------------------------------------------------------------------
-
-     +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
-     RX-packets: 548595696      RX-dropped: 0             RX-total: 548595696
-     TX-packets: 548595568      TX-dropped: 128           TX-total: 548595696
-     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+     ------- Forward Stats for RX Port= 0/Queue= 0 -> TX Port= 1/Queue= 0 -------
+     RX-packets: 43536504       TX-packets: 43536488       TX-dropped: 0
+
+     ------- Forward Stats for RX Port= 1/Queue= 0 -> TX Port= 0/Queue= 0 -------
+     RX-packets: 149738504      TX-packets: 149738504      TX-dropped: 0
+
+     ------- Forward Stats for RX Port= 1/Queue= 1 -> TX Port= 0/Queue= 1 -------
+     RX-packets: 149753052      TX-packets: 149753052      TX-dropped: 0
+
+     ---------------------- Forward statistics for port 0  ----------------------
+     RX-packets: 43538881       RX-dropped: 72            RX-total: 43538953
+     TX-packets: 299491753      TX-dropped: 0             TX-total: 299491753
+     ----------------------------------------------------------------------------
+
+     ---------------------- Forward statistics for port 1  ----------------------
+     RX-packets: 299493085      RX-dropped: 8357          RX-total: 299501442
+     TX-packets: 43539683       TX-dropped: 0             TX-total: 43539683
+     ----------------------------------------------------------------------------
+
+     +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
+     RX-packets: 343031966      RX-dropped: 8429          RX-total: 343040395
+     TX-packets: 343031436      TX-dropped: 0             TX-total: 343031436
+     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+     CPU cycles/packet=14.28 (total cycles=4899533541 / total RX packets=343031966) at 200 MHz
+
+.. note::
+
+   Measuring CPU cycles/packet requires enabling CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES configuration option.
+   On aarch64 platforms, by default, the cycles are counted using generic counter which runs at a lower frequency than the CPU clock.
+   To get the cycles/packet at CPU clock frequency, please scale the cycles/packet to CPU clock frequency. Alternatively, use the PMU based cycle counter.
 
 clear fwd
 ~~~~~~~~~