Merge branch 'net-dsa-microchip-add-MIB-counters-support'
authorDavid S. Miller <davem@davemloft.net>
Mon, 25 Feb 2019 01:49:59 +0000 (17:49 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Feb 2019 01:49:59 +0000 (17:49 -0800)
commit731e7ccb1d22f79463215bec8f9c90f92c0fb51b
treec26ad7257c1ff015e2f2b9a6bdb55cb67874ea1a
parent84f29264551eb75cc686c3f748ac70b987b95837
parent7049f9b5d0529a8fefaae681e57baeb31bd2d40a
Merge branch 'net-dsa-microchip-add-MIB-counters-support'

Tristram Ha says:

====================
net: dsa: microchip: add MIB counters support

This series of patches is to modify the KSZ9477 DSA driver to read MIB
counters periodically to avoid overflow.

The MIB counters should be read only when there is link.  Otherwise it is
a waste of time as hardware never increases the counters.

Functions are added to check the port link status so that MIB counters
read call is used efficiently.

v4
- Use readx_poll_timeout
- Fix using mutex in a timer callback function problem
- use dp->slave directly instead of checking whether it is valid
- Add port_cleanup function in a separate patch
- Add a mutex so that changing device variables is safe

v3
- Use netif_carrier_ok instead of checking the phy device pointer

v2
- Create macro similar to readx_poll_timeout to use with switch
- Create ksz_port_cleanup function so that variables like on_ports and
  live_ports can be updated inside it

v1
- Use readx_poll_timeout
- Do not clear MIB counters when port is enabled
- Do not advertise 1000 half-duplex mode when port is enabled
- Do not use freeze function as MIB counters may miss counts
====================

Signed-off-by: David S. Miller <davem@davemloft.net>