mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sean Anderson <sean.anderson@seco.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	netdev@vger.kernel.org, Russell King <linux@armlinux.org.uk>,
	"David S . Miller" <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Tim Harvey <tharvey@gateworks.com>
Subject: Re: [PATCH net-next v5 4/4] phy: aquantia: Determine rate adaptation support from registers
Date: Thu, 5 Jan 2023 12:43:47 -0500	[thread overview]
Message-ID: <3919acb9-04bb-0ca0-07b9-45e96c4dad10@seco.com> (raw)
In-Reply-To: <20230105173445.72rvdt4etvteageq@skbuf>

On 1/5/23 12:34, Vladimir Oltean wrote:
> On Thu, Jan 05, 2023 at 11:21:14AM -0500, Sean Anderson wrote:
>> > Your code walks through the speed_table[] of media speeds (from 10M up
>> > until the max speed of the SERDES) and sees whether the PHY was
>> > provisioned, for that speed, to use PAUSE rate adaptation.
>> 
>> This is because we assume that if a phy supports rate matching for a phy
>> interface mode, then it supports rate matching to all slower speeds that
>> it otherwise supports. This seemed like a pretty reasonable assumption
>> when I wrote the code, but it turns out that some firmwares don't abide
>> by this. This is firstly a problem with the firmware (as it should be
>> configured so that Linux can use the phy's features), but we have to be
>> careful not to end up with an unsupported combination.
> 
> When you say "problem with the firmware", you're referring specifically
> to my example (10GBASE-R for >1G speeds, SGMII for <=1G speeds)?

Actually, I am mostly referring to cases where rate adaptation is set up
to use a phy interface mode which isn't supported. In particular, Tim
has a board where the phy is set up to rate adapt using 5GBASE-R (-X?),
even though the host only supports 10GBASE-R.

> Why do you consider this a firmware misconfiguration? Let's say the host
> supports both 10GBASE-R and SGMII, but the system designer preferred not
> to use PAUSE-based rate adaptation for the speeds where native rate
> adaptation was available.

This is supported, you just can't get 5G or 2.5G.

>> > If the PHY firmware uses a combination like this: 10GBASE-R/XFI for
>> > media speeds of 10G, 5G, 2.5G (rate adapted), and SGMII for 1G, 100M
>> > and 10M, a call to your implementation of
>> > aqr107_get_rate_matching(PHY_INTERFACE_MODE_10GBASER) would return
>> > RATE_MATCH_NONE, right?
>> 
>> Correct.
>> 
>> > So only ETHTOOL_LINK_MODE_10000baseT_Full_BIT
>> > would be advertised on the media side?
>> 
>> If the host only supports 10GBASE-R and nothing else. If the host
>> supports SGMII as well, we will advertise 10G, 1G, 100M, and 10M. But
>> really, this is a problem with the firmware, since if the host supports
>> only 10GBASE-R, then the firmware should be set up to rate adapt to all
>> speeds.
> 
> So we lose the advertisement of 5G and 2.5G, even if the firmware is
> provisioned for them via 10GBASE-R rate adaptation, right? Because when
> asked "What kind of rate matching is supported for 10GBASE-R?", the
> Aquantia driver will respond "None".

Correct.

>> > Shouldn't you take into consideration in your aqr107_rate_adapt_ok()
>> > function only the media side link speeds for which the PHY was actually
>> > *configured* to use the SERDES protocol @iface?
>> 
>> No, because we don't know what phy interface modes are actually going to
>> be used. The phy doesn't know whether e.g. the host supports both
>> 10GBASE-R and SGMII or whether it only supports 10GBASE-R. With the
>> current API we cannot say "I support 5G" without also saying "I support
>> 1G". If you don't like this, please send a patch for an API returning
>> supported speeds for a phy interface mode.

Again, this is to comply with the existing API assumptions. The current
code is buggy. Of course, another way around this is to modify the API.
I have chosen this route because I don't have a situation like you
described. But if support for that is important to you, I encourage you
to refactor things.

--Sean

  reply	other threads:[~2023-01-05 17:44 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03 22:05 [PATCH net-next v5 0/4] " Sean Anderson
2023-01-03 22:05 ` [PATCH net-next v5 1/4] net: phy: Move/rename phylink_interface_max_speed Sean Anderson
2023-01-03 22:05 ` [PATCH net-next v5 2/4] phy: mdio: Reorganize defines Sean Anderson
2023-01-03 22:05 ` [PATCH net-next v5 3/4] net: mdio: Update speed register bits Sean Anderson
2023-01-03 22:05 ` [PATCH net-next v5 4/4] phy: aquantia: Determine rate adaptation support from registers Sean Anderson
2023-01-05 14:04   ` Vladimir Oltean
2023-01-05 14:40     ` Russell King (Oracle)
2023-01-05 17:43       ` Vladimir Oltean
2023-01-05 18:51         ` Russell King (Oracle)
2023-01-06 14:18           ` Vladimir Oltean
2023-01-05 16:21     ` Sean Anderson
2023-01-05 17:34       ` Vladimir Oltean
2023-01-05 17:43         ` Sean Anderson [this message]
2023-01-05 17:52           ` Vladimir Oltean
2023-01-05 17:55             ` Vladimir Oltean
2023-01-05 18:03               ` Sean Anderson
2023-01-05 18:11                 ` Vladimir Oltean
2023-01-05 18:17                   ` Sean Anderson
2023-01-05 18:58                 ` Russell King (Oracle)
2023-01-05 19:00                   ` Sean Anderson
2023-01-05 18:55             ` Russell King (Oracle)
2023-01-05 18:59               ` Sean Anderson
2023-01-05 19:06                 ` Russell King (Oracle)
2023-01-05 19:10                   ` Sean Anderson
2023-01-05 17:46         ` Russell King (Oracle)
2023-01-06 23:03           ` Vladimir Oltean
2023-01-06 23:21             ` Sean Anderson
2023-01-06 23:29               ` Vladimir Oltean
2023-01-19 18:32                 ` Sean Anderson
2023-01-09 18:56               ` Tim Harvey
2023-01-05 13:39 ` [PATCH net-next v5 0/4] " Vladimir Oltean
2023-01-05 16:25   ` Sean Anderson
2023-01-19 18:17 ` Sean Anderson

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=3919acb9-04bb-0ca0-07b9-45e96c4dad10@seco.com \
    --to=sean.anderson@seco.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=tharvey@gateworks.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

all inboxes | Powered by JetHome®