Skip to content

Commit

Permalink
tg3: don't clear stats while tg3_close
Browse files Browse the repository at this point in the history
Now tg3 NIC's stats will be cleared after ifdown/ifup. bond_get_stats traverse
its salves to get statistics,cumulative the increment.If a tg3 NIC is added to
bonding as a slave,ifdown/ifup will cause bonding's stats become tremendous value
(ex.1638.3 PiB) because of negative increment.

Fixes: 92feeab ("tg3: Save stats across chip resets")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
YueHaibing authored and David S. Miller committed May 3, 2017
1 parent 1c2dd16 commit 37a7fdf
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/net/ethernet/broadcom/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -11729,10 +11729,6 @@ static int tg3_close(struct net_device *dev)

tg3_stop(tp);

/* Clear stats across close / open calls */
memset(&tp->net_stats_prev, 0, sizeof(tp->net_stats_prev));
memset(&tp->estats_prev, 0, sizeof(tp->estats_prev));

if (pci_device_is_present(tp->pdev)) {
tg3_power_down_prepare(tp);

Expand Down

0 comments on commit 37a7fdf

Please sign in to comment.