From: Ferruh Yigit <ferruh.yigit@intel.com>
To: "Wei Hu (Xavier)" <huwei013@chinasoftinc.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH V3] app/testpmd: fix forward stats after clear stats command
Date: Tue, 5 May 2020 16:43:33 +0100 [thread overview]
Message-ID: <82ef82d8-bffa-db00-7677-1fffa73a14f3@intel.com> (raw)
In-Reply-To: <20200428115045.31391-1-huwei013@chinasoftinc.com>
On 4/28/2020 12:50 PM, Wei Hu (Xavier) wrote:
> From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
>
> 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 runnig 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: af75078fece3 ("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>
Applied to dpdk-next-net/master, thanks.
prev parent reply other threads:[~2020-05-05 15:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-28 11:50 Wei Hu (Xavier)
2020-05-05 15:43 ` Ferruh Yigit [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=82ef82d8-bffa-db00-7677-1fffa73a14f3@intel.com \
--to=ferruh.yigit@intel.com \
--cc=dev@dpdk.org \
--cc=huwei013@chinasoftinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).