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: <046701dbb5c3$58335190$0899f4b0$@trustnetic.com>
Date: Fri, 25 Apr 2025 17:20:53 +0800
From: Jiawen Wu <jiawenwu@...stnetic.com>
To: "'Russell King \(Oracle\)'" <linux@...linux.org.uk>
Cc: <netdev@...r.kernel.org>,
	<pabeni@...hat.com>,
	<kuba@...nel.org>,
	<edumazet@...gle.com>,
	<davem@...emloft.net>,
	<andrew+netdev@...n.ch>,
	<mengyuanlou@...-swift.com>
Subject: RE: [PATCH net] net: libwx: fix to set pause param

On Fri, Apr 25, 2025 3:38 PM, Russell King (Oracle) wrote:
> On Fri, Apr 25, 2025 at 03:09:42PM +0800, Jiawen Wu wrote:
> > @@ -266,11 +266,20 @@ int wx_set_pauseparam(struct net_device *netdev,
> >  		      struct ethtool_pauseparam *pause)
> >  {
> >  	struct wx *wx = netdev_priv(netdev);
> > +	int err;
> >
> >  	if (wx->mac.type == wx_mac_aml)
> >  		return -EOPNOTSUPP;
> >
> > -	return phylink_ethtool_set_pauseparam(wx->phylink, pause);
> > +	err = phylink_ethtool_set_pauseparam(wx->phylink, pause);
> > +	if (err)
> > +		return err;
> > +
> > +	if (wx->fc.rx_pause != pause->rx_pause ||
> > +	    wx->fc.tx_pause != pause->tx_pause)
> > +		return wx_fc_enable(wx, pause->tx_pause, pause->rx_pause);
> 
> Why? phylink_ethtool_set_pauseparam() will cause mac_link_down() +
> mac_link_up() to be called with the new parameters.
> 
> One of the points of phylink is to stop drivers implementing stuff
> buggily - which is exactly what the above is.
> 
> ->rx_pause and ->tx_pause do not set the pause enables unconditionally.
> Please read the documentation in include/uapi/linux/ethtool.h which
> states how these two flags are interpreted, specifically the last
> paragraph of the struct's documentation.
> 
> I'm guessing your change comes from a misunderstanding how the
> interface is supposed to work and you believe that phylink isn't
> implementing it correctly.

You are right.
I should set autoneg off first, although there has no autoneg bit in this link mode.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ