Commit f3e27784 authored by Igor Russkikh's avatar Igor Russkikh Committed by David S. Miller

net: aquantia: Update hw counters on hw init

On very first start we should read out current HW counter values
to make diff based calculations later.
This also should be done each time NIC gets down/up or wakes up
after sleep state. We reset link state explicitly to prevent diffs
from being summed this first time.
Signed-off-by: default avatarIgor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fdb4a083
...@@ -344,6 +344,10 @@ static int hw_atl_a0_hw_init(struct aq_hw_s *self, ...@@ -344,6 +344,10 @@ 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_set(self, &aq_nic_cfg->aq_rss);
hw_atl_a0_hw_rss_hash_set(self, &aq_nic_cfg->aq_rss); hw_atl_a0_hw_rss_hash_set(self, &aq_nic_cfg->aq_rss);
/* Reset link status and read out initial hardware counters */
self->aq_link_status.mbps = 0;
hw_atl_utils_update_stats(self);
err = aq_hw_err_from_flags(self); err = aq_hw_err_from_flags(self);
if (err < 0) if (err < 0)
goto err_exit; goto err_exit;
......
...@@ -397,6 +397,10 @@ static int hw_atl_b0_hw_init(struct aq_hw_s *self, ...@@ -397,6 +397,10 @@ static int hw_atl_b0_hw_init(struct aq_hw_s *self,
*/ */
aq_hw_write_reg(self, tx_dma_total_req_limit_adr, 24); aq_hw_write_reg(self, tx_dma_total_req_limit_adr, 24);
/* Reset link status and read out initial hardware counters */
self->aq_link_status.mbps = 0;
hw_atl_utils_update_stats(self);
err = aq_hw_err_from_flags(self); err = aq_hw_err_from_flags(self);
if (err < 0) if (err < 0)
goto err_exit; goto err_exit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment