[dpdk-stable] [dpdk-dev] [PATCH] app/testpmd: fix doubling of 'total TX dropped'

Ferruh Yigit ferruh.yigit at intel.com
Mon Jul 15 16:53:55 CEST 2019


On 7/12/2019 9:32 AM, A.McLoughlin wrote:
> The 'Accumulated forward statistics for all ports' incorrectly displayed
> double the actual value for 'total_tx_dropped'. This was because 2
> lines in the same function both incremented total_tx_dropped every time
> a packet was dropped.  I removed one of these lines to fix this issue.
> 
> Fixes: 53324971a14e ("app/testpmd: display/clear forwarding stats on demand")
> Cc: david.marchand at redhat.com
> Cc: stable at dpdk.org
> 
> Signed-off-by: A.McLoughlin <aideen.mcloughlin at intel.com>
> ---
>  app/test-pmd/testpmd.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index 3ed3523b7..c41bada50 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -1555,7 +1555,6 @@ fwd_stats_display(void)
>  		total_recv += stats.ipackets;
>  		total_xmit += stats.opackets;
>  		total_rx_dropped += stats.imissed;
> -		total_tx_dropped += ports_stats[pt_id].tx_dropped;
>  		total_tx_dropped += stats.oerrors;
>  		total_rx_nombuf  += stats.rx_nombuf;
>  
> 

Hi Aideen,

Indeed 'rte_eth_stats->oerrors' and 'tx_dropped' are different values,

in testpmd, 'TX-total' is taken as "total_xmit + total_tx_dropped", from this
description it may be fair to say
"total_tx_dropped = oerrors + tx_dropped"

This is easier to see in HW devices, 'oerrors' is the packets sent to HW but HW
reported failure for some reason, so these packets not transmitted to the medium.
'tx_dropped' is mostly calculated by application, driver returns packets that
can't able to sent to HW, so application can re-try to send or free them and
increase 'tx_dropped' counter.


The problem is in the virtual drivers, the packets not able to sent are
calculated as 'oerrors' and tx_burst functions returns the number of the
successfully sent packets which cause application calculate remaining ones as
'tx_dropped' which cause the duplication.

In virtual drivers we need to give a decision, if free the wrong packets and
increase the 'oerrors' or return packets backs to application without increasing
the 'oerrors', so that application can try to do something with packets or free
them increasing 'tx_dropped'.

@David, @Andrew, do you have a suggestion?





More information about the stable mailing list