From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>
Cc: FUJITA Tomonori <fujita.tomonori@gmail.com>,
netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com
Subject: Re: [PATCH net-next] net: tn40xx: add initial ethtool_ops support
Date: Fri, 28 Jun 2024 16:45:01 +0100 [thread overview]
Message-ID: <Zn7afU9DiotL92jZ@shell.armlinux.org.uk> (raw)
In-Reply-To: <fe33e69d-a17b-4afd-a5e5-1e1539e6572c@lunn.ch>
On Fri, Jun 28, 2024 at 04:14:44PM +0200, Andrew Lunn wrote:
> On Fri, Jun 28, 2024 at 10:41:16PM +0900, FUJITA Tomonori wrote:
> > Call phylink_ethtool_ksettings_get() for get_link_ksettings method and
> > ethtool_op_get_link() for get_link method.
> >
> > Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
> > ---
> > drivers/net/ethernet/tehuti/tn40.c | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/tehuti/tn40.c b/drivers/net/ethernet/tehuti/tn40.c
> > index 11db9fde11fe..565b72537efa 100644
> > --- a/drivers/net/ethernet/tehuti/tn40.c
> > +++ b/drivers/net/ethernet/tehuti/tn40.c
> > @@ -1571,6 +1571,19 @@ static const struct net_device_ops tn40_netdev_ops = {
> > .ndo_vlan_rx_kill_vid = tn40_vlan_rx_kill_vid,
> > };
> >
> > +static int tn40_ethtool_get_link_ksettings(struct net_device *ndev,
> > + struct ethtool_link_ksettings *cmd)
> > +{
> > + struct tn40_priv *priv = netdev_priv(ndev);
> > +
> > + return phylink_ethtool_ksettings_get(priv->phylink, cmd);
> > +}
>
> Have you tried implementing tn40_ethtool_set_link_ksettings() in the
> same way?
I did think about commenting on that, and the [sg]et_pauseparam
methods as well, but when one realises that the driver only supports
one speed and duplex (10G FD) but no pause it didn't seem to make
sense.
Not having pause effectively rules out pause-frame rate adaption
by the PHY, so the PHY probably only supports 10G link speeds,
and if I remember correctly, 10GBASE-T requires autoneg.
Deviating off from this topic a bit... 802.3 28D.5:
28D.5 Extensions required for Clause 40 (1000BASE-T)
a) Auto-Negotiation is mandatory for 1000BASE-T (see 40.5.1).
28D.6 Extensions required for Clause 55 (10GBASE-T)
a) Auto-Negotiation is mandatory for 10GBASE-T.
Now, delving into the PICS for 1000BASE-T, it states:
Item Feature Subclause Status
Support Value/Comment
AN Support for Auto-Negotiation 40.5.1 M Yes [ ] Required
which doesn't seem to mean that AN must be enabled, only support for
AN is required and it's possible to disable it. nothing states that
disabling AN for 1000base-T is not allowed.
The same seems to be true of 10GBASE-T.
However, wikipedia says:
The autonegotiation specification was improved in the 1998 release of
IEEE 802.3. This was followed by the release of the IEEE 802.3ab Gigabit
Ethernet standard in 1999 which specified mandatory autonegotiation for
1000BASE-T. Autonegotiation is also mandatory for 1000BASE-TX and
10GBASE-T implementations.
which is loose language - "mandatory autonegotiation" does that refer
to support for auto-negotiation or require auto-negotiation to be
always enabled?
We're already seeing some PHYs from some manufacturers that seem to be
following the "require auto-negotiation to be always enabled".
So why have I gone down what seems to be an unrelated rabbit hole?
If tn40 is connected to a 10GBASE-T PHY, implementing the
set_link_ksettings() method would give the user control over whether AN
is used on the media side.
If 802.3 requires AN to be supported but is not necessarily enabled,
then there is use in exposing the set_link_ksettings() method.
If 802.3 requires AN to be supproted and always enabled, then
implementing set_link_ksettings() in this case would not provide any
value.
Which it is... I have no idea. Nothing seems to be giving a clear
unambiguous definitive statement.
The last thing to point out, however, is phylib's behaviour. If autoneg
is disabled, we only allow 10, 100 and 1000M, half or full duplex.
Slightly worse, we allow those whether or not the PHY is even capable
of supporting them!
--
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:[~2024-06-28 15:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-28 13:41 [PATCH net-next] net: tn40xx: add initial ethtool_ops support FUJITA Tomonori
2024-06-28 14:14 ` Andrew Lunn
2024-06-28 14:29 ` FUJITA Tomonori
2024-06-28 15:45 ` Russell King (Oracle) [this message]
2024-07-03 12:57 ` FUJITA Tomonori
2024-07-01 10:20 ` 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=Zn7afU9DiotL92jZ@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fujita.tomonori@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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).