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

Signed-off-by: Tran Bao Long <tranbaol...@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 via email to