]> git.baikalelectronics.ru Git - kernel.git/commit
net: systemport: Fix 64-bit statistics dependency
authorFlorian Fainelli <f.fainelli@gmail.com>
Mon, 18 Sep 2017 23:31:30 +0000 (16:31 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Sep 2017 03:58:45 +0000 (20:58 -0700)
commitff5ea9bce5ec68a660b686706c7d1f5edea4f714
tree84fe6a2b4cdaa6f08bad6f3c45cde019eb4db779
parent156c866f22f474494a8d36988e4475316beb1c97
net: systemport: Fix 64-bit statistics dependency

There are several problems with commit 430da827d67f ("net: systemport:
Support 64bit statistics", first one got fixed in 25ea6e698cdb ("net:
systemport: Fix 64-bit stats deadlock").

The second problem is that this specific code updates the
stats64.tx_{packets,bytes} from ndo_get_stats64() and that is what we
are returning to ethtool -S. If we are not running a tool that involves
calling ndo_get_stats64(), then we won't get updated ethtool stats.

The solution to this is to update the stats from both call sites,
factoring that into a specific function, While at it, don't just check
the sizeof() but also the type of the statistics in order to use the
64-bit stats seqlock.

Fixes: 430da827d67f ("net: systemport: Support 64bit statistics")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcmsysport.c