From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 95AA6235 for ; Tue, 21 Nov 2017 14:22:49 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4814820C94; Tue, 21 Nov 2017 08:22:49 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:22:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=4YTnaOurkUgh2nkVY GCqCnJcUGXBf5SIQ2NYhWaQgAc=; b=TfeIxnfo9ioO+4bWdTOBEFor3fN1k5dVE 9Rfn4Vjlblf93YNOFcyfx5OkA+0pJueh0Lojc3lzyrl/9STHei/yygswDg6a0loD QXRjFhTG3zmY0SHJQ4CHy74UwVFwauorEd61HP171w7/Cykd956aL6DCcKyMcZdP 0iUZC13qP6bwCbtLa0FxV+KWTWynipGwKzq+bJQxY+oH/1QN99TLtcg7H2c+PvPf DPtFDEq6KXL+qNONQLufNsSJutIE82+dFpQvU2fIbyoGBDDs7cpBbhN9MpKvOIvr BYpsJaG8VS555syz3kvFcWE/yHTHmXiziWneJ7+lp8VniqjTQTqUg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=4YTnaOurkUgh2nkVYGCqCnJcUGXBf5SIQ2NYhWaQgAc=; b=HrhNG6Xt 9ZC/62g0Y5IOVCCOANTUFYFclDwsTN/IIBxAy6RlULyd+ce4aaDo190InifDuXRf BIIt5WRDS0sECWb2oU+6fiGXqLb7JcGIGNZVRYIaZlqwRkzsxsiQ0ZYts6Pdnovr KvDT1Yx0z/0gt/X9nixRPkLCKyCjEsukCZ4bsNCtvD81uTj6ipbkvzfGzmlQcOiR hDyzD7TRvKMIKKvvT+/JpiZ/31sVvVQnWPiXlfecv8hYZ1lzId81G90yBojZtVOD 9nhr3cH0x76z7jdZAumFzFFNiNHfugFAD/6NJsyAiEHsIWJtE9NAhuJV7o5m9h+C RBZAQZWIyxtzpw== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id EF98B243B9; Tue, 21 Nov 2017 08:22:45 -0500 (EST) From: Yuanhan Liu To: Wei Zhao Cc: Ferruh Yigit , dpdk stable Date: Tue, 21 Nov 2017 21:16:34 +0800 Message-Id: <1511270333-31002-52-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> References: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'app/testpmd: fix packet throughput after stats reset' has been queued to stable release 17.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 13:22:49 -0000 Hi, FYI, your patch has been queued to stable release 17.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From d26af30a623917b0530dfc87dee42b4b4abee46b Mon Sep 17 00:00:00 2001 From: Wei Zhao Date: Thu, 21 Sep 2017 14:32:23 +0800 Subject: [PATCH] app/testpmd: fix packet throughput after stats reset [ upstream commit 69986a823d789da3745ab6b4ca6d3e84fe76c1b1 ] Testpmd calculates packet throughput by getting a diff of previous stats value and current one. If a stats clear called after previous sample taken, the diff will be negative and throughput calculation will be wrong. If current stats value is smaller than previous one, set throughput to zero. Fixes: 0e106980301d ("app/testpmd: show throughput in port stats") Signed-off-by: Wei Zhao Reviewed-by: Ferruh Yigit --- app/test-pmd/config.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 3ae3e1c..14131d6 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -203,8 +203,10 @@ nic_stats_display(portid_t port_id) if (diff_cycles > 0) diff_cycles = prev_cycles[port_id] - diff_cycles; - diff_pkts_rx = stats.ipackets - prev_pkts_rx[port_id]; - diff_pkts_tx = stats.opackets - prev_pkts_tx[port_id]; + diff_pkts_rx = (stats.ipackets > prev_pkts_rx[port_id]) ? + (stats.ipackets - prev_pkts_rx[port_id]) : 0; + diff_pkts_tx = (stats.opackets > prev_pkts_tx[port_id]) ? + (stats.opackets - prev_pkts_tx[port_id]) : 0; prev_pkts_rx[port_id] = stats.ipackets; prev_pkts_tx[port_id] = stats.opackets; mpps_rx = diff_cycles > 0 ? -- 2.7.4