From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Alexander Couzens <lynxis@fe80.eu>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Cc: Claudiu Beznea <claudiu.beznea@microchip.com>,
Daniel Golle <daniel@makrotopia.org>,
Daniel Machon <daniel.machon@microchip.com>,
"David S. Miller" <davem@davemloft.net>,
DENG Qingfang <dqfext@gmail.com>,
Eric Dumazet <edumazet@google.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Horatiu Vultur <horatiu.vultur@microchip.com>,
Ioana Ciornei <ioana.ciornei@nxp.com>,
Jakub Kicinski <kuba@kernel.org>,
Jose Abreu <Jose.Abreu@synopsys.com>,
Landen Chao <Landen.Chao@mediatek.com>,
Lars Povlsen <lars.povlsen@microchip.com>,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
Madalin Bucur <madalin.bucur@nxp.com>,
Marcin Wojtas <mw@semihalf.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Michal Simek <michal.simek@amd.com>,
netdev@vger.kernel.org,
Nicolas Ferre <nicolas.ferre@microchip.com>,
Paolo Abeni <pabeni@redhat.com>,
Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>,
Sean Anderson <sean.anderson@seco.com>,
Sean Wang <sean.wang@mediatek.com>,
Steen Hegelund <Steen.Hegelund@microchip.com>,
Taras Chornyi <taras.chornyi@plvision.eu>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
UNGLinuxDriver@microchip.com
Subject: Re: [PATCH net-next 01/15] net: phylink: add PCS negotiation mode
Date: Tue, 20 Jun 2023 16:42:58 +0100 [thread overview]
Message-ID: <ZJHJAtkEvQ2dAXux@shell.armlinux.org.uk> (raw)
In-Reply-To: <20230620113429.mc4p4y6mny5cm4ih@skbuf>
On Tue, Jun 20, 2023 at 02:34:29PM +0300, Vladimir Oltean wrote:
> On Fri, Jun 16, 2023 at 01:06:22PM +0100, Russell King (Oracle) wrote:
> > PCS have to work out whether they should enable PCS negotiation by
> > looking at the "mode" and "interface" arguments, and the Autoneg bit
> > in the advertising mask.
> >
> > This leads to some complex logic, so lets pull that out into phylink
> > and instead pass a "neg_mode" argument to the PCS configuration and
> > link up methods, instead of the "mode" argument.
> >
> > In order to transition drivers, add a "neg_mode" flag to the phylink
> > PCS structure to PCS can indicate whether they want to be passed the
> > neg_mode or the old mode argument.
> >
> > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> > ---
> > diff --git a/include/linux/phylink.h b/include/linux/phylink.h
> > index 0cf07d7d11b8..2b322d7fa51a 100644
> > --- a/include/linux/phylink.h
> > +++ b/include/linux/phylink.h
> > @@ -21,6 +21,24 @@ enum {
> > MLO_AN_FIXED, /* Fixed-link mode */
> > MLO_AN_INBAND, /* In-band protocol */
> >
> > + /* PCS "negotiation" mode.
> > + * PHYLINK_PCS_NEG_NONE - protocol has no inband capability
> > + * PHYLINK_PCS_NEG_OUTBAND - some out of band or fixed link setting
>
> Would OUTBAND be more clearly named as FORCED maybe?
I don't see how FORCED would improve anything.
> > + * PHYLINK_PCS_NEG_INBAND_DISABLED - inband mode disabled, e.g.
> > + * 1000base-X with autoneg off
> > + * PHYLINK_PCS_NEG_INBAND_ENABLED - inband mode enabled
> > + * Additionally, this can be tested using bitmasks:
> > + * PHYLINK_PCS_NEG_INBAND - inband mode selected
> > + * PHYLINK_PCS_NEG_ENABLED - negotiation mode enabled
> > + */
> > + PHYLINK_PCS_NEG_NONE = 0,
> > + PHYLINK_PCS_NEG_ENABLED = BIT(4),
>
> Why do we start the enum values from BIT(4)? What are we colliding with,
> in the range of lower values?
I want to make sure that they can't be confused with MLO_AN_* values,
especially since we pass them through the same interface that MLO_AN_*
was using.
> > @@ -79,6 +97,70 @@ static inline bool phylink_autoneg_inband(unsigned int mode)
> > return mode == MLO_AN_INBAND;
> > }
> >
> > +/**
> > + * phylink_pcs_neg_mode() - helper to determine PCS inband mode
>
> I think you are naming it "neg_mode" rather than "aneg_mode" because
> with OUTBAND/NONE, there's nothing "automatic" about the negotiation.
> However, "neg" rather than "aneg" sounds more like a shorthand form of
> "negation" or "negative". Would you oppose renaming it to "aneg_mode"?
I want to try to get away from "auto-negotiation" for this because
that has connotations of there being some kind of agreement reached
between both ends, like what happens with baseT links. However, that
is not the case with the SGMII family, which are more a form of
inband signalling.
I can't find any other term for the inband signalling that covers
all cases. "Negotiation" on its own covers both "negotiation result"
for SGMII as well as in-band negotiation for base-X cases. I don't
think "auto-negotiation" covers SGMII, and "in-band signalling"
wouldn't really cover base-X.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2023-06-20 15:43 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-16 12:05 [PATCH net-next 0/15] Add and use helper for PCS negotiation modes Russell King (Oracle)
2023-06-16 12:06 ` [PATCH net-next 01/15] net: phylink: add PCS negotiation mode Russell King (Oracle)
2023-06-16 15:51 ` Simon Horman
2023-06-20 11:34 ` Vladimir Oltean
2023-06-20 15:42 ` Russell King (Oracle) [this message]
2023-06-20 11:37 ` Vladimir Oltean
2023-06-20 15:51 ` Russell King (Oracle)
2023-06-16 12:06 ` [PATCH net-next 02/15] net: phylink: convert phylink_mii_c22_pcs_config() to neg_mode Russell King (Oracle)
2023-06-16 12:06 ` [PATCH net-next 03/15] net: phylink: pass neg_mode into phylink_mii_c22_pcs_config() Russell King (Oracle)
2023-06-16 12:06 ` [PATCH net-next 04/15] net: pcs: xpcs: update PCS driver to use neg_mode Russell King (Oracle)
2023-06-16 12:06 ` [PATCH net-next 05/15] net: pcs: lynxi: " Russell King (Oracle)
2023-06-16 12:06 ` [PATCH net-next 06/15] net: pcs: lynx: " Russell King (Oracle)
2023-06-16 12:06 ` [PATCH net-next 07/15] net: lan966x: " Russell King (Oracle)
2023-06-16 12:06 ` [PATCH net-next 08/15] net: mvneta: " Russell King (Oracle)
2023-06-16 12:07 ` [PATCH net-next 09/15] net: mvpp2: " Russell King (Oracle)
2023-06-16 12:07 ` [PATCH net-next 10/15] net: prestera: " Russell King (Oracle)
2023-06-16 12:07 ` [PATCH net-next 11/15] net: qca8k: " Russell King (Oracle)
2023-06-20 9:18 ` Russell King (Oracle)
2023-06-20 11:28 ` Vladimir Oltean
2023-06-20 16:22 ` Jakub Kicinski
2023-06-16 12:07 ` [PATCH net-next 12/15] net: sparx5: " Russell King (Oracle)
2023-06-16 12:07 ` [PATCH net-next 13/15] net: dsa: b53: " Russell King (Oracle)
2023-06-20 11:30 ` Florian Fainelli
2023-06-16 12:07 ` [PATCH net-next 14/15] net: dsa: mt7530: " Russell King (Oracle)
2023-06-16 12:07 ` [PATCH net-next 15/15] net: macb: " Russell King (Oracle)
2023-06-16 15:00 ` [PATCH net-next 0/15] Add and use helper for PCS negotiation modes Vladimir Oltean
2023-06-16 15:46 ` Russell King (Oracle)
2023-06-16 15:52 ` Russell King (Oracle)
2023-06-20 11:25 ` Vladimir Oltean
2023-06-20 10:54 ` Vladimir Oltean
2023-06-23 2:50 ` 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=ZJHJAtkEvQ2dAXux@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=Jose.Abreu@synopsys.com \
--cc=Landen.Chao@mediatek.com \
--cc=Steen.Hegelund@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=angelogioacchino.delregno@collabora.com \
--cc=claudiu.beznea@microchip.com \
--cc=daniel.machon@microchip.com \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=dqfext@gmail.com \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=horatiu.vultur@microchip.com \
--cc=ioana.ciornei@nxp.com \
--cc=kuba@kernel.org \
--cc=lars.povlsen@microchip.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=lynxis@fe80.eu \
--cc=madalin.bucur@nxp.com \
--cc=matthias.bgg@gmail.com \
--cc=michal.simek@amd.com \
--cc=mw@semihalf.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=radhey.shyam.pandey@xilinx.com \
--cc=sean.anderson@seco.com \
--cc=sean.wang@mediatek.com \
--cc=taras.chornyi@plvision.eu \
--cc=thomas.petazzoni@bootlin.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).