netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Kubecek <mkubecek@suse.cz>
To: netdev@vger.kernel.org
Cc: Andrew Lunn <andrew@lunn.ch>, linville@redhat.com
Subject: Re: [PATCH 2/2] ethtool: Add 100BaseT1 and 1000BaseT1 link modes
Date: Fri, 31 May 2019 11:30:29 +0200	[thread overview]
Message-ID: <20190531093029.GD15954@unicorn.suse.cz> (raw)
In-Reply-To: <20190530180616.1418-3-andrew@lunn.ch>

On Thu, May 30, 2019 at 08:06:16PM +0200, Andrew Lunn wrote:
> The kernel can now indicate if the PHY supports operating over a
> single pair at 100Mbps or 1000Mbps.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  ethtool.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/ethtool.c b/ethtool.c
> index 66a907edd97b..35158939e04c 100644
> --- a/ethtool.c
> +++ b/ethtool.c
> @@ -494,8 +494,10 @@ static void init_global_link_mode_masks(void)
>  		ETHTOOL_LINK_MODE_10baseT_Full_BIT,
>  		ETHTOOL_LINK_MODE_100baseT_Half_BIT,
>  		ETHTOOL_LINK_MODE_100baseT_Full_BIT,
> +		ETHTOOL_LINK_MODE_100baseT1_Full_BIT,
>  		ETHTOOL_LINK_MODE_1000baseT_Half_BIT,
>  		ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
> +		ETHTOOL_LINK_MODE_1000baseT1_Full_BIT,
>  		ETHTOOL_LINK_MODE_1000baseKX_Full_BIT,
>  		ETHTOOL_LINK_MODE_2500baseX_Full_BIT,
>  		ETHTOOL_LINK_MODE_10000baseT_Full_BIT,

The only place where the all_advertised_modes_bits[] array is used is

	ethtool_link_mode_zero(all_advertised_modes);
	ethtool_link_mode_zero(all_advertised_flags);
	for (i = 0; i < ARRAY_SIZE(all_advertised_modes_bits); ++i) {
		ethtool_link_mode_set_bit(all_advertised_modes_bits[i],
					  all_advertised_modes);
		ethtool_link_mode_set_bit(all_advertised_modes_bits[i],
					  all_advertised_flags);
	}

so the order does not really matter. I would prefer to have the elements
ordered the same way as in enum ethtool_link_mode_bit_indices so that
it's easier to check if something is missing.

> @@ -634,10 +636,14 @@ static void dump_link_caps(const char *prefix, const char *an_prefix,
>  		  "100baseT/Half" },
>  		{ 1, ETHTOOL_LINK_MODE_100baseT_Full_BIT,
>  		  "100baseT/Full" },
> +		{ 1, ETHTOOL_LINK_MODE_100baseT1_Full_BIT,
> +		  "100baseT1/Full" },
>  		{ 0, ETHTOOL_LINK_MODE_1000baseT_Half_BIT,
>  		  "1000baseT/Half" },
>  		{ 1, ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
>  		  "1000baseT/Full" },
> +		{ 1, ETHTOOL_LINK_MODE_1000baseT1_Full_BIT,
> +		  "1000baseT1/Full" },
>  		{ 0, ETHTOOL_LINK_MODE_1000baseKX_Full_BIT,
>  		  "1000baseKX/Full" },
>  		{ 0, ETHTOOL_LINK_MODE_2500baseX_Full_BIT,

Does it mean that we could end up with lines like

                                100baseT/Half 100baseT/Full 100baseT1/Full
                                1000baseT/Full 1000baseT1/Full

if there is a NIC supporting both T and T1? (I'm not sure if it's
possible - but if not, there is no need for setting same_line.) It would
be probably confusing for users as modes on the same line always were
half/full duplex variants of the same.

You should also add the new modes to ethtool.8.in.

Michal

  reply	other threads:[~2019-05-31  9:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30 18:06 [PATCH 0/2] Add 100BaseT1 and 1000BaseT1 Andrew Lunn
2019-05-30 18:06 ` [PATCH 1/2] ethtool: sync ethtool-copy.h with linux-next from 30/05/2019 Andrew Lunn
2019-05-30 18:06 ` [PATCH 2/2] ethtool: Add 100BaseT1 and 1000BaseT1 link modes Andrew Lunn
2019-05-31  9:30   ` Michal Kubecek [this message]
2019-05-31 11:59     ` Andrew Lunn
2019-05-31 12:21       ` Lucas Stach
2019-05-31 12:30         ` Andrew Lunn
2019-05-31 13:04           ` Lucas Stach

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=20190531093029.GD15954@unicorn.suse.cz \
    --to=mkubecek@suse.cz \
    --cc=andrew@lunn.ch \
    --cc=linville@redhat.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).