public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Guangbin Huang <huangguangbin2@huawei.com>
Cc: davem@davemloft.net, kuba@kernel.org, wangjie125@huawei.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	lipeng321@huawei.com, chenhao288@hisilicon.com
Subject: Re: [PATCH net 1/7] net: hns3: fix pause config problem after autoneg disabled
Date: Wed, 27 Oct 2021 19:23:15 +0200	[thread overview]
Message-ID: <YXmLA4AbY83UV00f@lunn.ch> (raw)
In-Reply-To: <20211027121149.45897-2-huangguangbin2@huawei.com>

On Wed, Oct 27, 2021 at 08:11:43PM +0800, Guangbin Huang wrote:

The semantics are not too well defined here, the ethtool documentation
is not too clear. Here is how i interpret it.

> If a TP port is configured by follow steps:
> 1.ethtool -s ethx autoneg off speed 100 duplex full

So you turn general autoneg off

> 2.ethtool -A ethx rx on tx on

You did not use autoneg off here. Pause autoneg is separate to general
autoneg. So pause autoneg is still enabled at this point. That means
you should not directly configure the MAC with the pause
configuration, you only do that when pause autoneg is off. You can
consider this as setting how you want pause to be negotiated once
general autoneg is re-enabled.

> 3.ethtool -s ethx autoneg on(rx&tx negotiated pause results are off)

So you reenable general autoneg. As part of that general autoneg,
pause will re-renegotiated, and it should you the preferences you set
in 2, that rx and tx pause can be used. What is actually used depends
on the link peer. The link_adjust callback from phylib tells you how
to program the MAC.

> 4.ethtool -s ethx autoneg off speed 100 duplex full

So you turn general autoneg off again. It is unclear how you are
supposed to program the MAC, but i guess most systems keep with the
result from the last autoneg.

Looking at your patch, there are suspicious calls to phy_syspend and
phy_resume. They don't look correct at all, and i'm not aware of any
other MAC driver doing this. Now, i know the behaviour is not well
defined here, but i'm not sure your interpretation is valid and how
others interpret it.

       Andrew

  reply	other threads:[~2021-10-27 17:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 12:11 [PATCH net 0/7] net: hns3: add some fixes for -net Guangbin Huang
2021-10-27 12:11 ` [PATCH net 1/7] net: hns3: fix pause config problem after autoneg disabled Guangbin Huang
2021-10-27 17:23   ` Andrew Lunn [this message]
2021-10-28 11:54     ` huangguangbin (A)
2021-10-28 12:30       ` Andrew Lunn
2021-10-28 13:14         ` huangguangbin (A)
2021-10-27 12:11 ` [PATCH net 2/7] net: hns3: change hclge/hclgevf workqueue to WQ_UNBOUND mode Guangbin Huang
2021-10-27 12:11 ` [PATCH net 3/7] net: hns3: ignore reset event before initialization process is done Guangbin Huang
2021-10-27 12:11 ` [PATCH net 4/7] net: hns3: fix data endian problem of some functions of debugfs Guangbin Huang
2021-10-27 12:11 ` [PATCH net 5/7] net: hns3: add more string spaces for dumping packets number of queue info in debugfs Guangbin Huang
2021-10-27 12:11 ` [PATCH net 6/7] net: hns3: expand buffer len for some debugfs command Guangbin Huang
2021-10-27 12:11 ` [PATCH net 7/7] net: hns3: adjust string spaces of some parameters of tx bd info in debugfs Guangbin Huang
2021-10-27 13:50 ` [PATCH net 0/7] net: hns3: add some fixes for -net patchwork-bot+netdevbpf

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=YXmLA4AbY83UV00f@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=chenhao288@hisilicon.com \
    --cc=davem@davemloft.net \
    --cc=huangguangbin2@huawei.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lipeng321@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=wangjie125@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