[<prev] [next>] [day] [month] [year] [list]
Message-ID: <ec9b998eae874abf96ec8f378aea2610@bgmail102.nvidia.com>
Date: Thu, 31 Aug 2017 06:03:10 +0000
From: Bhadram Varka <vbhadram@...dia.com>
To: "andrew@...n.ch" <andrew@...n.ch>,
"f.fainelli@...il.com" <f.fainelli@...il.com>
CC: linux-netdev <netdev@...r.kernel.org>
Subject: RE: netdev carrier changes is one even after ethernet link up.
+ netdev
From: Bhadram Varka
Sent: Thursday, August 31, 2017 11:24 AM
To: 'andrew@...n.ch' <andrew@...n.ch>; 'f.fainelli@...il.com' <f.fainelli@...il.com>
Cc: linux-netdev <netdev@...r.kernel.org>
Subject: netdev carrier changes is one even after ethernet link up.
Hi,
I have observed that carrier_changes is one even in case of the ethernet link is up.
After investigating the code below is my observation -
ethernet_driver_probe()
+--->phy_connect()
| +--->phy_attach_direct()
| +---> netif_carrier_off() : which increments carrier_changes to one.
+--->register_netdevice() : will the carrier_changes becomes zero here ?
+--->netif_carrier_off(): not increment the carrier_changes since __LINK_STATE_NOCARRIER already set.
>From ethernet driver open will start the PHY and trigger the phy_state_machine.
Phy_state_machine workqueue calling netif_carrier_on() once the link is UP.
netif_carrier_on() increments the carrier_changes by one.
After link is UP if we check the carrier_changes sysfs node - it will be one only.
$ cat /sys/class/net/eth0/carrier_changes
1
After reverting the change - https://lkml.org/lkml/2016/1/9/173 (net: phy: turn carrier off on phy attach) then I could see the carrier changes incremented to 2 after Link UP.
$ cat /sys/class/net/eth0/carrier_changes
2
Thanks,
Bhadram.
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
Powered by blists - more mailing lists