[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <99425adad58a8ed133edc1a2b5ec8fec70e56e36.1512994559.git.igor.russkikh@aquantia.com>
Date: Mon, 11 Dec 2017 15:16:24 +0300
From: Igor Russkikh <igor.russkikh@...antia.com>
To: "David S . Miller" <davem@...emloft.net>
Cc: netdev@...r.kernel.org, David Arcari <darcari@...hat.com>,
Pavel Belous <pavel.belous@...antia.com>,
Nadezhda Krupnina <Nadezhda.Krupnina@...antia.com>,
Simon Edelhaus <simon.edelhaus@...antia.com>,
Igor Russkikh <igor.russkikh@...antia.com>
Subject: [PATCH net v2 7/9] net: aquantia: Reset driver level statistics to zero on initialization
Signed-off-by: Igor Russkikh <igor.russkikh@...antia.com>
---
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c | 7 +++++++
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
index b0abd18..331e7b8 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
@@ -344,6 +344,13 @@ static int hw_atl_a0_hw_init(struct aq_hw_s *self,
hw_atl_a0_hw_rss_set(self, &aq_nic_cfg->aq_rss);
hw_atl_a0_hw_rss_hash_set(self, &aq_nic_cfg->aq_rss);
+ /* Read initial hardware counters
+ * and reset current in-driver statistics
+ */
+ hw_atl_utils_update_stats(self);
+ memset(&PHAL_ATLANTIC_A0->curr_stats, 0,
+ sizeof(PHAL_ATLANTIC_A0->curr_stats));
+
err = aq_hw_err_from_flags(self);
if (err < 0)
goto err_exit;
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
index 36fddb1..1137034 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
@@ -397,6 +397,13 @@ static int hw_atl_b0_hw_init(struct aq_hw_s *self,
*/
aq_hw_write_reg(self, tx_dma_total_req_limit_adr, 24);
+ /* Read initial hardware counters
+ * and reset current in-driver statistics
+ */
+ hw_atl_utils_update_stats(self);
+ memset(&PHAL_ATLANTIC_B0->curr_stats, 0,
+ sizeof(PHAL_ATLANTIC_B0->curr_stats));
+
err = aq_hw_err_from_flags(self);
if (err < 0)
goto err_exit;
--
2.7.4
Powered by blists - more mailing lists