linux-stable/net
Florian Fainelli badf3ada60 net: dsa: Provide CPU port statistics to master netdev
This patch overloads the DSA master netdev, aka CPU Ethernet MAC to also
include switch-side statistics, which is useful for debugging purposes,
when the switch is not properly connected to the Ethernet MAC (duplex
mismatch, (RG)MII electrical issues etc.).

We accomplish this by retaining the original copy of the master netdev's
ethtool_ops, and just overload the 3 operations we care about:
get_sset_count, get_strings and get_ethtool_stats so as to intercept
these calls and call into the original master_netdev ethtool_ops, plus
our own.

We take this approach as opposed to providing a set of DSA helper
functions that would retrive the CPU port's statistics, because the
entire purpose of DSA is to allow unmodified Ethernet MAC drivers to be
used as CPU conduit interfaces, therefore, statistics overlay in such
drivers would simply not scale.

The new ethtool -S <iface> output would therefore look like this now:
<iface> statistics
p<2 digits cpu port number>_<switch MIB counter names>

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-04-28 17:16:17 -04:00
..
6lowpan
9p
802
8021q
appletalk
atm
ax25
batman-adv
bluetooth Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next 2016-04-26 13:15:56 -04:00
bridge ipv6: rename IP6_INC_STATS_BH() 2016-04-27 22:48:24 -04:00
caif
can
ceph
core tuntap: calculate rps hash only when needed 2016-04-28 16:38:54 -04:00
dcb
dccp net: snmp: kill STATS_BH macros 2016-04-27 22:48:25 -04:00
decnet
dns_resolver
dsa net: dsa: Provide CPU port statistics to master netdev 2016-04-28 17:16:17 -04:00
ethernet
hsr
ieee802154 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next 2016-04-26 13:15:56 -04:00
ipv4 tcp: give prequeue mode some care 2016-04-28 17:14:35 -04:00
ipv6 ipv6: kill ICMP6MSGIN_INC_STATS_BH() 2016-04-27 22:48:25 -04:00
ipx
irda
iucv
kcm
key
l2tp l2tp: use nla_put_u64_64bit() 2016-04-25 15:09:10 -04:00
l3mdev
lapb
llc
mac80211
mac802154
mpls
netfilter netfilter/ipvs: use nla_put_u64_64bit() 2016-04-25 15:09:11 -04:00
netlabel
netlink
netrom
nfc
openvswitch ovs: align nlattr properly when needed 2016-04-26 12:00:48 -04:00
packet
phonet
rds RDS: TCP: Call pskb_extract() helper function 2016-04-25 16:54:14 -04:00
rfkill
rose
rxrpc net: udp: rename UDP_INC_STATS_BH() 2016-04-27 22:48:23 -04:00
sched net: remove NETDEV_TX_LOCKED support 2016-04-26 15:53:05 -04:00
sctp net: rename NET_{ADD|INC}_STATS_BH() 2016-04-27 22:48:24 -04:00
sunrpc net: udp: rename UDP_INC_STATS_BH() 2016-04-27 22:48:23 -04:00
switchdev switchdev: Adding complete operation to deferred switchdev ops 2016-04-24 14:23:32 -04:00
tipc tipc: remove an unnecessary NULL check 2016-04-28 16:54:12 -04:00
unix
vmw_vsock
wimax
wireless wireless: use nla_put_u64_64bit() 2016-04-25 15:09:11 -04:00
x25
xfrm
compat.c
Kconfig
Makefile
socket.c tcp: remove SKBTX_ACK_TSTAMP since it is redundant 2016-04-28 16:06:10 -04:00
sysctl_net.c