From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 82C4A95B5 for ; Fri, 12 Feb 2016 10:16:25 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 12 Feb 2016 01:16:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,435,1449561600"; d="scan'208";a="910606178" Received: from sie-lab-212-116.ir.intel.com ([10.237.212.116]) by orsmga002.jf.intel.com with ESMTP; 12 Feb 2016 01:16:24 -0800 From: Pablo de Lara To: declan.doherty@intel.com Date: Fri, 12 Feb 2016 09:17:22 +0000 Message-Id: <1455268645-10864-2-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455268645-10864-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1454574393-12224-1-git-send-email-pablo.de.lara.guarch@intel.com> <1455268645-10864-1-git-send-email-pablo.de.lara.guarch@intel.com> Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH v3 1/4] l2fwd-crypto: fix total stats X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 09:16:26 -0000 Reset total statistics (sum of all port statistics) before adding up the new accumulated statistics per port. Fixes: 387259bd6c67 ("examples/l2fwd-crypto: add sample application") Signed-off-by: Pablo de Lara --- examples/l2fwd-crypto/main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index d70fc9a..113d8f5 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -205,17 +205,22 @@ 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, - 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; + uint64_t total_packets_enqueued, total_packets_dequeued, + total_packets_errors; unsigned portid; uint64_t cdevid; + total_packets_dropped = 0; + total_packets_tx = 0; + total_packets_rx = 0; + total_packets_enqueued = 0; + total_packets_dequeued = 0; + total_packets_errors = 0; const char clr[] = { 27, '[', '2', 'J', '\0' }; const char topLeft[] = { 27, '[', '1', ';', '1', 'H', '\0' }; -- 2.5.0