From: Jijie Shao <shaojijie@huawei.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: <yisen.zhuang@huawei.com>, <salil.mehta@huawei.com>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <shenjian15@huawei.com>,
<wangjie125@huawei.com>, <liuyonglong@huawei.com>,
<wangpeiyang1@huawei.com>, <netdev@vger.kernel.org>,
<stable@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net 5/6] net: hns3: fix wrong print link down up
Date: Thu, 10 Aug 2023 16:06:20 +0800 [thread overview]
Message-ID: <5bd40f2f-7b19-1c49-336a-25da7b574c5e@huawei.com> (raw)
In-Reply-To: <a21beff2-9f38-d354-6049-aed20c18c8d4@huawei.com>
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
next prev parent reply other threads:[~2023-08-10 8:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-28 7:58 [PATCH net 0/6] There are some bugfix for the HNS3 ethernet driver Jijie Shao
2023-07-28 7:58 ` [PATCH net 1/6] net: hns3: fix side effects passed to min_t() Jijie Shao
2023-07-28 8:29 ` David Laight
2023-07-29 2:57 ` Jijie Shao
2023-07-28 7:58 ` [PATCH net 2/6] net: hns3: restore user pause configure when disable autoneg Jijie Shao
2023-07-28 8:05 ` kernel test robot
2023-07-28 7:58 ` [PATCH net 3/6] net: hns3: refactor hclge_mac_link_status_wait for interface reuse Jijie Shao
2023-07-28 7:58 ` [PATCH net 4/6] net: hns3: add wait until mac link down Jijie Shao
2023-07-28 7:58 ` [PATCH net 5/6] net: hns3: fix wrong print link down up Jijie Shao
2023-07-28 8:57 ` Andrew Lunn
2023-07-29 3:11 ` Jijie Shao
2023-07-29 7:57 ` Andrew Lunn
[not found] ` <ef5489f9-43b4-ee59-699b-3f54a30c00aa@huawei.com>
2023-07-29 18:23 ` Andrew Lunn
2023-07-31 9:10 ` Jijie Shao
2023-08-10 8:06 ` Jijie Shao [this message]
2023-10-17 13:03 ` Jijie Shao
2023-10-17 13:59 ` Andrew Lunn
2023-10-18 12:25 ` Jijie Shao
2023-07-28 7:58 ` [PATCH net 6/6] net: hns3: fix deadlock issue when externel_lb and reset are executed together Jijie Shao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5bd40f2f-7b19-1c49-336a-25da7b574c5e@huawei.com \
--to=shaojijie@huawei.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyonglong@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=salil.mehta@huawei.com \
--cc=shenjian15@huawei.com \
--cc=stable@vger.kernel.org \
--cc=wangjie125@huawei.com \
--cc=wangpeiyang1@huawei.com \
--cc=yisen.zhuang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox