From patchwork Fri Oct 30 06:09:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xutao Sun X-Patchwork-Id: 8320 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 6D21F8DAC; Fri, 30 Oct 2015 07:09:39 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 0259D8DA2 for ; Fri, 30 Oct 2015 07:09:37 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 29 Oct 2015 23:09:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,217,1444719600"; d="scan'208";a="807217842" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 29 Oct 2015 23:09:36 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t9U69YGA004195; Fri, 30 Oct 2015 14:09:34 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t9U69UMv029255; Fri, 30 Oct 2015 14:09:32 +0800 Received: (from xutaosun@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9U69UAQ029251; Fri, 30 Oct 2015 14:09:30 +0800 From: Xutao Sun To: dev@dpdk.org Date: Fri, 30 Oct 2015 14:09:29 +0800 Message-Id: <1446185369-29221-1-git-send-email-xutao.sun@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1446105751-28018-1-git-send-email-xutao.sun@intel.com> References: <1446105751-28018-1-git-send-email-xutao.sun@intel.com> Subject: [dpdk-dev] [PATCH v4] i40e: Fix the statistics issue of i40e 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" The old statistics on i40e only counted the packets on ports. So the discarding packets on VSI were not counted. This patch is to make statistics for packets both on ports and VSI. Also update release notes. Signed-off-by: Xutao Sun --- v2: - reword comments v3: - update release notes v4: - fix the wrong release notes and move the doc as part of this patch doc/guides/rel_notes/release_2_2.rst | 4 ++++ drivers/net/i40e/i40e_ethdev.c | 23 ++++++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/doc/guides/rel_notes/release_2_2.rst b/doc/guides/rel_notes/release_2_2.rst index 682f468..e80c20d 100644 --- a/doc/guides/rel_notes/release_2_2.rst +++ b/doc/guides/rel_notes/release_2_2.rst @@ -8,6 +8,10 @@ New Features Resolved Issues --------------- +* **i40e: Fix statistics of packets.** + + Add discarding packets on VSI to the stats and rectify the old statistics. + Known Issues ------------ diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 40b0526..5e20fa7 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1511,21 +1511,26 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) if (pf->main_vsi) i40e_update_vsi_stats(pf->main_vsi); - stats->ipackets = ns->eth.rx_unicast + ns->eth.rx_multicast + - ns->eth.rx_broadcast; - stats->opackets = ns->eth.tx_unicast + ns->eth.tx_multicast + - ns->eth.tx_broadcast; - stats->ibytes = ns->eth.rx_bytes; - stats->obytes = ns->eth.tx_bytes; - stats->oerrors = ns->eth.tx_errors; - stats->imcasts = ns->eth.rx_multicast; + 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; + stats->opackets = pf->main_vsi->eth_stats.tx_unicast + + pf->main_vsi->eth_stats.tx_multicast + + pf->main_vsi->eth_stats.tx_broadcast; + stats->ibytes = pf->main_vsi->eth_stats.rx_bytes; + stats->obytes = pf->main_vsi->eth_stats.tx_bytes; + stats->oerrors = ns->eth.tx_errors + + pf->main_vsi->eth_stats.tx_errors; + stats->imcasts = pf->main_vsi->eth_stats.rx_multicast; stats->fdirmatch = ns->fd_sb_match; /* Rx Errors */ stats->ibadcrc = ns->crc_errors; stats->ibadlen = ns->rx_length_errors + ns->rx_undersize + ns->rx_oversize + ns->rx_fragments + ns->rx_jabber; - stats->imissed = ns->eth.rx_discards; + stats->imissed = ns->eth.rx_discards + + pf->main_vsi->eth_stats.rx_discards; stats->ierrors = stats->ibadcrc + stats->ibadlen + stats->imissed; PMD_DRV_LOG(DEBUG, "***************** PF stats start *******************");