Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp936232ybb; Thu, 28 Mar 2019 15:29:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyH8fVy3inqk0VesQaslfw95b6aIDJZ9mM8iF2rQnJGvJVHlaW/Scaj4HgdyCzRhe2vU6fj X-Received: by 2002:a63:2ad4:: with SMTP id q203mr43371619pgq.43.1553812179686; Thu, 28 Mar 2019 15:29:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553812179; cv=none; d=google.com; s=arc-20160816; b=HNobWGuoCHmxnQhOy9y+5aS/KsYPjFB1dkedYjDQpacePuxYREzchlQVNhO+VyNRKc Ukp7oX9T/atIksNAHnIEaYB2f5PN5GOsFulB2bI8lc0klUWGOS6sLj9wyX4eiYVDQO7z +UNpYTwEOSX7C6/wBUDGXoPTNnZwEntiCFgyI0umNFp9hvsH8/SZibqYuOejEjjPBCJf Rp4q0f0UU2Uafyx7ML7t6/n8Oq312M/Ch4q708syzYqLda5EoiyM86JqJ40M9NUCNOg0 NAOkAbhOUwYMuojcdanU3/WBAcpnz2IMe7x2biCoZO7CQUszMRMEfXVzkG6j9Mb5tljz wg/Q== 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=jTrUacPSzq0iYCzn4YEHsDon2VzC2zRRtY7dSeBYJv0=; b=csQqF4J+iTTxguAWLw35Gxj6iyaPGr+uRQd2PPEGx0uDVasqEeeFj8bg8Uy3b3sW6c 3zvHeeJmLpvHkLI0IOiG1ESwDUC7jMcnQkLNIF+cneLIR/aVA1l4V9NTig4nT7PxtcVK ucU4YPXZWwedhLUx0UWIAbLg9smTYNoav9JjacHzNuRXqIlCpDEusqT3LRAvAB26+OYs TWuQPYOh1PHDO+UPdLvfKYhJI8b3w8b4M/Hw8v4xQmTJCIHn4FNxwBbptqN7ZZfEUfaJ FcXjvsM8EzMfp36zXe/Ua7pSuuFWj9AldixBpaA7dvM2M5FTCt9ZirgWyQ0pmpAqzORb Ll1w== 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 j24si285037pll.135.2019.03.28.15.29.23; Thu, 28 Mar 2019 15:29:39 -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 S1728252AbfC1W2r (ORCPT + 99 others); Thu, 28 Mar 2019 18:28:47 -0400 Received: from mx2.suse.de ([195.135.220.15]:56074 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727906AbfC1W2r (ORCPT ); Thu, 28 Mar 2019 18:28:47 -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 AAD4EACC6; Thu, 28 Mar 2019 22:28:45 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id BBC48E1404; Thu, 28 Mar 2019 23:28:41 +0100 (CET) Date: Thu, 28 Mar 2019 23:28:41 +0100 From: Michal Kubecek To: Jiri Pirko Cc: Florian Fainelli , David Miller , netdev@vger.kernel.org, Jakub Kicinski , Andrew Lunn , John Linville , Stephen Hemminger , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v5 12/22] ethtool: provide string sets with GET_STRSET request Message-ID: <20190328222841.GI26076@unicorn.suse.cz> References: <2c29310b-a2a0-3867-a09f-51f2dc47ecd3@gmail.com> <20190328071853.GY26076@unicorn.suse.cz> <20190328134313.GO14297@nanopsycho> <20190328140428.GG26076@unicorn.suse.cz> <20190328173524.GR14297@nanopsycho> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190328173524.GR14297@nanopsycho> 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 Thu, Mar 28, 2019 at 06:35:24PM +0100, Jiri Pirko wrote: > > Moreover, I think that speed, duplex and type should be sent > separatelly: > > ETHTOOL_A_LINK_MODE_LIST_OUR start nest > ETHTOOL_A_LINK_MODE start nest > ETHTOOL_A_LINK_MODE_SPEED = 100 /* this should be u64 */ > ETHTOOL_A_LINK_MODE_DUPLEX = ETHTOOL_LINK_MODE_DUPLEX_FULL > ETHTOOL_A_LINK_MODE_TYPE = ETHTOOL_LINK_MODE_TYPE_BASET > ETHTOOL_A_LINK_MODE start end > ETHTOOL_A_LINK_MODE start nest > ETHTOOL_A_LINK_MODE_SPEED = 10 > ETHTOOL_A_LINK_MODE_DUPLEX = ETHTOOL_LINK_MODE_DUPLEX_HALF > ETHTOOL_A_LINK_MODE_TYPE = ETHTOOL_LINK_MODE_TYPE_BASET > ETHTOOL_A_LINK_MODE start end > ETHTOOL_A_LINK_MODE_LIST_PEER end nest > > Does not really make sense to combine those 3 attributes together. This helped me to realize the primary source of misunderstanding: as I'm working on kernel and ethtool implementation simultaneously, I don't look only at the API itself and don't consider only if its design is clean and logical. I always think about the actual userspace programs wanting to use the interface and try to imagine what the design means for them. So when you say e.g. "this belongs to rtnetlink", I have to admit that from strictly logical point of view you are right but at the same time, chain of thoughts starts: "that means two sockets; we need a table which command needs which, some might need both, monitor will have to listen at two sockets, that's fork/pthread/poll..." From this point of view, the scheme above which, on its own, makes perfect sense (there might be a bit of a problem with 10000baseR_FEC mode but that one is a trouble in any scheme), means that one side will translate the link mode number to the three parameters and the other will look the triplet out in its own table to get the link mode number. On userspace side, there will be another translation between link mode number and name. What exactly is the gain from such representation? No idea. There is one crucial difference between ethtool and devlink. You are building devlink from scratch so you define the logic, define the API based on that logic and make both NIC drivers and userspace conform to it. With ethtool, the situation is exactly the opposite: on one side, there are ethtool_ops as a constraint, on the other, it's ethtool with its feature set and users used to it. Changing ethtool_ops is going to be slow and painful process. Changing the users and their habits... we already know how that works. Michal