netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Marcin Wojtas <mw@semihalf.com>,
	netdev@vger.kernel.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [PATCH net-next v2 0/7] net: phylink: add PCS validation
Date: Wed, 15 Dec 2021 15:33:27 +0000	[thread overview]
Message-ID: <YboKxwxonGND3Mom@shell.armlinux.org.uk> (raw)

Hi,

This series allows phylink to include the PCS in its validation step.
There are two reasons to make this change:

1. Some of the network drivers that are making use of the split PCS
   support are already manually calling into their PCS drivers to
   perform validation. E.g. stmmac with xpcs.

2. Logically, some network drivers such as mvneta and mvpp2, the
   restriction we impose in the validate() callback is a property of
   the "PCS" block that we provide rather than the MAC.

This series:

1. Gives phylink a mechanism to query the MAC driver which PCS is
   wishes to use for the PHY interface mode. This is necessary to allow
   the PCS to be involved in the validation step without making changes
   to the configuration.

2. Provide a pcs_validate() method that PCS can implement. This follows
   a similar model to the MAC's validate() callback, but with some minor
   differences due to observations from the various implementations.
   E.g. returning an error code for not-supported and the way the
   advertising bitmap is masked.

3. Convert mvpp2 and mvneta to this as examples of its use. Further
   Conversions are in the pipeline, including for stmmac+xpcs, as well
   as some DSA drivers. Note that DSA conversion to this is conditional
   upon all DSA drivers populating their supported_interfaces bitmap,
   since this is required before mac_select_pcs() can be used.

Existing drivers that set a PCS in mac_prepare() or mac_config(), or
shortly after phylink_create() will continue to work. However, it should
be noted that mac_select_pcs() will be called during phylink_create(),
and thus any PCS returned by mac_select_pcs() must be available by this
time - or we drop the check in phylink_create().

v2: fix kerneldoc typo in patch 1.

 drivers/net/ethernet/marvell/mvneta.c           | 229 ++++++++++++++++--------
 drivers/net/ethernet/marvell/mvpp2/mvpp2.h      |   3 +-
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 112 ++++++------
 drivers/net/phy/phylink.c                       |  99 +++++++++-
 include/linux/phylink.h                         |  38 ++++
 5 files changed, 337 insertions(+), 144 deletions(-)

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

             reply	other threads:[~2021-12-15 16:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15 15:33 Russell King (Oracle) [this message]
2021-12-15 15:34 ` [PATCH v2 net-next 1/7] net: phylink: add mac_select_pcs() method to phylink_mac_ops Russell King (Oracle)
2021-12-15 15:34 ` [PATCH v2 net-next 2/7] net: phylink: add pcs_validate() method Russell King (Oracle)
2021-12-15 15:34 ` [PATCH v2 net-next 3/7] net: mvpp2: use .mac_select_pcs() interface Russell King (Oracle)
2021-12-15 15:34 ` [PATCH v2 net-next 4/7] net: mvpp2: convert to pcs_validate() and phylink_generic_validate() Russell King (Oracle)
2021-12-15 15:34 ` [PATCH v2 net-next 5/7] net: mvneta: convert to use mac_prepare()/mac_finish() Russell King
2021-12-15 15:34 ` [PATCH v2 net-next 6/7] net: mvneta: convert to phylink pcs operations Russell King
2021-12-15 15:34 ` [PATCH v2 net-next 7/7] net: mvneta: convert to pcs_validate() and phylink_generic_validate() Russell King (Oracle)
2021-12-16 16:15 ` [PATCH net-next v2 0/7] net: phylink: add PCS validation Jakub Kicinski

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=YboKxwxonGND3Mom@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=mw@semihalf.com \
    --cc=netdev@vger.kernel.org \
    --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).