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: <YXmLA4AbY83UV00f@lunn.ch>
Date:   Wed, 27 Oct 2021 19:23:15 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Guangbin Huang <huangguangbin2@...wei.com>
Cc:     davem@...emloft.net, kuba@...nel.org, wangjie125@...wei.com,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        lipeng321@...wei.com, chenhao288@...ilicon.com
Subject: Re: [PATCH net 1/7] net: hns3: fix pause config problem after
 autoneg disabled

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ