DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] pktgen: fix stats clear
@ 2019-11-21  8:07 Tran Bao Long
  0 siblings, 0 replies; only message in thread
From: Tran Bao Long @ 2019-11-21  8:07 UTC (permalink / raw)
  To: keith.wiles; +Cc: dev, Tran Bao Long

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-21  8:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-21  8:07 [dpdk-dev] [PATCH] pktgen: fix stats clear Tran Bao Long

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).