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

From: Andrew Lunn
Date: Wed Jan 17 2018 - 19:08:36 EST


> 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 call them
when it notices the PHY saying the link is down/up, and the MAC driver
sometimes also calls them.

Andrew