From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pablo de Lara Subject: [PATCH v2 1/4] l2fwd-crypto: fix accumulated stats Date: Thu, 4 Feb 2016 08:26:30 +0000 Message-ID: <1454574393-12224-2-git-send-email-pablo.de.lara.guarch@intel.com> References: <1454498063-11957-1-git-send-email-pablo.de.lara.guarch@intel.com> <1454574393-12224-1-git-send-email-pablo.de.lara.guarch@intel.com> Cc: dev@dpdk.org To: declan.doherty@intel.com Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 00DC88D8B for ; Thu, 4 Feb 2016 09:25:47 +0100 (CET) In-Reply-To: <1454574393-12224-1-git-send-email-pablo.de.lara.guarch@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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