From patchwork Fri Jul 29 08:50:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhao1, Wei" X-Patchwork-Id: 15048 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 41984559C; Fri, 29 Jul 2016 10:52:21 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B3D9A559A for ; Fri, 29 Jul 2016 10:52:19 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 29 Jul 2016 01:52:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.28,438,1464678000"; d="scan'208"; a="1031379802" Received: from dpdk2.bj.intel.com ([172.16.182.189]) by fmsmga002.fm.intel.com with ESMTP; 29 Jul 2016 01:52:18 -0700 From: Wei Zhao1 To: dev@dpdk.org Cc: Wei Zhao1 Date: Fri, 29 Jul 2016 16:50:39 +0800 Message-Id: <1469782239-48758-1-git-send-email-wei.zhao1@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [dpdk-dev] [PATCH v2] net/i40e: fix Rx statistic inconsistent 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" rx_good_bytes and rx_good_packets statistic is inconsistent when port stopped,ipackets statistic is minus the discard packets but rx_bytes statistic not.Also,i40e has no statistic of discard bytes, so we have to delete discard packets item from rx_good_packets statistic. Fixes: 9aace75fc82e ("i40e: fix statistics") Signed-off-by: Wei Zhao1 --- drivers/net/i40e/i40e_ethdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 11a5804..553dfd9 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2319,8 +2319,7 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->ipackets = pf->main_vsi->eth_stats.rx_unicast + pf->main_vsi->eth_stats.rx_multicast + - pf->main_vsi->eth_stats.rx_broadcast - - pf->main_vsi->eth_stats.rx_discards; + pf->main_vsi->eth_stats.rx_broadcast; stats->opackets = pf->main_vsi->eth_stats.tx_unicast + pf->main_vsi->eth_stats.tx_multicast + pf->main_vsi->eth_stats.tx_broadcast;