Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp877543ybb; Thu, 28 Mar 2019 14:07:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqysIKlYVuQCjwF5f/qLoOdt/6sP3WjgfzscFXeQmD8VN/iRGwE68D/iAYWSb4gPYpkbKBxO X-Received: by 2002:a63:2045:: with SMTP id r5mr41446880pgm.394.1553807240103; Thu, 28 Mar 2019 14:07:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553807240; cv=none; d=google.com; s=arc-20160816; b=dYyDhNnsns45oPI01GVD0xtOHCTo19JI6FVy95uUCxK/fXiVHKOW7H7qC2+0uYjf0Y wwiv7KG7h90S4Ma0wzMM5I0mT6+8u76LNNlyqcS70QMK0bIvw5q2r1+9kMvmlnSbxjgI U6j80nDULK3bjlY5svZ3h16qjQ+bBHr9GgJ0fBc3hXOXCXkIEoH7tAXqQoz2dPwdyqMO VAEsquzNh2+GH69rVaQ60CtMP7QkLrQrEJD4vMlQzDfGKRhqXxhn23SNZbZbV7/Kctxe qw+NNn7FleVgSi9iIGsrYZfxd3w8+O20NVBxCSuvjHPOgTDD1FtSD/HP1sLroGo8kXZS 7hIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=C/99GerV3GeiTHEZ0KDUbh9xh10S+/GOIQtL20fq40E=; b=ApRYpfrcj1zDlL4rX90HaCgBcndCoRo3hGRtoW0CbzuyISeqwkt5FLCpuPvj5AmCix 686LkZ8WkRiY1s5uxGfIn28e4TEEry5cimuksZeBrr5S5xZFjZ9Vza+BU2iY+Vdc5yXD WNc2pW3yZKfTWcrxfR9OFKJ6Q2qb1iD6Bi9yIkS1LCAh8uYBEN2ufWL7V1/bPvgZM9jp TptYp8pXM5AXhS6JDzbVj8VpbZFrZckZ7DiwHZGeTOl5VYKSeD3qAjm1CJ2ypHlMZe8V PkK640o+jiCwGJ+cQ5Ogk+65oWqvqkIk9thXe0Gw5hgvyfj/gjEhkCjM/b9CQeoUTkMb KH7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=OnAD3sQB; 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 y11si122788plk.323.2019.03.28.14.06.58; Thu, 28 Mar 2019 14:07:20 -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=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=OnAD3sQB; 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 S1726703AbfC1VGN (ORCPT + 99 others); Thu, 28 Mar 2019 17:06:13 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:37817 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726257AbfC1VGN (ORCPT ); Thu, 28 Mar 2019 17:06:13 -0400 Received: by mail-qt1-f194.google.com with SMTP id z16so232915qtn.4 for ; Thu, 28 Mar 2019 14:06:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=C/99GerV3GeiTHEZ0KDUbh9xh10S+/GOIQtL20fq40E=; b=OnAD3sQBXFDgFGuGjBEVNloLLNSNGLN74N/cv2j1V4BLOA/srNurPuy8sTPBqq1zBp 1NjDSrqjh3vBn0vAU6ZXx6GeBk/UHRi4VKi/DygagDPad2vnE+DS1CkD51lKXudm5R+L MFnS114Fafn7m/fD6tche7Z6sAO3jRw51VnccglVU9/e48434dNRtTWikcXeK/dIw04k X+Ctk+Z/a+IiXU0yyi9Juf/wKHL5F3mJPoeU6ecsF+gPii2OQLHZjRW9xX3ooUJukDBh 3uuhy154b1hwH2hQTsOAxAGM2Vhb0tZ68z/KaEDtI21mkUhlLN9ALigtpqyAwh6lLfJV 5aCQ== 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:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=C/99GerV3GeiTHEZ0KDUbh9xh10S+/GOIQtL20fq40E=; b=YyYRrcRUsSWPearIcz02SFwHY5DHFEsEDQ+0lzAvmc+vUKpIwAcKcwtq2vsxdlwY5c dpbuVKHt7ZIxEkGfOsYz+n42TZPeIAQM6/9zQ43l+8zDLYQfJlp99UK4ajo1Z8/hSeBX 4BOIodZWwj8VUJy9eEUw7K1kzDnPBqQfys1GCRMJNORS80oMqYKqz11LYhpZv0I+EUSN aKNP7/XbVBncDsL+hC8w/d0BLHR7T6W5yz4uN8bvzmKyd4JpNK8Rg8rKAwhItOXt1L4Z FXtNJQkBzL00TDeCQZXDOotWzNOresSMpdfZtc8Yx77R40t5XnKYobr6Gg4gFt9z4qVw pc4w== X-Gm-Message-State: APjAAAXUfFI01n8sGTLOd0FPa4m9I30cA+OLdsfM9/MQlCKooW3I30KK vsA+8OZR5hyc1apYJtYcX2j5zw== X-Received: by 2002:aed:3b14:: with SMTP id p20mr38268219qte.240.1553807172449; Thu, 28 Mar 2019 14:06:12 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id i11sm71499qkg.33.2019.03.28.14.06.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Mar 2019 14:06:12 -0700 (PDT) Date: Thu, 28 Mar 2019 14:06:07 -0700 From: Jakub Kicinski To: Michal Kubecek 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: <20190328140607.285dbfc6@cakuba.netronome.com> In-Reply-To: <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> <20190328204329.GH26076@unicorn.suse.cz> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.