netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Eric Dumazet <edumazet@google.com>, Rob Herring <robh@kernel.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Donald Hunter <donald.hunter@gmail.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jonathan Corbet <corbet@lwn.net>,
	John Fastabend <john.fastabend@gmail.com>,
	Lukasz Majewski <lukma@denx.de>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Paolo Abeni <pabeni@redhat.com>, Jiri Pirko <jiri@resnulli.us>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	Divya.Koppera@microchip.com,
	Kory Maincent <kory.maincent@bootlin.com>,
	Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	netdev@vger.kernel.org, Sabrina Dubroca <sd@queasysnail.net>,
	linux-kernel@vger.kernel.org, kernel@pengutronix.de,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Heiner Kallweit <hkallweit1@gmail.com>
Subject: Re: [PATCH net-next v8 1/1] Documentation: net: add flow control guide and document ethtool API
Date: Fri, 28 Nov 2025 14:17:10 -0800	[thread overview]
Message-ID: <20251128141710.4fa38296@kernel.org> (raw)
In-Reply-To: <aSoIREdMWGeygnD_@shell.armlinux.org.uk>

On Fri, 28 Nov 2025 20:38:28 +0000 Russell King (Oracle) wrote:
> On Fri, Nov 28, 2025 at 09:16:24PM +0100, Andrew Lunn wrote:
> > > Can you please tell me what is preventing us from deprecating pauseparam
> > > API *for autoneg* and using linkmodes which are completely unambiguous.  
> > 
> > Just to make sure i understand you here...
> > 
> > You mean make use of
> > 
> >         ETHTOOL_LINK_MODE_Pause_BIT             = 13,
> >         ETHTOOL_LINK_MODE_Asym_Pause_BIT        = 14,
> > 
> > So i would do a ksettings_set() with
> > 
> > __ETHTOOL_LINK_MODE_LEGACY_MASK(Pause) | __ETHTOOL_LINK_MODE_LEGACY_MASK(Asym_Pause)
> > 
> > to indicate both pause and asym pause should be advertised.
> > 
> > The man page for ethtool does not indicate you can do this. It does
> > have a list of link mode bits you can pass via the advertise option to
> > ethtool -s, bit they are all actual link modes, not features like TP,
> > AUI, BNC, Pause, Backplane, FEC none, FEC baser, etc.  
> 
> I see the latest ethtool now supports -s ethX advertise MODE on|off,
> but it doesn't describe that in the parameter entry for "advertise"
> and doesn't suggest what MODE should be, nor how to specify multiple
> modes that one may wish to turn on/off. I'm guessing this is what you're
> referring to.
> 
> The ports never get advertised, so I don't think they're relevant.
> 
> However, the lack of the pause bits means that one is forced to use
> the hex number, and I don't deem that to be a user interface. That's
> a programmers interface, or rather a nightmare, because even if you're
> a programmer, you still end up looking at include/uapi/linux/ethtool.h
> and doing the maths to work out the hex number to pass, and then you
> mistype it with the wrong number of zeros, so you try again, and
> eventually you get the advertisement you wanted.
> 
> So no, I don't accept Jakub's argument right now. Forcing people into
> the nightmare of working out a hex number isn't something for users.

I did some digging, too, just now. Looks like the options are indeed
not documented in the man page but ethtool uses the "forward compatible"
scheme with strings coming from the kernel. So this:

  ethtool -s enp0s13f0u1u1 advertise Pause on Asym_Pause on

works just fine, with no changes in CLI.

We should probably document that it works in the ethtool help and man
page. And possibly add some synthetic options like Receive-Only /
Transmit-Only so that users don't have to be aware of the encoding
details? Let me know if it's impractical, otherwise I think we'll
agree that having ethtool that makes it obvious how to achieve the
desired configuration beats best long form docs in the kernel..

  reply	other threads:[~2025-11-28 22:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19 14:03 [PATCH net-next v8 1/1] Documentation: net: add flow control guide and document ethtool API Oleksij Rempel
2025-11-26  2:19 ` Jakub Kicinski
2025-11-26  8:36   ` Oleksij Rempel
2025-11-26 22:42     ` Jakub Kicinski
2025-11-27  9:20       ` Oleksij Rempel
2025-11-27 15:07         ` Andrew Lunn
2025-11-27 15:31           ` Maxime Chevallier
2025-11-27 15:48             ` Andrew Lunn
2025-11-27 16:18               ` Russell King (Oracle)
2025-11-27 16:14           ` Russell King (Oracle)
2025-11-28  1:21             ` Jakub Kicinski
2025-11-27 16:10         ` Russell King (Oracle)
2025-11-28  1:27     ` Russell King (Oracle)
2025-11-28  1:47       ` Russell King (Oracle)
2025-11-28  8:55         ` Oleksij Rempel
2025-11-28  9:35           ` Russell King (Oracle)
2025-11-28 18:32           ` Jakub Kicinski
2025-11-28 20:16             ` Andrew Lunn
2025-11-28 20:38               ` Russell King (Oracle)
2025-11-28 22:17                 ` Jakub Kicinski [this message]
2025-12-01  9:49                   ` Oleksij Rempel

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=20251128141710.4fa38296@kernel.org \
    --to=kuba@kernel.org \
    --cc=Divya.Koppera@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=ast@kernel.org \
    --cc=corbet@lwn.net \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=hawk@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=john.fastabend@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kory.maincent@bootlin.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lukma@denx.de \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=sd@queasysnail.net \
    --cc=sdf@fomichev.me \
    --cc=vadim.fedorenko@linux.dev \
    --cc=vladimir.oltean@nxp.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).