Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp861121ybb; Thu, 28 Mar 2019 13:44:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqz305r6csphtMz6+vQDBqofilqrEsJJjMuJbQa0HtSX1+c9c6sft/QBGknM9aEom8YXJvKg X-Received: by 2002:a17:902:864a:: with SMTP id y10mr45246840plt.76.1553805889386; Thu, 28 Mar 2019 13:44:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553805889; cv=none; d=google.com; s=arc-20160816; b=TfQtqys8DcmpZjg4CQArLopO+dK50JqEahY4zo1fIN6bNbMN+kOuub2G+EuMTnEvoW zO3eXrDT3+BZ9mpN69tOvjIedyMSljUGg+B7VZH5KSU0adgWgIqzizKEfDRXZbkn/uv0 cDXXKkeAUYrnAqOpczz5ovYsYHOgTDbNNf724OWu1NBXrvUor/kYaUdouuZ3JAX7t+A3 NQg13xBvJgz4jZ1SxrhtuMTXCDD1BEJc0N7p2+HTsPJSnkMshMC0gxoNw9/yIM5i9Q+d BdUUGHEc9dEeAnptIwKMLtsCjl5IwEqgNlfFUD3djAE9qAML9coLT5pdqLf8P0CHqjVw Fpng== 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=5jlSdDbSSJfEVIbblkW7nvEaR/0szGbVKlENeBYsAxE=; b=Wzwh3OApujmu528ABBuFW2ybxzBcUo3bl0ItwNj3vDslaWueKhW06RP7lfjEVBUzRO MMwKivcgUn8wUzJqwPYQBw3Eowdp18l/FijrD2sCt11h/jVpr/onPin7udd+KIdOdw9G f4FPD49DU6ZUainJJ5YDlHoH8+3WaFWP1dBjLKAmtGmP6NFDnCFBxP49Ko58DqzQod6t KXX+dDTVGOZp+cwL0+u7OFGppThct49qfOaKIEbSPvhQ2BGwE1Fhl56zMSIuOJNawXHw TrFdSDR/9APGz5OkEtr1kxhKiOHoqgXBlVrblRLQ/uii5TEKg8lUu7bjP7xYBhbnpoSt ysMA== 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 bd12si75309plb.337.2019.03.28.13.44.33; Thu, 28 Mar 2019 13:44:49 -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 S1727231AbfC1Uni (ORCPT + 99 others); Thu, 28 Mar 2019 16:43:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:34074 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726095AbfC1Uni (ORCPT ); Thu, 28 Mar 2019 16:43:38 -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 9DC56AC86; Thu, 28 Mar 2019 20:43:31 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id CF677E1404; Thu, 28 Mar 2019 21:43:29 +0100 (CET) Date: Thu, 28 Mar 2019 21:43:29 +0100 From: Michal Kubecek To: Jakub Kicinski Cc: Jiri Pirko , Florian Fainelli , David Miller , netdev@vger.kernel.org, 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: <20190328204329.GH26076@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> <20190328115256.2a7cb952@cakuba.netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190328115256.2a7cb952@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 Thu, Mar 28, 2019 at 11:52:56AM -0700, Jakub Kicinski wrote: > On Thu, 28 Mar 2019 18:35:24 +0100, Jiri Pirko wrote: > > Thu, Mar 28, 2019 at 03:04:28PM CET, mkubecek@suse.cz wrote: > > >On Thu, Mar 28, 2019 at 02:43:13PM +0100, Jiri Pirko wrote: > > >> > > >> I don't like this. This should not be bitfield/set. This should be > > >> simply nested array of enum values: > > >> > > >> enum ethtool_link_mode { > > >> ETHTOOL_LINK_MODE_10baseT_Half, > > >> ETHTOOL_LINK_MODE_10baseT_Full, > > >> ETHTOOL_LINK_MODE_100baseT_Half, > > >> ETHTOOL_LINK_MODE_100baseT_Full, > > >> ETHTOOL_LINK_MODE_1000baseT_Full, > > >> }; > > > > > >We already have such enum. The problem with your "no string" approach is > > >that it requires all userspace applications to (1) keep this enum in > > > > That is how it is usually done. UAPI defines ATTRS and values, userspace > > assigns appropriate strings. > > +1 FWIW, I'm with Jiri on the string situation. And I'm still waiting for any of you to tell me how would you handle private flags, stats, tests etc. without the string sets. Ditching the verbose form of bit sets would be a nuisance for userspace using the interface but compared to e.g. having to mix three different kernel interfaces, it's just a minor problem. Ditching the static string sets would mean giving up the opportunity to get rid of having to sync all kinds of tables with every userspace consumer whenever a new flag is introduced. Pity... but still doable. But how do you want to do without the string sets which are provided by drivers? Michal