From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 114D4C43381 for ; Sun, 24 Feb 2019 18:12:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB30C20661 for ; Sun, 24 Feb 2019 18:12:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727342AbfBXSLH (ORCPT ); Sun, 24 Feb 2019 13:11:07 -0500 Received: from mx2.suse.de ([195.135.220.15]:59370 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726458AbfBXSLH (ORCPT ); Sun, 24 Feb 2019 13:11:07 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E65F2AD70; Sun, 24 Feb 2019 18:11:05 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id 82AD4E00AD; Sun, 24 Feb 2019 19:11:04 +0100 (CET) Date: Sun, 24 Feb 2019 19:11:04 +0100 From: Michal Kubecek To: Tariq Toukan Cc: "John W. Linville" , netdev@vger.kernel.org, Eran Ben Elisha , Aya Levin Subject: Re: [PATCH ethtool] ethtool: Add support for 200Gbps (50Gbps per lane) link mode Message-ID: <20190224181104.GA1914@unicorn.suse.cz> References: <1551020901-20257-1-git-send-email-tariqt@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1551020901-20257-1-git-send-email-tariqt@mellanox.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, Feb 24, 2019 at 05:08:21PM +0200, Tariq Toukan wrote: > From: Aya Levin > > 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 > Signed-off-by: Tariq Toukan > --- > 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