Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1235900ybb; Thu, 28 Mar 2019 23:54:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyw9XA2OvSdenqK8TLUoaEmFAVN4VrHKzx+kctTWyCT4nPojww3X4calaoGflmORub/bRpx X-Received: by 2002:a63:6142:: with SMTP id v63mr43872026pgb.342.1553842464503; Thu, 28 Mar 2019 23:54:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553842464; cv=none; d=google.com; s=arc-20160816; b=WFcgBl9nm8vPcn5CRIznsXpmCtOD3cfrrp1CxM4kG80j8IIxp1A5fAIrvY+5LNioqp dE1ZEqPIPqd0Mb1MeZFv9g5sx8ns24yO8QFB9uCVQKy51Wbo/lbNS+6U0o7skOY4hSf4 zZRZGWBYzOvIBhrpXuzdY5EiQTCYQZuBTJTbGY+Q7l2c2KVkO1MFfcqU8HLNxUYeO0Yr O7cfbNGzqC7wcDAtflwDh+o4+s5d0V4BIyrWv9FHbOM7LwRZDVNSVojVZLbbbjg0mDxZ 5Y6WnkOVqu13+IJ37FjoG/27R3fvRXHwBsXhjA90gzdPWoceQB1ykOYHuFkpxEW2r0pc BHTg== 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:dkim-signature; bh=ruXtmWQLgkc46B3JMJbHXo3aXemVQmrTySKmr9DUGjU=; b=lzZSP2DZ+4+5xxGvMI+LV8iiA/gkXoHQlWMcN1XIO786o5MjBpol/PYGHHFY5GTiHN MbT3fHLT1Jm6FHrGiQZJywN1stN1aKxAVhSi9QlT/XkxAuGBWMCrkQmsGvYCg3nzPMq3 ZxsSgEMnR6D9nHhioFb+abDlFBrVw2bnQic77UcENNbuFJUfHnEnZzwxEeLwCl2qzAop PsDh8fjR502i9cYYvx3RUqktZXVZSbXfSQJJm/CKbo/JtP6b9u+aT8SdQcqIMyRXmF9M veHi4G9EU3tCm6OTpepgmKYT9Yg1Z3IgJnXMt0K17n3Un1NsYjxamY6/4Y1is4cCeO9C hHEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=kS8V7sZO; 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 e11si1288766plb.140.2019.03.28.23.54.08; Thu, 28 Mar 2019 23:54:24 -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; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=kS8V7sZO; 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 S1728842AbfC2GwU (ORCPT + 99 others); Fri, 29 Mar 2019 02:52:20 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33603 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728651AbfC2GwT (ORCPT ); Fri, 29 Mar 2019 02:52:19 -0400 Received: by mail-wr1-f68.google.com with SMTP id q1so1208341wrp.0 for ; Thu, 28 Mar 2019 23:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ruXtmWQLgkc46B3JMJbHXo3aXemVQmrTySKmr9DUGjU=; b=kS8V7sZOnaaY7B4NLyVTXAeNN64EIl/jjmVg2JDKKfWIOXiQhmePO8yZX+Kh6tRgdg xIzjC14ms2PLJ4Ttrgo0ueNPeBQFMo7KIuDq/MfgJsP2vrHEBQC2kBXkfaZEsaw1gYLR Ebolr/At4JzNYsLFO55VvSBGoptXRof90TWAJ6rNbXKYglpbhU9w4RSi/L8apBnt09Vh r2iT80kGhoGiuaevGX3Gb4TF7U1vxP7gFvhbAr1/9NIRz11u4fXCqiSw9uieAtsxX0+W Rp1hqMk7Pk/WHPMxciOOqa355NTufVeq1X+BZGoAVXC/AM2eestqFg03aqfym0Ub1ksh U8aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ruXtmWQLgkc46B3JMJbHXo3aXemVQmrTySKmr9DUGjU=; b=ZfGje5HiET/ucXgHNGGAWbXujWHf3vPOXiRV0Af/xbayoP16nzzFYARCI70IlMs72Q oztOP2hfIsD9K+MTZXpwc0v+I35NgehGPcePHZxr4JSzsnCD8ZnRKqRxwp82a/voCu7L WzwiKbAwzJv7tEaa30Oy9GPng7OmU3XpQEVktTIr/WmKxut2FuagbxvNofW7Wy6wgBZA LCVHk3coW4uVLBDjoFJ+32Vd/yjHk0E/zsCH0EfwHxGW0Mjr/l4HT+9pi9e61WUokR0E v2YTImiZZJfvTN8hCIYN5BNfJqPhFBPCc2+3qMEN2F0tALn7wCohALe7vI77HA/jCQC/ 8BiA== X-Gm-Message-State: APjAAAUhCzsjBz51Me+RyUWrmxsyn4YKvdES3qDbDOwidD/rWLg3tGXP pam5jXANFFYxtJoXrS2Rfp/BKw== X-Received: by 2002:adf:f088:: with SMTP id n8mr32166297wro.112.1553842337716; Thu, 28 Mar 2019 23:52:17 -0700 (PDT) Received: from localhost (ip-94-113-223-73.net.upcbroadband.cz. [94.113.223.73]) by smtp.gmail.com with ESMTPSA id a82sm1234944wmf.11.2019.03.28.23.52.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Mar 2019 23:52:16 -0700 (PDT) Date: Fri, 29 Mar 2019 07:52:16 +0100 From: Jiri Pirko To: Jakub Kicinski Cc: Michal Kubecek , 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: <20190329065216.GT14297@nanopsycho> 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> <20190328204329.GH26076@unicorn.suse.cz> <20190328140607.285dbfc6@cakuba.netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190328140607.285dbfc6@cakuba.netronome.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thu, Mar 28, 2019 at 10:06:07PM CET, jakub.kicinski@netronome.com wrote: >On Thu, 28 Mar 2019 21:43:29 +0100, Michal Kubecek wrote: >> 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? > >I don't think there is a disagreement about stuff which is private to >the driver. The strings have to be exposed there. Yeah, there is no other way of doing that. However, please check if some driver-specific setting cannot be moved to devlink with use of devlink params (we have both devlink driver specific params and per-port devlink driver specific params).