Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp537004ybi; Wed, 3 Jul 2019 00:38:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJkFLCpq/Evxouc+G0g4oq1JfkNphX9RIb5wdOdvTJihv8MYkc9bNhDxzACqRNQxmWTgAP X-Received: by 2002:a17:90a:22c6:: with SMTP id s64mr11171081pjc.5.1562139523597; Wed, 03 Jul 2019 00:38:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562139523; cv=none; d=google.com; s=arc-20160816; b=sii/TIJiywzcsBYs6P4ouuVKn0kJvITXgp5sfGTk3Vv1cZUxNVrXL3zRCpHX3fTFzw YPMiLThimhII2wgfiYKHTdNWsBWR1ltBc3QGborkyKYrmjr/Br62NwdvUvyPyTZqDdwj fCn5iyEfdNBlYpn4pE7sMzwRly8Dmjt35LVsVh7xMy6wJ1l2hlSEsNMvBg4uDzAHkoHk FAEUjoHwfOcvoVaJ2vcKgrec16jrWGeNcloq+CWjza9J8OBdlbEoGGO8tMEb6fC975El fgJ/DxWsLZzclRxTuspkjyTKIZSm/TkK2ppsjSclTVEAgPFnh5rk51I7qX7q9mQ8Cot/ zb+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=83ZypgVovHchPGYtzWCW9O2BsXoFVhYuiT2t0LsSa68=; b=KHr35SY5E0g8rZyOG9z3PgZYiLfYlPvk67/t448y3cjAH4TybHtrFRRp9Aml0m+/B/ jb4JC8xRJxklzKgKW7eHJduxUjbBSlh4buAnTwcFIJMh2I0AtHCkIXB8bF5fJbxNbn5w +PtkcOJuLuQ3vdRICKAVoUD7y21VbDZ20R+C+tEmNEZcMxl0B3xIjbHQoWVJNE9XZE6O gnOY1YtfIkYimlChONrpFTRB74OZp/qmthUekaELzl+WgI2SpP4/fIg1k7bbKWZIDtA1 IZ/goKCxhQCqrQyb8PxK6Hu+24V0n1moqWFpdX9uy0SsMquVTf4R0siCgTHBV2vNrWWH g6xA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p97si1264555pjp.34.2019.07.03.00.38.27; Wed, 03 Jul 2019 00:38:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727142AbfGCHiG (ORCPT + 99 others); Wed, 3 Jul 2019 03:38:06 -0400 Received: from mx2.suse.de ([195.135.220.15]:57340 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727008AbfGCHiF (ORCPT ); Wed, 3 Jul 2019 03:38:05 -0400 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 5C060AFD2; Wed, 3 Jul 2019 07:38:04 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id A2C74E0159; Wed, 3 Jul 2019 09:38:02 +0200 (CEST) Date: Wed, 3 Jul 2019 09:38:02 +0200 From: Michal Kubecek To: netdev@vger.kernel.org Cc: Jakub Kicinski , David Miller , Jiri Pirko , Andrew Lunn , Florian Fainelli , John Linville , Stephen Hemminger , Johannes Berg , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v6 11/15] ethtool: provide link mode names as a string set Message-ID: <20190703073802.GJ20101@unicorn.suse.cz> References: <1e1bf53de26780ecc0e448aa07dc429ef590798a.1562067622.git.mkubecek@suse.cz> <20190702190419.1cb8a189@cakuba.netronome.com> <20190702191124.259c6628@cakuba.netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190702191124.259c6628@cakuba.netronome.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 02, 2019 at 07:11:24PM -0700, Jakub Kicinski wrote: > On Tue, 2 Jul 2019 19:04:19 -0700, Jakub Kicinski wrote: > > On Tue, 2 Jul 2019 13:50:34 +0200 (CEST), Michal Kubecek wrote: > > > +const char *const link_mode_names[] = { > > > + __DEFINE_LINK_MODE_NAME(10, T, Half), > > > + __DEFINE_LINK_MODE_NAME(10, T, Full), > > > + __DEFINE_LINK_MODE_NAME(100, T, Half), > > > + __DEFINE_LINK_MODE_NAME(100, T, Full), > > > + __DEFINE_LINK_MODE_NAME(1000, T, Half), > > > + __DEFINE_LINK_MODE_NAME(1000, T, Full), > > > + __DEFINE_SPECIAL_MODE_NAME(Autoneg, "Autoneg"), > > > + __DEFINE_SPECIAL_MODE_NAME(TP, "TP"), > > > + __DEFINE_SPECIAL_MODE_NAME(AUI, "AUI"), > > > + __DEFINE_SPECIAL_MODE_NAME(MII, "MII"), > > > + __DEFINE_SPECIAL_MODE_NAME(FIBRE, "FIBRE"), > > > + __DEFINE_SPECIAL_MODE_NAME(BNC, "BNC"), > > > > > + __DEFINE_LINK_MODE_NAME(10000, T, Full), > > > + __DEFINE_SPECIAL_MODE_NAME(Pause, "Pause"), > > > + __DEFINE_SPECIAL_MODE_NAME(Asym_Pause, "Asym_Pause"), > > > + __DEFINE_LINK_MODE_NAME(2500, X, Full), > > > + __DEFINE_SPECIAL_MODE_NAME(Backplane, "Backplane"), > > > + __DEFINE_LINK_MODE_NAME(1000, KX, Full), > > ... > > > + __DEFINE_LINK_MODE_NAME(5000, T, Full), > > > + __DEFINE_SPECIAL_MODE_NAME(FEC_NONE, "None"), > > > + __DEFINE_SPECIAL_MODE_NAME(FEC_RS, "RS"), > > > + __DEFINE_SPECIAL_MODE_NAME(FEC_BASER, "BASER"), > > > > Why are port types and FEC params among link mode strings? > > Ah, FEC for autoneg, but port type? The bits in supported bitmap are used to pass information which port types the device supports (but the information which port is selected is passed in a different way :-( ). It is used by ethtool to provide the "Supported ports:" line in "ethtool " output. I don't like this design where link modes are mixed with few different and only loosely related bitmaps. Maybe it would be cleaner to split it into multiple bitmaps and later change the backend (ethtool_ops) too and only translate to/from this combined bitmap for legacy ioctl interface. Michal > > > > + __DEFINE_LINK_MODE_NAME(50000, KR, Full), > > ... > > > + __DEFINE_LINK_MODE_NAME(1000, T1, Full), > > > +}; >