lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190224181104.GA1914@unicorn.suse.cz>
Date:   Sun, 24 Feb 2019 19:11:04 +0100
From:   Michal Kubecek <mkubecek@...e.cz>
To:     Tariq Toukan <tariqt@...lanox.com>
Cc:     "John W. Linville" <linville@...driver.com>,
        netdev@...r.kernel.org, Eran Ben Elisha <eranbe@...lanox.com>,
        Aya Levin <ayal@...lanox.com>
Subject: Re: [PATCH ethtool] ethtool: Add support for 200Gbps (50Gbps per
 lane) link mode

On Sun, Feb 24, 2019 at 05:08:21PM +0200, Tariq Toukan wrote:
> From: Aya Levin <ayal@...lanox.com>
> 
> Introduce 50Gbps per lane link modes and 200Gbps speed, update print
> functions and initialization functions accordingly.
> In addition, update related man page accordingly.
> 
> Signed-off-by: Aya Levin <ayal@...lanox.com>
> Signed-off-by: Tariq Toukan <tariqt@...lanox.com>
> ---
>  ethtool-copy.h | 19 ++++++++++++++++++-
>  ethtool.8.in   | 15 +++++++++++++++
>  ethtool.c      | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 85 insertions(+), 1 deletion(-)
> 
> diff --git a/ethtool-copy.h b/ethtool-copy.h
> index 6bfbb85f9402..de459900b2d3 100644
> --- a/ethtool-copy.h
> +++ b/ethtool-copy.h
> @@ -1455,15 +1455,31 @@ enum ethtool_link_mode_bit_indices {
>  	ETHTOOL_LINK_MODE_FEC_NONE_BIT	= 49,
>  	ETHTOOL_LINK_MODE_FEC_RS_BIT	= 50,
>  	ETHTOOL_LINK_MODE_FEC_BASER_BIT	= 51,
> +	ETHTOOL_LINK_MODE_50000baseKR_Full_BIT			= 52,
> +	ETHTOOL_LINK_MODE_50000baseSR_Full_BIT			= 53,
> +	ETHTOOL_LINK_MODE_50000baseCR_Full_BIT			= 54,
> +	ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT		= 55,
> +	ETHTOOL_LINK_MODE_50000baseDR_Full_BIT			= 56,
> +	ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT		= 57,
> +	ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT		= 58,
> +	ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT		= 59,
> +	ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT	= 60,
> +	ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT		= 61,
> +	ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT		= 62,
> +	ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT		= 63,
> +	ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT	= 64,
> +	ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT		= 65,
> +	ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT		= 66,
>  
>  	/* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit
>  	 * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_*
>  	 * macro for bits > 31. The only way to use indices > 31 is to
>  	 * use the new ETHTOOL_GLINKSETTINGS/ETHTOOL_SLINKSETTINGS API.
>  	 */
> +	ETHTOOL_LINK_MODE_LAST,
>  
>  	__ETHTOOL_LINK_MODE_LAST
> -	  = ETHTOOL_LINK_MODE_FEC_BASER_BIT,
> +	  = ETHTOOL_LINK_MODE_LAST - 1,
>  };

The name ETHTOOL_LINK_MODE_LAST is a bit misleading, maybe it should
rather be called ETHTOOL_LINK_MODE_COUNT. Also, there should be
parentheses around the expression to avoid surprises when
__ETHTOOL_LINK_MODE_LAST is used in an expression.

But this change is not in kernel include/uapi/linux/ethtool.h in
mainline, net or net-next. As ethtool-copy.h is supposed to be a copy of
sanitized kernel uapi header, you should make the change there first and
then sync the header to ethtool.

Michal Kubecek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ