netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
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 0/15] Add and use helper for PCS negotiation modes
Date: Fri, 16 Jun 2023 18:00:55 +0300	[thread overview]
Message-ID: <20230616150055.kb7dyuwqqvfkfuh7@skbuf> (raw)
In-Reply-To: <ZIxQIBfO9dH5xFlg@shell.armlinux.org.uk>

On Fri, Jun 16, 2023 at 01:05:52PM +0100, Russell King (Oracle) wrote:
> Hi,
> 
> Earlier this month, I proposed a helper for deciding whether a PCS
> should use inband negotiation modes or not. There was some discussion
> around this topic, and I believe there was no disagreement about
> providing the helper.
> 
> The initial discussion can be found at:
> 
> https://lore.kernel.org/r/ZGIkGmyL8yL1q1zp@shell.armlinux.org.uk
> 
> Subsequently, I posted a RFC series back in May:
> 
> https://lore.kernel.org/r/ZGzhvePzPjJ0v2En@shell.armlinux.org.uk
> 
> that added a helper, phylink_pcs_neg_mode() which PCS drivers could use
> to parse the state, and updated a bunch of drivers to use it. I got
> a couple of bits of feedback to it, including some ACKs.
> 
> However, I've decided to take this slightly further and change the
> "mode" parameter to both the pcs_config() and pcs_link_up() methods
> when a PCS driver opts in to this (by setting "neg_mode" in the
> phylink_pcs structure.) If this is not set, we default to the old
> behaviour. That said, this series converts all the PCS implementations
> I can find currently in net-next.
> 
> Doing this has the added benefit that the negotiation mode parameter
> is also available to the pcs_link_up() function, which can now know
> whether inband negotiation was in fact enabled or not at pcs_config()
> time.
> 
> It has been posted as RFC at:
> 
> https://lore.kernel.org/r/ZIh/CLQ3z89g0Ua0@shell.armlinux.org.uk
> 
> and received one reply, thanks Elad, which is a similar amount of
> interest to previous postings. Let's post it as non-RFC and see
> whether we get more reaction.

Sorry, I was in the process of reviewing the RFC, but I'm not sure I
know what to ask to make sure that I understand the motivation :-/
Here's a question that might or might not result in a code change.

In the single-patch RFC at:
https://lore.kernel.org/all/ZGIkGmyL8yL1q1zp@shell.armlinux.org.uk/
you bring sparx5 and lan966x as a motivation for introducing
PHYLINK_PCS_NEG_OUTBAND as separate from PHYLINK_PCS_NEG_INBAND_DISABLED,
with both meaning that in-band autoneg isn't used, but in the former
case it's not enabled at all, while in the latter it's disabled through
ethtool (if I get that right?).

I've opened the Sparx5 documentation at:
https://ww1.microchip.com/downloads/en/DeviceDoc/SparX-5_Family_L2L3_Enterprise_10G_Ethernet_Switches_Datasheet_00003822B.pdf
and also cross-checked with the PCS1G documentation from VSC7514
(Ocelot: https://ww1.microchip.com/downloads/en/DeviceDoc/VMDS-10491.pdf,
there's another embedded PDF with registers at page 283), trying to find
exactly what the PCS1G_MODE_CFG.SGMII_MODE_ENA field does (which is
controlled in sparx5 and lan966x based on the presence or absence of the
managed = "in-band-status" property).

Do you know for sure what this bit does and whether it makes sense for
drivers to even distinguish between OUTBAND and INBAND_DISABLED in the
way that this series is proposing?

It's hard to know for sure, not having the hardware, but I believe that
the bit selects between the SGMII and the 1000Base-X control word
format (so, even though there's a dedicated and fully programmable
PCS1G_ANEG_CFG.ADV_ABILITY register, the link partner ability is still
decoded as per the programmed expected format). The documents talk about
using the PCS in "SGMII mode" vs "1000BASE-X SERDES mode".

If that's the case, then it is selecting between those 2 based on
phylink_autoneg_inband(mode) and irrespective of the phy-mode, i.e.:

- enabling the SGMII control word format for phy-mode = "1000base-x" and
  no managed = "in-band-status", or
- enabling the 1000Base-X control word format for phy-mode = "sgmii" and
  managed = "in-band-status"

...is that a model to follow?

  parent reply	other threads:[~2023-06-16 15:01 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)
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 ` Vladimir Oltean [this message]
2023-06-16 15:46   ` [PATCH net-next 0/15] Add and use helper for PCS negotiation modes 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=20230616150055.kb7dyuwqqvfkfuh7@skbuf \
    --to=olteanv@gmail.com \
    --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=linux@armlinux.org.uk \
    --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=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).