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=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 4451DC433DF for ; Mon, 19 Oct 2020 13:24:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9BEE222E8 for ; Mon, 19 Oct 2020 13:24:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728078AbgJSNYt (ORCPT ); Mon, 19 Oct 2020 09:24:49 -0400 Received: from mx2.suse.de ([195.135.220.15]:53894 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727796AbgJSNYs (ORCPT ); Mon, 19 Oct 2020 09:24:48 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1552CACAC; Mon, 19 Oct 2020 13:24:47 +0000 (UTC) Received: by lion.mk-sys.cz (Postfix, from userid 1000) id 937BC60563; Mon, 19 Oct 2020 15:24:46 +0200 (CEST) Date: Mon, 19 Oct 2020 15:24:46 +0200 From: Michal Kubecek To: Jiri Pirko Cc: Danielle Ratson , Andrew Lunn , Jakub Kicinski , Ido Schimmel , "netdev@vger.kernel.org" , "davem@davemloft.net" , Jiri Pirko , "f.fainelli@gmail.com" , mlxsw , Ido Schimmel , "johannes@sipsolutions.net" Subject: Re: [PATCH net-next 1/6] ethtool: Extend link modes settings uAPI with lanes Message-ID: <20201019132446.tgtelkzmfjdonhfx@lion.mk-sys.cz> References: <20201010154119.3537085-1-idosch@idosch.org> <20201010154119.3537085-2-idosch@idosch.org> <20201011153759.1bcb6738@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20201012085803.61e256e6@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20201016221553.GN139700@lunn.ch> <20201019110422.gj3ebxttwtfssvem@lion.mk-sys.cz> <20201019122643.GC11282@nanopsycho.orion> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201019122643.GC11282@nanopsycho.orion> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, Oct 19, 2020 at 02:26:43PM +0200, Jiri Pirko wrote: > Mon, Oct 19, 2020 at 01:04:22PM CEST, mkubecek@suse.cz wrote: > > > >It would be quite easy to extend the ethtool command line parser to > >allow also > > > > ethtool -s advertise ... > > > >in addition to already supported > > > > ethtool -s advertise > > ethtool -s advertise / > > ethtool -s { { on | off } } ... This should have been ethtool -s advertise { { on | off } } ... > >Parser converting simple list of values into a maskless bitset is > >already there so it would be only matter of checking if there are at > >least two arguments and second is "on" or "off" and using corresponding > >parser. I think it would be useful independently of this series. > > Understood. So basically you will pass some selectors on cmdline and the > uapi would stay intact. > How do you imagine the specific lane number selection should look like > on the cmdline? As I said, I meant the extension suggested in my mail as independent of what this series is about. For lanes count selector, I find proposed ethtool -s ... lanes ... the most natural. >From purely syntactic/semantic point of view, there are three types of requests: (1) enable specific set of modes, disable the rest (2) enable/disable specific modes, leave the rest as they are (3) enable modes matching a condition (and disable the rest) What I proposed was to allow the use symbolic names instead of masks (which are getting more and more awful with each new mode) also for (1), like they can already be used for (2). The lanes selector is an extension of (3) which I would prefer not to mix with (1) or (2) within one command line, i.e. either "advertise" or "speed / duplex / lanes". IIUC Jakub's and Andrew's comments were not so much about the syntax and semantic (which is quite clear) but rather about the question if the requests like "advertise exactly the modes with (100Gb/s speed and) two lanes" would really address a real life need and wouldn't be more often used as shortcuts for "advertise 100000baseKR2/Full". (On the other hand, I suspect existing speed and duplex selectors are often used the same way.) Michal