DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: declan.doherty@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 1/4] l2fwd-crypto: fix accumulated stats
Date: Thu,  4 Feb 2016 08:26:30 +0000	[thread overview]
Message-ID: <1454574393-12224-2-git-send-email-pablo.de.lara.guarch@intel.com> (raw)
In-Reply-To: <1454574393-12224-1-git-send-email-pablo.de.lara.guarch@intel.com>

Total number of packets (adding up packets RX/TX/dropped in all ports),
where being increased by the accumulated number of packets per port
every time the stats were printed, instead of the resetting
them.

Fixes: 387259bd6c67 ("examples/l2fwd-crypto: add sample application")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 examples/l2fwd-crypto/main.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index d70fc9a..928b285 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -205,17 +205,20 @@ struct l2fwd_crypto_statistics crypto_statistics[RTE_MAX_ETHPORTS];
 /* default period is 10 seconds */
 static int64_t timer_period = 10 * TIMER_MILLISECOND * 1000;
 
-uint64_t total_packets_dropped = 0, total_packets_tx = 0, total_packets_rx = 0,
-	total_packets_enqueued = 0, total_packets_dequeued = 0,
+uint64_t total_packets_enqueued = 0, total_packets_dequeued = 0,
 	total_packets_errors = 0;
 
 /* Print out statistics on packets dropped */
 static void
 print_stats(void)
 {
+	uint64_t total_packets_dropped, total_packets_tx, total_packets_rx;
 	unsigned portid;
 	uint64_t cdevid;
 
+	total_packets_dropped = 0;
+	total_packets_tx = 0;
+	total_packets_rx = 0;
 
 	const char clr[] = { 27, '[', '2', 'J', '\0' };
 	const char topLeft[] = { 27, '[', '1', ';', '1', 'H', '\0' };
-- 
2.5.0

  reply	other threads:[~2016-02-04  8:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03 11:14 [dpdk-dev] [PATCH 0/4] Various fixes for L2fwd-crypto Pablo de Lara
2016-02-03 11:14 ` [dpdk-dev] [PATCH 1/4] l2fwd-crypto: fix accumulated stats Pablo de Lara
2016-02-03 11:14 ` [dpdk-dev] [PATCH 2/4] l2fwd-crypto: fix incorrect params in command line help Pablo de Lara
2016-02-03 11:14 ` [dpdk-dev] [PATCH 3/4] l2fwd-crypto: fix auth params setting Pablo de Lara
2016-02-03 11:14 ` [dpdk-dev] [PATCH 4/4] l2fwd-crypto: fix typos Pablo de Lara
2016-02-04  8:26 ` [dpdk-dev] [PATCH v2 0/4] Various fixes for L2fwd-crypto Pablo de Lara
2016-02-04  8:26   ` Pablo de Lara [this message]
2016-02-04  8:26   ` [dpdk-dev] [PATCH v2 2/4] l2fwd-crypto: fix incorrect params in command line help Pablo de Lara
2016-02-04  8:26   ` [dpdk-dev] [PATCH v2 3/4] l2fwd-crypto: fix auth params setting Pablo de Lara
2016-02-04  8:26   ` [dpdk-dev] [PATCH v2 4/4] l2fwd-crypto: fix typos Pablo de Lara
2016-02-12  9:16   ` [dpdk-dev] [PATCH v2 0/4] Various fixes for L2fwd-crypto De Lara Guarch, Pablo
2016-02-12  9:17   ` [dpdk-dev] [PATCH v3 " Pablo de Lara
2016-02-12  9:17     ` [dpdk-dev] [PATCH v3 1/4] l2fwd-crypto: fix total stats Pablo de Lara
2016-02-12  9:17     ` [dpdk-dev] [PATCH v3 2/4] l2fwd-crypto: fix incorrect params in command line help Pablo de Lara
2016-02-12  9:17     ` [dpdk-dev] [PATCH v3 3/4] l2fwd-crypto: fix auth params setting Pablo de Lara
2016-02-12  9:17     ` [dpdk-dev] [PATCH v3 4/4] l2fwd-crypto: fix typos Pablo de Lara
2016-02-15 16:44     ` [dpdk-dev] [PATCH v3 0/4] Various fixes for L2fwd-crypto Declan Doherty
2016-02-24 13:52       ` Thomas Monjalon
2016-02-04  8:26 ` [dpdk-dev] [PATCH " De Lara Guarch, Pablo

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=1454574393-12224-2-git-send-email-pablo.de.lara.guarch@intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    /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).