lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5bd40f2f-7b19-1c49-336a-25da7b574c5e@huawei.com>
Date: Thu, 10 Aug 2023 16:06:20 +0800
From: Jijie Shao <shaojijie@...wei.com>
To: Andrew Lunn <andrew@...n.ch>
CC: <yisen.zhuang@...wei.com>, <salil.mehta@...wei.com>,
	<davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
	<pabeni@...hat.com>, <shenjian15@...wei.com>, <wangjie125@...wei.com>,
	<liuyonglong@...wei.com>, <wangpeiyang1@...wei.com>,
	<netdev@...r.kernel.org>, <stable@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net 5/6] net: hns3: fix wrong print link down up


on 2023/7/31 17:10, Jijie Shao wrote:
> What PHY driver is this?
>>
>> It is not so clear what should actually happen with auto-neg turned
>> off. With it on, and the link going down, the PHY should react after
>> about 1 second. It is not supposed to react faster than that, although
>> some PHYs allow fast link down notification to be configured.
>>
>> Have you checked 802.3 to see what it says about auto-neg off and link
>> down detection?
>>
>> I personally would not suppress this behaviour in the MAC
>> driver. Otherwise you are going to have funny combinations of special
>> cases of a feature which very few people actually use, making your
>> maintenance costs higher.
>>
>>         Andrew

Hi Andrew,
We trace how the PHY state machine changed and show as followed:

[ 1974.220847][ T362] hns3 0000:35:00.0 eth1: set link(phy): autoneg=0, 
speed=100, duplex=1
[ 1974.233694][ T362] hns3 0000:35:00.0 eth1: link down
[ 1974.267444][ T32] RTL8211F Gigabit Ethernet mii-0000:35:00.0:02: PHY 
state change UP -> RUNNING
[ 1974.892830][ T7] hns3 0000:35:00.0 eth1: link up
[ 2004.277425][ T32] RTL8211F Gigabit Ethernet mii-0000:35:00.0:02: PHY 
state change RUNNING -> NOLINK
[ 2004.797731][ T7] hns3 0000:35:00.0 eth1: link down

Meanwhile, we also open tracing event about mdio and here are some 
useful logs:

kworker/1:0-19 [001] .... 1973.329775: mdio_access: mii-0000:35:00.0 
read phy:0x02 reg:0x00 val:0x1040
kworker/1:0-19 [001] .... 1973.331964: mdio_access: mii-0000:35:00.0 
read phy:0x02 reg:0x01 val:0x79ad
kworker/2:1-32 [002] .... 1974.247627: mdio_access: mii-0000:35:00.0 
read phy:0x02 reg:0x00 val:0x1040
kworker/2:1-32 [002] .... 1974.249870: mdio_access: mii-0000:35:00.0 
write phy:0x02 reg:0x00 val:0x2100
kworker/2:1-32 [002] .... 1974.252069: mdio_access: mii-0000:35:00.0 
read phy:0x02 reg:0x00 val:0x2100
kworker/2:1-32 [002] .... 1974.254143: mdio_access: mii-0000:35:00.0 
read phy:0x02 reg:0x01 val:0x798d
....
kworker/2:1-32 [002] .... 2003.240015: mdio_access: mii-0000:35:00.0 
read phy:0x02 reg:0x01 val:0x798d
....
kworker/2:1-32 [002] .... 2004.269525: mdio_access: mii-0000:35:00.0 
read phy:0x02 reg:0x01 val:0x7989

As you can see, the link state changed after 30 seconds when only 
setting autoneg off. When the BMSR changed, the PHY driver change state 
immediately. This patch wants to fixed the first link down up showed on 
logs cause the link do not changed.


Regards
Jijie Shao


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ