From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 64D37A04C1; Thu, 21 Nov 2019 09:07:27 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1DCB22BA3; Thu, 21 Nov 2019 09:07:26 +0100 (CET) Received: from integrity.niometrics.com (integrity.niometrics.com [42.61.70.122]) by dpdk.org (Postfix) with ESMTP id EA7A02BA2 for ; Thu, 21 Nov 2019 09:07:24 +0100 (CET) Received: from localhost.localdomain (unknown [10.15.0.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by integrity.niometrics.com (Postfix) with ESMTPSA id 2E01D409CBA8; Thu, 21 Nov 2019 16:07:22 +0800 (+08) DMARC-Filter: OpenDMARC Filter v1.3.2 integrity.niometrics.com 2E01D409CBA8 Authentication-Results: integrity.niometrics.com; dmarc=fail (p=reject dis=none) header.from=niometrics.com Authentication-Results: integrity.niometrics.com; spf=fail smtp.mailfrom=tranbaolong@niometrics.com DKIM-Filter: OpenDKIM Filter v2.11.0 integrity.niometrics.com 2E01D409CBA8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niometrics.com; s=default; t=1574323642; bh=wKGdN1pOKqDIE4dwq9jWCzfa5FbHpVq0I+swLw8ReJ0=; h=From:To:Cc:Subject:Date:From; b=rb4HIFl6mjbvn4oFXsxzYQd3Wy4J22tZokH6EXnBnlndt1wrd0UXj/U1nGzLEwLdc U4vYu4s373snlNxH+MiKYfCfy0iAaHvDsnl0ZwGxVI0fLVKsFL5CKe4pLXiNOe5YEc DWT5ichss3+ZdJ6EaUfEeN6VsvkiQbdwefU5jr6E= From: Tran Bao Long To: keith.wiles@intel.com Cc: dev@dpdk.org, Tran Bao Long Date: Thu, 21 Nov 2019 16:07:14 +0800 Message-Id: <20191121080714.42442-1-tranbaolong@niometrics.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=3.5 tests=ALL_TRUSTED autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on integrity.niometrics.com Subject: [dpdk-dev] [PATCH] pktgen: fix stats clear X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Reset the total RX/TX pkts/bytes statistics as well when user issues a clear command. Signed-off-by: Tran Bao Long --- 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