Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tg3: don't clear stats while tg3_close

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: 92feeabf3f67 ("tg3: Save stats across chip resets")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

YueHaibing and committed by
David S. Miller
37a7fdf2 1c2dd16a

-4
-4
drivers/net/ethernet/broadcom/tg3.c
··· 11729 11729 11730 11730 tg3_stop(tp); 11731 11731 11732 - /* Clear stats across close / open calls */ 11733 - memset(&tp->net_stats_prev, 0, sizeof(tp->net_stats_prev)); 11734 - memset(&tp->estats_prev, 0, sizeof(tp->estats_prev)); 11735 - 11736 11732 if (pci_device_is_present(tp->pdev)) { 11737 11733 tg3_power_down_prepare(tp); 11738 11734