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]
Date:   Tue, 11 Apr 2023 17:28:49 +0300
From:   Vladimir Oltean <olteanv@...il.com>
To:     "Russell King (Oracle)" <linux@...linux.org.uk>
Cc:     Oleksij Rempel <o.rempel@...gutronix.de>,
        Andrew Lunn <andrew@...n.ch>,
        Woojung Huh <woojung.huh@...rochip.com>,
        Arun Ramadoss <arun.ramadoss@...rochip.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        netdev@...r.kernel.org, UNGLinuxDriver@...rochip.com,
        Eric Dumazet <edumazet@...gle.com>, kernel@...gutronix.de,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        "David S. Miller" <davem@...emloft.net>
Subject: Re: FWD: Re: [PATCH net-next v1 1/1] net: dsa: microchip: ksz8: Make
 flow control, speed, and duplex on CPU port configurable

On Tue, Apr 11, 2023 at 02:33:00PM +0100, Russell King (Oracle) wrote:
> On Tue, Apr 11, 2023 at 04:26:17PM +0300, Vladimir Oltean wrote:
> > On Tue, Apr 11, 2023 at 01:00:43PM +0100, Russell King (Oracle) wrote:
> > > 	ethtool --pause ... autoneg on
> > > 	ethtool --pause ... autoneg off rx off tx off
> > > 	ethtool --pause ... autoneg off rx on tx on
> > > 
> > > Anything else wouldn't give the result the user wants, because there's
> > > no way to independently force rx and tx flow control per port.
> > 
> > Right.
> > 
> > > That said, phylink doesn't give enough information to make the above
> > > possible since the force bit depends on (tx && rx &&!permit_pause_to_mac)
> > 
> > So, since the "permit_pause_to_mac" information is missing here, I guess
> > the next logical step based on what you're saying is that it's a matter
> > of not using the pcs_config() API, or am I misunderstanding again? :)
> 
> pcs_config() doesn't get the "tx" and "rx" above. mac_link_up() does,
> but doesn't get the "permit_pause_to_mac" (since that's supposed to
> be a "configuration" thing.)

Ah, ok. So it would be more complicated to plumb all information through
in a reliable way.

> Anyway, I think this is now moot since I think we've agreed on a way
> forward for this hardware.

I would say we've agreed on something that does not impose practical
limitations for internal PHY ports.

The xMII port (usually fixed-link) has its own flow control
configuration, through Register 6 (0x06): Global Control 4, and that
seems to not distinguish between TX and RX either. We're okay with
setting that single bit based on "rx_pause || tx_pause", right?

> > > So, because this hardware is that crazy, I suggest that it *doesn't*
> > > even attempt to support ethtool --pause, and either is programmed
> > > at setup time to use autonegotiated pause (with the negotiation state
> > > programmed via ethtool -s) or it's programmed to have pause globally
> > > disabled. Essentially, I'm saying the hardware is too broken in its
> > > design to be worth bothering trying to work around its weirdness.
> > 
> > Ok. How can this driver reject changes made through ethtool --pause?
> 
> We would need either something in DSA (dsa_slave_set_pauseparam()) to
> prevent success, or something in phylink_ethtool_set_pauseparam() to
> do the same.
> 
> At the phylink level, that could be a boolean in struct phylink_config.
> Something like "disable_ethtool_set_pauseparam" (I'd prefer something
> a tad shorter) which if set would make phylink_ethtool_set_pauseparam()
> return -EOPNOTSUPP.

Since the configuration "ethtool --pause swp0 autoneg on" should be
trivially accepted, then I suggest a "bool no_forced_pause" based on
which struct ethtool_pauseparam :: autoneg gets restricted?
This could live either in phylink_config or in struct dsa_port,
depending on what you believe to be the most appropriate scope for this
workaround. I would slightly prefer it to live in phylink, since that's
the entity who keeps track of MLO_PAUSE_AN in general.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ