netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: Sat, 29 Jul 2023 11:11:48 +0800	[thread overview]
Message-ID: <2c6514a7-db97-f345-9bc4-affd4eba2dda@huawei.com> (raw)
In-Reply-To: <7ce32389-550b-4beb-82b1-1b6183fdeabb@lunn.ch>

Hi Andrew,
I understand what you mean, and sorry for my wrong description. The link
is not always up. If I turn auto-neg off, the link will go down finally.
However, there is an intervel between my operation and the link down. In
my experiment, it may be 1 min or evn 10 mins. The phy state is set to
PHY_UP immediately when I set auto-neg off. And the phy machine check the
state during a very small intervals. Thus, during my experiment, the phy
state has a followed varietion:
PHY_RUNNING -> PHY_UP -> PHY_RUNNING -> PHY_NOLINK.

We print link up/down based on phy state and link state. In aboved case,
It print looks like:
eth0 link down -- because phy state is set to PHY_UP
eth0 link up -- because phy state is set to PHY_RUNNING
eth0 link down -- because link down

This patch wants to fix the first two wrong print.
We will modify this patch description

Thanks!

   Jijie Shao


on 2023/7/28 16:57, Andrew Lunn wrote:
> On Fri, Jul 28, 2023 at 03:58:39PM +0800, Jijie Shao wrote:
>> From: Peiyang Wang <wangpeiyang1@huawei.com>
>>
>> This patch will fix a wrong print "device link down/up". Consider a case
>> that set autoneg to off with same speed and duplex configuration. The link
>> is always up while the phy state is set to PHY_UP and set back to
>> PHY_RUNNING later. It will print link down when the phy state is not
>> PHY_RUNNING. To avoid that, the condition should include PHY_UP.
> Does this really happen? If autoneg is on, and there is link, it means
> the link peer is auto using auto-neg. If you turn auto-neg off, the
> link peer is not going to know what speed to use, and so the link will
> go down. The link will only come up again when you reconfigure the
> link peer to also not use auto-neg.
>
> I don't see how you can turn auto-neg off and not loose the link.
>
>    Andrew

  reply	other threads:[~2023-07-29  3:11 UTC|newest]

Thread overview: 18+ 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  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 [this message]
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
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=2c6514a7-db97-f345-9bc4-affd4eba2dda@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;
as well as URLs for NNTP newsgroup(s).