numam-dpdk/app/test-pmd
Wei Hu (Xavier) 9eb974221f app/testpmd: fix statistics after reset
Currently, when running start/clear stats&xstats/stop command many times
based on testpmd application, there are incorrect forward Rx/Tx-packets
stats as below:
---------------------- Forward statistics for port 0  --------------
RX-packets: 18446744073709544808 RX-dropped: 0                <snip>
TX-packets: 18446744073709536616 TX-dropped: 0                <snip>
--------------------------------------------------------------------

The root cause as below:
1. The struct rte_port of testpmd.h has a member variable "struct
   rte_eth_stats stats" to store the last port statistics.
2. When running start command, it execute cmd_start_parsed ->
   start_packet_forwarding -> fwd_stats_reset, which call
   rte_eth_stats_get API function to save current port statistics.
3. When running stop command, it execute fwd_stats_display, which call
   rte_eth_stats_get to get current port statistics, and then minus last
   port statistics.
4. If we run clear stats or xstats after start command, then run stop,
   it may display above incorrect stats because the current
   Rx/Tx-packets is lower than the last saved RX/TX-packets(uint64_t
   overflow).

This patch fixes it by clearing last port statistics when executing
"clear stats/xstats" command.

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-05-11 22:27:39 +02:00
..
bpf_cmd.c replace unused attributes 2020-04-16 18:30:58 +02:00
bpf_cmd.h app/testpmd: add commands to load/unload BPF filters 2018-05-12 00:37:51 +02:00
cmdline_flow.c app/testpmd: support flow aging 2020-05-11 22:27:39 +02:00
cmdline_mtr.c replace unused attributes 2020-04-16 18:30:58 +02:00
cmdline_mtr.h app/testpmd: add commands for metering and policing 2018-01-10 00:51:31 +01:00
cmdline_tm.c replace unused attributes 2020-04-16 18:30:58 +02:00
cmdline_tm.h app/testpmd: add TM commands to mark packets 2018-10-08 17:53:03 +02:00
cmdline.c app/testpmd: support flow aging 2020-05-11 22:27:39 +02:00
config.c app/testpmd: fix statistics after reset 2020-05-11 22:27:39 +02:00
csumonly.c app/testpmd: add parsing for QinQ VLAN headers 2020-04-25 23:09:29 +02:00
flowgen.c fix Mellanox copyright and SPDX tag 2020-02-13 18:47:28 +01:00
icmpecho.c app: use common macro RTE_DIM 2020-02-05 14:37:41 +01:00
ieee1588fwd.c net: add rte prefix to ether defines 2019-05-24 13:34:45 +02:00
iofwd.c app: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
macfwd.c net: add rte prefix to IP structure 2019-05-24 13:34:46 +02:00
macswap_common.h net: add rte prefix to IP structure 2019-05-24 13:34:46 +02:00
macswap_neon.h net: add rte prefix to ether structures 2019-05-24 13:34:45 +02:00
macswap_sse.h net: add rte prefix to ether structures 2019-05-24 13:34:45 +02:00
macswap.c fix Mellanox copyright and SPDX tag 2020-02-13 18:47:28 +01:00
macswap.h net: add rte prefix to ether functions 2019-05-24 13:34:45 +02:00
Makefile build: disable experimental API check internally 2020-04-14 16:22:34 +02:00
meson.build build: disable experimental API check internally 2020-04-14 16:22:34 +02:00
noisy_vnf.c app/testpmd: add noisy neighbour forwarding mode 2018-10-11 18:56:02 +02:00
parameters.c app/testpmd: support flow aging 2020-05-11 22:27:39 +02:00
rxonly.c app/testpmd: add packet dump callbacks 2018-10-18 10:24:39 +02:00
softnicfwd.c app/testpmd: check status of getting link info 2019-10-07 15:00:54 +02:00
testpmd.c app/testpmd: support flow aging 2020-05-11 22:27:39 +02:00
testpmd.h app/testpmd: support flow aging 2020-05-11 22:27:39 +02:00
txonly.c replace unused attributes 2020-04-16 18:30:58 +02:00
util.c fix Mellanox copyright and SPDX tag 2020-02-13 18:47:28 +01:00