netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: "Marek Behún" <kabel@kernel.org>
Cc: netdev@vger.kernel.org
Subject: Re: russell's net-queue question
Date: Tue, 20 Oct 2020 16:45:15 +0100	[thread overview]
Message-ID: <20201020154514.GE1551@shell.armlinux.org.uk> (raw)
In-Reply-To: <20201020171539.27c33230@kernel.org>

On Tue, Oct 20, 2020 at 05:15:39PM +0200, Marek Behún wrote:
> Russell,
> 
> I think the following commits in your net-queue should be still made better:
> 
> 7f79709b7a15 ("net: phy: pass supported PHY interface types to phylib")
> eba49a289d09 ("net: phy: marvell10g: select host interface configuration")
> 
> http://git.arm.linux.org.uk/cgit/linux-arm.git/commit/?h=net-queue&id=eba49a289d0959eab3dfbc0320334eb5a855ca68
> http://git.arm.linux.org.uk/cgit/linux-arm.git/commit/?h=net-queue&id=eba49a289d0959eab3dfbc0320334eb5a855ca68
> 
> The first one adds filling of the phydev->host_interfaces bitmap into
> the phylink_sfp_connect_phy function. It should also fill this bitmap
> in functions phylink_connect_phy and phylink_of_phy_connect (direct
> copy of pl->config->supported_interfaces).

First, the whole way interfaces are handled is really not good, even
with the addition of the interfaces bitmap. However, it tries to solve
at least some of the issues.

Secondly, what should we fill this in with?

Do we fill it with the firmware specified phy-mode setting? Or all the
capabilities of the network driver's interface? What if the network
driver supports RGMII/SGMII/10GBASE-R/etc but not all of these are
wired?

We really don't want the PHY changing what was configured via hardware
when it's "built in", because it's ambiguous in a very many situations
which mode should be selected. If we take the view that the firmware
specified phy-mode should only be specified, then the 88X3310 will
switch to MACTYPE=6 instead of 4 on the Macchiatobin, which is the rate
adaption mode - and this will lead to lost packets (it's a plain
88X3310 without the MACSEC, so the PHY is not capable of generating
flow control packets to pace the host.)

> The reason is that phy devices may want to know what interfaces are
> supported by host even if no SFP is used (Marvell 88X3310 is an exmaple
> of this).

If a SFP is not being used, then the connectivity is described via DT
and the hardware configuration of the PHY (which we rely on for the
88X3310.) I don't see much of a solution to that for the 88X3310.
If DT describes the interface mode as 10gbase-r, then that ambiguously
could refer to MACTYPE=4,5,6 - the driver can't know.

So, I don't think there is a simple answer here.

> The second patch (adding mactype selection to marvell10g) can get rid
> of the rate matching code, and also
> should update the mv3310_update_interface code accordignly.
> 
> Should I sent you these patches updated or should I create new patches
> on top of yours?

These are experimental, and for the reasons I mention above, they
need careful thought.

-- 
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:[~2020-10-20 15:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-20 15:15 russell's net-queue question Marek Behún
2020-10-20 15:45 ` Russell King - ARM Linux admin [this message]
2020-10-21 13:48   ` Marek Behún

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=20201020154514.GE1551@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=kabel@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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).