From: Ido Schimmel <idosch@idosch.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: davem@davemloft.net, netdev@vger.kernel.org, amitc@mellanox.com,
mlxsw@mellanox.com, Ido Schimmel <idosch@mellanox.com>
Subject: Re: [PATCH net-next 1/3] selftests: mlxsw: Add ethtool_lib.sh
Date: Mon, 10 Jun 2019 17:31:57 +0300 [thread overview]
Message-ID: <20190610143157.GA20333@splinter> (raw)
In-Reply-To: <20190610135914.GH8247@lunn.ch>
On Mon, Jun 10, 2019 at 03:59:14PM +0200, Andrew Lunn wrote:
> > +speeds_get()
> > +{
> > + local dev=$1; shift
> > + local with_mode=$1; shift
> > +
> > + local speeds_str=$(ethtool "$dev" | \
> > + # Snip everything before the link modes section.
> > + sed -n '/Supported link modes:/,$p' | \
> > + # Quit processing the rest at the start of the next section.
> > + # When checking, skip the header of this section (hence the 2,).
> > + sed -n '2,${/^[\t][^ \t]/q};p' | \
> > + # Drop the section header of the current section.
> > + cut -d':' -f2)
>
> ethtool gives you two lists of link modes:
>
> $ sudo ethtool eth17
> Settings for eth17:
> Supported ports: [ TP ]
> Supported link modes: 10baseT/Half 10baseT/Full
> 100baseT/Half 100baseT/Full
> 1000baseT/Full
> Supported pause frame use: No
> Supports auto-negotiation: Yes
> Supported FEC modes: Not reported
> Advertised link modes: 10baseT/Half 10baseT/Full
> 100baseT/Half 100baseT/Full
> 1000baseT/Full
>
> and if auto-neg has completed, there is potentially a third list, what
> the peer is advertising.
>
> Since this test is all about auto-neg, you should be using Advertised
> link modes, not Supported link modes. There can be supported link
> modes which you cannot advertise.
Andrew, are you suggestion to split speeds_get() into
supported_speeds_get() and advertised_speeds_get() and use each where
appropriate? Note that not all the tests are testing with autoneg on.
next prev parent reply other threads:[~2019-06-10 14:32 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-10 8:40 [PATCH net-next 0/3] mlxsw: Add speed and auto-negotiation test Ido Schimmel
2019-06-10 8:40 ` [PATCH net-next 1/3] selftests: mlxsw: Add ethtool_lib.sh Ido Schimmel
2019-06-10 13:35 ` Andrew Lunn
2019-06-10 13:56 ` Ido Schimmel
2019-06-10 15:29 ` Florian Fainelli
2019-06-11 6:51 ` Ido Schimmel
2019-06-10 13:59 ` Andrew Lunn
2019-06-10 14:31 ` Ido Schimmel [this message]
2019-06-10 14:51 ` Andrew Lunn
2019-06-10 8:40 ` [PATCH net-next 2/3] selftests: mlxsw: lib.sh: Add wait for dev with timeout Ido Schimmel
2019-06-10 8:40 ` [PATCH net-next 3/3] selftests: mlxsw: Add speed and auto-negotiation test Ido Schimmel
2019-06-10 13:48 ` Andrew Lunn
2019-06-10 13:58 ` Ido Schimmel
2019-06-10 14:06 ` Andrew Lunn
2019-06-11 6:35 ` Ido Schimmel
2019-06-11 12:22 ` Andrew Lunn
2019-06-11 13:06 ` Ido Schimmel
2019-06-11 13:30 ` Andrew Lunn
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=20190610143157.GA20333@splinter \
--to=idosch@idosch.org \
--cc=amitc@mellanox.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=idosch@mellanox.com \
--cc=mlxsw@mellanox.com \
--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).