Re: [PATCH v2 net-next 2/4] net: dsa: microchip: add MIB counter reading support

2019-02-20 Thread Florian Fainelli
On 2/20/19 7:08 AM, Andrew Lunn wrote: >> +static void mib_monitor(struct timer_list *t) >> +{ >> +struct ksz_device *dev = from_timer(dev, t, mib_read_timer); >> +const struct dsa_port *dp; >> +struct net_device *netdev; >> +struct ksz_port_mib *mib; >> +struct ksz_port *p; >>

Re: [PATCH v2 net-next 2/4] net: dsa: microchip: add MIB counter reading support

2019-02-20 Thread Andrew Lunn
> +static void mib_monitor(struct timer_list *t) > +{ > + struct ksz_device *dev = from_timer(dev, t, mib_read_timer); > + const struct dsa_port *dp; > + struct net_device *netdev; > + struct ksz_port_mib *mib; > + struct ksz_port *p; > + int i; > + > + mod_timer(&dev->m

[PATCH v2 net-next 2/4] net: dsa: microchip: add MIB counter reading support

2019-02-19 Thread Tristram.Ha
From: Tristram Ha Add background MIB counter reading support. Port MIB counters should only be read when there is link. Otherwise it is a waste of time as hardware never increases those counters. There are exceptions as some switches keep track of dropped counts no matter waht. Signed-off-by: