From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id BD1BB1B21A; Wed, 24 Apr 2019 09:46:53 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Apr 2019 00:46:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,389,1549958400"; d="scan'208";a="164555168" Received: from npg-dpdk-cvl-simeisu-116d180.sh.intel.com ([10.67.116.180]) by fmsmga004.fm.intel.com with ESMTP; 24 Apr 2019 00:46:51 -0700 From: simei To: qi.zi.zhang@intel.com, wenzhuo.lu@intel.com, qiming.yang@intel.com Cc: dev@dpdk.org, simei.su@intel.com, stable@dpdk.org Date: Wed, 24 Apr 2019 15:06:10 +0800 Message-Id: <1556089570-44487-1-git-send-email-simei.su@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [DPDK] net/ice: fix Rx statistics 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: , X-List-Received-Date: Wed, 24 Apr 2019 07:46:54 -0000 The RX stats will increase even no packets sent, this patch fix this issue by modifying ipackets and ibytes statistics based on vsi instead of port to avoid statistics error. Fixes: a37bde56314d ("net/ice: support statistics") Cc: stable@dpdk.org Signed-off-by: Simei Su --- drivers/net/ice/ice_ethdev.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 0946b19..1c851ac 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -3305,15 +3305,14 @@ static int ice_rx_queue_intr_disable(struct rte_eth_dev *dev, /* call read registers - updates values, now write them to struct */ ice_read_stats_registers(pf, hw); - stats->ipackets = ns->eth.rx_unicast + - ns->eth.rx_multicast + - ns->eth.rx_broadcast - - ns->eth.rx_discards - + 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 = ns->eth.tx_unicast + ns->eth.tx_multicast + ns->eth.tx_broadcast; - stats->ibytes = ns->eth.rx_bytes; + stats->ibytes = pf->main_vsi->eth_stats.rx_bytes; stats->obytes = ns->eth.tx_bytes; stats->oerrors = ns->eth.tx_errors + pf->main_vsi->eth_stats.tx_errors; -- 1.8.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 740C4A05D3 for ; Wed, 24 Apr 2019 09:46:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 703211B4E0; Wed, 24 Apr 2019 09:46:56 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id BD1BB1B21A; Wed, 24 Apr 2019 09:46:53 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Apr 2019 00:46:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,389,1549958400"; d="scan'208";a="164555168" Received: from npg-dpdk-cvl-simeisu-116d180.sh.intel.com ([10.67.116.180]) by fmsmga004.fm.intel.com with ESMTP; 24 Apr 2019 00:46:51 -0700 From: simei To: qi.zi.zhang@intel.com, wenzhuo.lu@intel.com, qiming.yang@intel.com Cc: dev@dpdk.org, simei.su@intel.com, stable@dpdk.org Date: Wed, 24 Apr 2019 15:06:10 +0800 Message-Id: <1556089570-44487-1-git-send-email-simei.su@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [DPDK] net/ice: fix Rx statistics 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190424070610.6Rx_nPwl21IAulAHM4KHGi4QfQBl3OF7P-2B2vUo8qs@z> The RX stats will increase even no packets sent, this patch fix this issue by modifying ipackets and ibytes statistics based on vsi instead of port to avoid statistics error. Fixes: a37bde56314d ("net/ice: support statistics") Cc: stable@dpdk.org Signed-off-by: Simei Su --- drivers/net/ice/ice_ethdev.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 0946b19..1c851ac 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -3305,15 +3305,14 @@ static int ice_rx_queue_intr_disable(struct rte_eth_dev *dev, /* call read registers - updates values, now write them to struct */ ice_read_stats_registers(pf, hw); - stats->ipackets = ns->eth.rx_unicast + - ns->eth.rx_multicast + - ns->eth.rx_broadcast - - ns->eth.rx_discards - + 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 = ns->eth.tx_unicast + ns->eth.tx_multicast + ns->eth.tx_broadcast; - stats->ibytes = ns->eth.rx_bytes; + stats->ibytes = pf->main_vsi->eth_stats.rx_bytes; stats->obytes = ns->eth.tx_bytes; stats->oerrors = ns->eth.tx_errors + pf->main_vsi->eth_stats.tx_errors; -- 1.8.3.1