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

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

Checks

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

Commit Message

Dharmik Thakkar May 8, 2020, 10:38 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>
---
v2:
 - Use shorter lines, up to 100.
---
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 53 +++++++++++++--------
 1 file changed, 33 insertions(+), 20 deletions(-)
  

Comments

Iremonger, Bernard May 12, 2020, 10:20 a.m. UTC | #1
> -----Original Message-----
> From: Dharmik Thakkar <dharmik.thakkar@arm.com>
> Sent: Friday, May 8, 2020 11:38 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 v2 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>

Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
  
Ferruh Yigit May 15, 2020, 12:15 p.m. UTC | #2
On 5/8/2020 11:38 PM, Dharmik Thakkar 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>
> ---
> v2:
>  - Use shorter lines, up to 100.
> ---
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst | 53 +++++++++++++--------
>  1 file changed, 33 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..441ed41e3803 100644
> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
> @@ -351,26 +351,39 @@ 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 Clock

Hi Dharmik,

Overall it is OK to show "CPU cycles/packet", but my concern is numbers can be
misleading, because for example the numbers I am getting is like below:

CPU cycles/packet=4.38 (total cycles=32871036274 / total RX packets=7511734336)
at 2100 MHz Clock

> +
> +.. note::
> +
> +   Measuring CPU cycles/packet requires enabling CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES

s/TX_CYCLES/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.

Not sure the "aarch64 platforms" note suits to here, where documents the
command. And I can see the platform documentation already updated for this.

Combining above two comments, what do you think instead of replacing existing
stats, add a note saying enabling 'CONFIG_RTE_TEST_PMD_RECORD_CORE_CYCLES'
appends "CPU cycles/packet" and give above two samples, like:

"
Enabling RTE_TEST_PMD_RECORD_CORE_CYCLES appends "CPU cycles/packet" stats, like:

CPU cycles/packet=4.38 (total cycles=32871036274 / total RX packets=7511734336)
at 2100 MHz Clock
OR
CPU cycles/packet=14.28 (total cycles=4899533541 / total RX packets=343031966)
at 200 MHz Clock
"
  
Dharmik Thakkar May 15, 2020, 8:33 p.m. UTC | #3
Hi Ferruh,

> On May 15, 2020, at 7:15 AM, Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> 
> On 5/8/2020 11:38 PM, Dharmik Thakkar 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>
>> ---
>> v2:
>> - Use shorter lines, up to 100.
>> ---
>> doc/guides/testpmd_app_ug/testpmd_funcs.rst | 53 +++++++++++++--------
>> 1 file changed, 33 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..441ed41e3803 100644
>> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>> @@ -351,26 +351,39 @@ 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 Clock
> 
> Hi Dharmik,
> 
> Overall it is OK to show "CPU cycles/packet", but my concern is numbers can be
> misleading, because for example the numbers I am getting is like below:
> 
> CPU cycles/packet=4.38 (total cycles=32871036274 / total RX packets=7511734336)
> at 2100 MHz Clock

CPU cycles/packet shown above is a part of the example. The numbers are as per the statistics shown in the example.

> 
>> +
>> +.. note::
>> +
>> +   Measuring CPU cycles/packet requires enabling CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES
> 
> s/TX_CYCLES/CYCLES

Sorry, didn’t understand this comment.

> 
>> +   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.
> 
> Not sure the "aarch64 platforms" note suits to here, where documents the
> command. And I can see the platform documentation already updated for this.

This additional comment about aarch64 platforms is to provide complete information to the users with regards to the config option
and offer a better understanding of the CPU cycles/packet numbers. IMO, without this note, CPU cycles/packet numbers can be misleading.

> 
> Combining above two comments, what do you think instead of replacing existing
> stats, add a note saying enabling 'CONFIG_RTE_TEST_PMD_RECORD_CORE_CYCLES'
> appends "CPU cycles/packet" and give above two samples, like:
> 
> "
> Enabling RTE_TEST_PMD_RECORD_CORE_CYCLES appends "CPU cycles/packet" stats, like:
> 
> CPU cycles/packet=4.38 (total cycles=32871036274 / total RX packets=7511734336)
> at 2100 MHz Clock
> OR
> CPU cycles/packet=14.28 (total cycles=4899533541 / total RX packets=343031966)
> at 200 MHz Clock
> "

Yes, this is also an option. IMO, numbers shown within CPU cycles/packet example should be consistent with the forward statistics numbers.
  
Ferruh Yigit May 18, 2020, 9:47 a.m. UTC | #4
On 5/15/2020 9:33 PM, Dharmik Thakkar wrote:
> Hi Ferruh,
> 
>> On May 15, 2020, at 7:15 AM, Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>
>> On 5/8/2020 11:38 PM, Dharmik Thakkar 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>
>>> ---
>>> v2:
>>> - Use shorter lines, up to 100.
>>> ---
>>> doc/guides/testpmd_app_ug/testpmd_funcs.rst | 53 +++++++++++++--------
>>> 1 file changed, 33 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..441ed41e3803 100644
>>> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>>> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>>> @@ -351,26 +351,39 @@ 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 Clock
>>
>> Hi Dharmik,
>>
>> Overall it is OK to show "CPU cycles/packet", but my concern is numbers can be
>> misleading, because for example the numbers I am getting is like below:
>>
>> CPU cycles/packet=4.38 (total cycles=32871036274 / total RX packets=7511734336)
>> at 2100 MHz Clock
> 
> CPU cycles/packet shown above is a part of the example. The numbers are as per the statistics shown in the example.

I know but now you are showing a performance number and it is specific to a
platform, my concern it may be misleading and create false expectations for others.

> 
>>
>>> +
>>> +.. note::
>>> +
>>> +   Measuring CPU cycles/packet requires enabling CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES
>>
>> s/TX_CYCLES/CYCLES
> 
> Sorry, didn’t understand this comment.

There is no 'CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES' config option.

> 
>>
>>> +   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.
>>
>> Not sure the "aarch64 platforms" note suits to here, where documents the
>> command. And I can see the platform documentation already updated for this.
> 
> This additional comment about aarch64 platforms is to provide complete information to the users with regards to the config option
> and offer a better understanding of the CPU cycles/packet numbers. IMO, without this note, CPU cycles/packet numbers can be misleading.

This is testpmd documentation to describe "show fwd stats" command. We are
adding a note to say with a config option it may also show performance data,
which is OK. But starting to describe the platform differences for this config
option looks to much details for the scope of the document. For testpmd I would
prefer command usage independent from platforms, otherwise the documentation may
become too confusing/complex.
But agree to provide the information for the specific platform, which you are
already doing in other patch in the platform documentation.

> 
>>
>> Combining above two comments, what do you think instead of replacing existing
>> stats, add a note saying enabling 'CONFIG_RTE_TEST_PMD_RECORD_CORE_CYCLES'
>> appends "CPU cycles/packet" and give above two samples, like:
>>
>> "
>> Enabling RTE_TEST_PMD_RECORD_CORE_CYCLES appends "CPU cycles/packet" stats, like:
>>
>> CPU cycles/packet=4.38 (total cycles=32871036274 / total RX packets=7511734336)
>> at 2100 MHz Clock
>> OR
>> CPU cycles/packet=14.28 (total cycles=4899533541 / total RX packets=343031966)
>> at 200 MHz Clock
>> "
> 
> Yes, this is also an option. IMO, numbers shown within CPU cycles/packet example should be consistent with the forward statistics numbers.
> 

This part is just the sample of the "CPU cycles/packet" output, I think it
provides enough context to be understandable without matching Rx packet count in
above part of the stats.
  
Dharmik Thakkar May 18, 2020, 9:49 p.m. UTC | #5
> On May 18, 2020, at 4:47 AM, Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> 
> On 5/15/2020 9:33 PM, Dharmik Thakkar wrote:
>> Hi Ferruh,
>> 
>>> On May 15, 2020, at 7:15 AM, Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>> 
>>> On 5/8/2020 11:38 PM, Dharmik Thakkar 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>
>>>> ---
>>>> v2:
>>>> - Use shorter lines, up to 100.
>>>> ---
>>>> doc/guides/testpmd_app_ug/testpmd_funcs.rst | 53 +++++++++++++--------
>>>> 1 file changed, 33 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..441ed41e3803 100644
>>>> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>>>> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>>>> @@ -351,26 +351,39 @@ 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 Clock
>>> 
>>> Hi Dharmik,
>>> 
>>> Overall it is OK to show "CPU cycles/packet", but my concern is numbers can be
>>> misleading, because for example the numbers I am getting is like below:
>>> 
>>> CPU cycles/packet=4.38 (total cycles=32871036274 / total RX packets=7511734336)
>>> at 2100 MHz Clock
>> 
>> CPU cycles/packet shown above is a part of the example. The numbers are as per the statistics shown in the example.
> 
> I know but now you are showing a performance number and it is specific to a
> platform, my concern it may be misleading and create false expectations for others.

Ok, makes sense.

> 
>> 
>>> 
>>>> +
>>>> +.. note::
>>>> +
>>>> +   Measuring CPU cycles/packet requires enabling CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES
>>> 
>>> s/TX_CYCLES/CYCLES
>> 
>> Sorry, didn’t understand this comment.
> 
> There is no 'CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES' config option.

Got it, will update.

> 
>> 
>>> 
>>>> +   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.
>>> 
>>> Not sure the "aarch64 platforms" note suits to here, where documents the
>>> command. And I can see the platform documentation already updated for this.
>> 
>> This additional comment about aarch64 platforms is to provide complete information to the users with regards to the config option
>> and offer a better understanding of the CPU cycles/packet numbers. IMO, without this note, CPU cycles/packet numbers can be misleading.
> 
> This is testpmd documentation to describe "show fwd stats" command. We are
> adding a note to say with a config option it may also show performance data,
> which is OK. But starting to describe the platform differences for this config
> option looks to much details for the scope of the document. For testpmd I would
> prefer command usage independent from platforms, otherwise the documentation may
> become too confusing/complex.
> But agree to provide the information for the specific platform, which you are
> already doing in other patch in the platform documentation.

Alright, I will remove platform in the next version.

> 
>> 
>>> 
>>> Combining above two comments, what do you think instead of replacing existing
>>> stats, add a note saying enabling 'CONFIG_RTE_TEST_PMD_RECORD_CORE_CYCLES'
>>> appends "CPU cycles/packet" and give above two samples, like:
>>> 
>>> "
>>> Enabling RTE_TEST_PMD_RECORD_CORE_CYCLES appends "CPU cycles/packet" stats, like:
>>> 
>>> CPU cycles/packet=4.38 (total cycles=32871036274 / total RX packets=7511734336)
>>> at 2100 MHz Clock
>>> OR
>>> CPU cycles/packet=14.28 (total cycles=4899533541 / total RX packets=343031966)
>>> at 200 MHz Clock
>>> "
>> 
>> Yes, this is also an option. IMO, numbers shown within CPU cycles/packet example should be consistent with the forward statistics numbers.
>> 
> 
> This part is just the sample of the "CPU cycles/packet" output, I think it
> provides enough context to be understandable without matching Rx packet count in
> above part of the stats.

Instead of adding 2 samples, do you think using xxx is best? For example:
CPU cycles/packet=xx.dd (total cycles=xxxx / total RX packets=xxxx) at xxxx MHz clock
  
Ferruh Yigit May 19, 2020, 8:27 a.m. UTC | #6
On 5/18/2020 10:49 PM, Dharmik Thakkar wrote:
> 
> 
>> On May 18, 2020, at 4:47 AM, Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>
>> On 5/15/2020 9:33 PM, Dharmik Thakkar wrote:
>>> Hi Ferruh,
>>>
>>>> On May 15, 2020, at 7:15 AM, Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>>>
>>>> On 5/8/2020 11:38 PM, Dharmik Thakkar 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>
>>>>> ---
>>>>> v2:
>>>>> - Use shorter lines, up to 100.
>>>>> ---
>>>>> doc/guides/testpmd_app_ug/testpmd_funcs.rst | 53 +++++++++++++--------
>>>>> 1 file changed, 33 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..441ed41e3803 100644
>>>>> --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>>>>> +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
>>>>> @@ -351,26 +351,39 @@ 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 Clock
>>>>
>>>> Hi Dharmik,
>>>>
>>>> Overall it is OK to show "CPU cycles/packet", but my concern is numbers can be
>>>> misleading, because for example the numbers I am getting is like below:
>>>>
>>>> CPU cycles/packet=4.38 (total cycles=32871036274 / total RX packets=7511734336)
>>>> at 2100 MHz Clock
>>>
>>> CPU cycles/packet shown above is a part of the example. The numbers are as per the statistics shown in the example.
>>
>> I know but now you are showing a performance number and it is specific to a
>> platform, my concern it may be misleading and create false expectations for others.
> 
> Ok, makes sense.
> 
>>
>>>
>>>>
>>>>> +
>>>>> +.. note::
>>>>> +
>>>>> +   Measuring CPU cycles/packet requires enabling CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES
>>>>
>>>> s/TX_CYCLES/CYCLES
>>>
>>> Sorry, didn’t understand this comment.
>>
>> There is no 'CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES' config option.
> 
> Got it, will update.
> 
>>
>>>
>>>>
>>>>> +   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.
>>>>
>>>> Not sure the "aarch64 platforms" note suits to here, where documents the
>>>> command. And I can see the platform documentation already updated for this.
>>>
>>> This additional comment about aarch64 platforms is to provide complete information to the users with regards to the config option
>>> and offer a better understanding of the CPU cycles/packet numbers. IMO, without this note, CPU cycles/packet numbers can be misleading.
>>
>> This is testpmd documentation to describe "show fwd stats" command. We are
>> adding a note to say with a config option it may also show performance data,
>> which is OK. But starting to describe the platform differences for this config
>> option looks to much details for the scope of the document. For testpmd I would
>> prefer command usage independent from platforms, otherwise the documentation may
>> become too confusing/complex.
>> But agree to provide the information for the specific platform, which you are
>> already doing in other patch in the platform documentation.
> 
> Alright, I will remove platform in the next version.
> 
>>
>>>
>>>>
>>>> Combining above two comments, what do you think instead of replacing existing
>>>> stats, add a note saying enabling 'CONFIG_RTE_TEST_PMD_RECORD_CORE_CYCLES'
>>>> appends "CPU cycles/packet" and give above two samples, like:
>>>>
>>>> "
>>>> Enabling RTE_TEST_PMD_RECORD_CORE_CYCLES appends "CPU cycles/packet" stats, like:
>>>>
>>>> CPU cycles/packet=4.38 (total cycles=32871036274 / total RX packets=7511734336)
>>>> at 2100 MHz Clock
>>>> OR
>>>> CPU cycles/packet=14.28 (total cycles=4899533541 / total RX packets=343031966)
>>>> at 200 MHz Clock
>>>> "
>>>
>>> Yes, this is also an option. IMO, numbers shown within CPU cycles/packet example should be consistent with the forward statistics numbers.
>>>
>>
>> This part is just the sample of the "CPU cycles/packet" output, I think it
>> provides enough context to be understandable without matching Rx packet count in
>> above part of the stats.
> 
> Instead of adding 2 samples, do you think using xxx is best? For example:
> CPU cycles/packet=xx.dd (total cycles=xxxx / total RX packets=xxxx) at xxxx MHz clock
> 

+1
  

Patch

diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index a360ecccfd3f..441ed41e3803 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -351,26 +351,39 @@  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 Clock
+
+.. 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
 ~~~~~~~~~