DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tran Bao Long <tranbaolong@niometrics.com>
To: keith.wiles@intel.com
Cc: dev@dpdk.org, Tran Bao Long <tranbaolong@niometrics.com>
Subject: [dpdk-dev] [PATCH] pktgen: fix stats clear
Date: Thu, 21 Nov 2019 16:07:14 +0800	[thread overview]
Message-ID: <20191121080714.42442-1-tranbaolong@niometrics.com> (raw)

Reset the total RX/TX pkts/bytes statistics as well when 
user issues a clear command.

Signed-off-by: Tran Bao Long <tranbaolong@niometrics.com>
---
 app/pktgen-cmds.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/pktgen-cmds.c b/app/pktgen-cmds.c
index 0e9af7c..1e8e456 100644
--- a/app/pktgen-cmds.c
+++ b/app/pktgen-cmds.c
@@ -2432,6 +2432,8 @@ pktgen_clear_stats(port_info_t *info)
 	memset(&info->sizes, 0, sizeof(port_sizes_t));
 	memset(&info->prev_stats, 0, sizeof(eth_stats_t));
 	memset(&info->rate_stats, 0, sizeof(eth_stats_t));
+	memset(&info->curr_stats, 0, sizeof(eth_stats_t));
+	rte_eth_stats_reset(info->pid);
 
 	rte_eth_stats_get(info->pid, &info->prev_stats);
 	pktgen.max_total_ipackets   = 0;
-- 
2.22.0


                 reply	other threads:[~2019-11-21  8:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20191121080714.42442-1-tranbaolong@niometrics.com \
    --to=tranbaolong@niometrics.com \
    --cc=dev@dpdk.org \
    --cc=keith.wiles@intel.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).