From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 55FB2A0471 for ; Wed, 17 Jul 2019 06:28:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 98E4D4C94; Wed, 17 Jul 2019 06:28:33 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 97BC82BD5; Wed, 17 Jul 2019 06:28:31 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jul 2019 21:28:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,272,1559545200"; d="scan'208";a="158345527" Received: from dpdk51.sh.intel.com ([10.67.110.245]) by orsmga007.jf.intel.com with ESMTP; 16 Jul 2019 21:28:28 -0700 From: Qi Zhang To: jingjing.wu@intel.com, wenzhuo.lu@intel.com Cc: dev@dpdk.org, Qi Zhang , stable@dpdk.org Date: Wed, 17 Jul 2019 12:31:00 +0800 Message-Id: <20190717043100.46092-1-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 Subject: [dpdk-dev] [PATCH] net/iavf: fix Rx bytes stats X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Exclude 4 bytes CRC for rx bytes stats. This also aligned Rx stats calculation with PF. Fixes: f4a41a6953af ("net/avf: support stats") Cc: stable@dpdk.org Signed-off-by: Qi Zhang --- drivers/net/iavf/iavf_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 53dc05c78..fe75e86ab 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -1047,6 +1047,7 @@ iavf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->imissed = pstats->rx_discards; stats->oerrors = pstats->tx_errors + pstats->tx_discards; stats->ibytes = pstats->rx_bytes; + stats->ibytes -= stats->ipackets * RTE_ETHER_CRC_LEN; stats->obytes = pstats->tx_bytes; } else { PMD_DRV_LOG(ERR, "Get statistics failed"); -- 2.13.6