Re: [PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread David Ahern
On 1/17/18 3:06 PM, Florian Fainelli wrote: > diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c > index 7bf8b85ade16..9f732c3dc2ce 100644 > --- a/net/core/net-sysfs.c > +++ b/net/core/net-sysfs.c > @@ -295,10 +295,29 @@ static ssize_t carrier_changes_show(struct device *dev, > struct

Re: [PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread David Ahern
On 1/17/18 3:06 PM, Florian Fainelli wrote: > diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c > index 7bf8b85ade16..9f732c3dc2ce 100644 > --- a/net/core/net-sysfs.c > +++ b/net/core/net-sysfs.c > @@ -295,10 +295,29 @@ static ssize_t carrier_changes_show(struct device *dev, > struct

Re: [PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread Andrei Vagin
On Thu, Jan 18, 2018 at 01:06:52AM +0100, Andrew Lunn wrote: > > What is the idea to have two separate counters? Can a delta between them > > be a bigger than 1? > > Yes, it can. > > These counters are incremented in netif_carrier_on() / > netif_carrier_off(). They are not always called in pairs

Re: [PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread Andrei Vagin
On Thu, Jan 18, 2018 at 01:06:52AM +0100, Andrew Lunn wrote: > > What is the idea to have two separate counters? Can a delta between them > > be a bigger than 1? > > Yes, it can. > > These counters are incremented in netif_carrier_on() / > netif_carrier_off(). They are not always called in pairs

Re: [PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread David Ahern
On 1/17/18 3:52 PM, Jiri Pirko wrote: > Thu, Jan 18, 2018 at 12:06:57AM CET, f.faine...@gmail.com wrote: >> From: David Decotigny >> >> Expose the number of times the link has been going UP or DOWN, and >> update the "carrier_changes" counter to be the sum of these two events.

Re: [PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread David Ahern
On 1/17/18 3:52 PM, Jiri Pirko wrote: > Thu, Jan 18, 2018 at 12:06:57AM CET, f.faine...@gmail.com wrote: >> From: David Decotigny >> >> Expose the number of times the link has been going UP or DOWN, and >> update the "carrier_changes" counter to be the sum of these two events. >> While at it,

Re: [PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread Andrew Lunn
> What is the idea to have two separate counters? Can a delta between them > be a bigger than 1? Yes, it can. These counters are incremented in netif_carrier_on() / netif_carrier_off(). They are not always called in pairs and they can be called multiple times for the same event. The phylib will

Re: [PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread Andrew Lunn
> What is the idea to have two separate counters? Can a delta between them > be a bigger than 1? Yes, it can. These counters are incremented in netif_carrier_on() / netif_carrier_off(). They are not always called in pairs and they can be called multiple times for the same event. The phylib will

Re: [PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread Jiri Pirko
Thu, Jan 18, 2018 at 12:06:57AM CET, f.faine...@gmail.com wrote: >From: David Decotigny > >Expose the number of times the link has been going UP or DOWN, and >update the "carrier_changes" counter to be the sum of these two events. >While at it, also update the sysfs-class-net

Re: [PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread Jiri Pirko
Thu, Jan 18, 2018 at 12:06:57AM CET, f.faine...@gmail.com wrote: >From: David Decotigny > >Expose the number of times the link has been going UP or DOWN, and >update the "carrier_changes" counter to be the sum of these two events. >While at it, also update the sysfs-class-net documentation to

Re: [PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread Andrei Vagin
On Wed, Jan 17, 2018 at 03:06:57PM -0800, Florian Fainelli wrote: > From: David Decotigny > > Expose the number of times the link has been going UP or DOWN, and > update the "carrier_changes" counter to be the sum of these two events. > While at it, also update the

Re: [PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread Andrei Vagin
On Wed, Jan 17, 2018 at 03:06:57PM -0800, Florian Fainelli wrote: > From: David Decotigny > > Expose the number of times the link has been going UP or DOWN, and > update the "carrier_changes" counter to be the sum of these two events. > While at it, also update the sysfs-class-net documentation

Re: [PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread Jakub Kicinski
On Wed, 17 Jan 2018 15:06:57 -0800, Florian Fainelli wrote: > +What:/sys/class/net// ?

Re: [PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread Jakub Kicinski
On Wed, 17 Jan 2018 15:06:57 -0800, Florian Fainelli wrote: > +What:/sys/class/net// ?

[PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread Florian Fainelli
From: David Decotigny Expose the number of times the link has been going UP or DOWN, and update the "carrier_changes" counter to be the sum of these two events. While at it, also update the sysfs-class-net documentation to cover: carrier_changes (3.15), count_link_up (4.16)

[PATCH net-next] net: core: Expose number of link up/down transitions

2018-01-17 Thread Florian Fainelli
From: David Decotigny Expose the number of times the link has been going UP or DOWN, and update the "carrier_changes" counter to be the sum of these two events. While at it, also update the sysfs-class-net documentation to cover: carrier_changes (3.15), count_link_up (4.16) and count_link_down