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

2019-02-25 Thread Pavel Machek
On Wed 2019-02-20 15:49:25, Joe Perches wrote: > On Tue, 2019-02-12 at 19:51 -0800, Florian Fainelli wrote: > > On February 12, 2019 6:39:49 PM PST, tristram...@microchip.com wrote: > > > > > +static void ksz9477_freeze_mib(struct ksz_device *dev, int port, > > > > > + b

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

2019-02-20 Thread Joe Perches
On Tue, 2019-02-12 at 19:51 -0800, Florian Fainelli wrote: > On February 12, 2019 6:39:49 PM PST, tristram...@microchip.com wrote: > > > > +static void ksz9477_freeze_mib(struct ksz_device *dev, int port, > > > > + bool freeze) > > > > +{ > > > > + struct ksz_por

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

2019-02-14 Thread Florian Fainelli
On 2/14/19 11:26 AM, tristram...@microchip.com wrote: > + /* read only dropped counters when link is not up */ > + if (p->link_just_down) > + p->link_just_down = 0; > + else if (!p->phydev.link) > + mib->cnt_ptr = dev->reg_

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

2019-02-14 Thread Tristram.Ha
> >> > +/* read only dropped counters when link is not up */ > >> > +if (p->link_just_down) > >> > +p->link_just_down = 0; > >> > +else if (!p->phydev.link) > >> > +mib->cnt_ptr = dev->reg_mib_cnt; > >>

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

2019-02-12 Thread Florian Fainelli
On February 12, 2019 6:39:49 PM PST, tristram...@microchip.com wrote: >> > +static void ksz9477_freeze_mib(struct ksz_device *dev, int port, >bool >> freeze) >> > +{ >> > + struct ksz_port *p = &dev->ports[port]; >> > + u32 val = freeze ? MIB_COUNTER_FLUSH_FREEZE : 0; >> >> Reverse Christmas

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

2019-02-12 Thread Andrew Lunn
> All of the MIB counters, except some that may be marked by driver, > do not get updated when the link is down, so it is a waste of time > to read them. Hi Tristram O.K, so make this clear in the code. Maybe rather than having this link_just_down, have the adjust link callback update the cached

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

2019-02-12 Thread Tristram.Ha
> > +static void ksz9477_freeze_mib(struct ksz_device *dev, int port, bool > freeze) > > +{ > > + struct ksz_port *p = &dev->ports[port]; > > + u32 val = freeze ? MIB_COUNTER_FLUSH_FREEZE : 0; > > Reverse Christmas tree. There was a checkpatch.pl patch in 2016 that tried to check this, but it

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

2019-02-09 Thread Andrew Lunn
On Thu, Feb 07, 2019 at 08:07:07PM -0800, tristram...@microchip.com wrote: > From: Tristram Ha > > Add MIB counter reading support. > > Signed-off-by: Tristram Ha > --- > drivers/net/dsa/microchip/ksz9477.c| 139 > +++-- > drivers/net/dsa/microchip/ksz_common.c

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

2019-02-07 Thread Tristram.Ha
From: Tristram Ha Add MIB counter reading support. Signed-off-by: Tristram Ha --- drivers/net/dsa/microchip/ksz9477.c| 139 +++-- drivers/net/dsa/microchip/ksz_common.c | 96 +++ drivers/net/dsa/microchip/ksz_common.h | 2 + drivers/net/ds