Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1307990ybb; Fri, 29 Mar 2019 01:44:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7J64CIYsOk7x7vqHL91pnSzJ+t2KfyYyweGRYseBixYhMG0iY4Kx0yVjLQ8bR5eFVIvMG X-Received: by 2002:a17:902:b706:: with SMTP id d6mr12407731pls.250.1553849082100; Fri, 29 Mar 2019 01:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553849082; cv=none; d=google.com; s=arc-20160816; b=GLz8XF2AEHQJQZ1I0Bgo3+AbY2WoqC8+XDG0ILbNf+NlMA1SgrkqDhdpcz8USwpqji 4sqM1lTEDF7DsRke80weW5Ap3sliuuOAWQqC70k43oeqm4tQuejAkx2M+rBurDIyxUdB PYUNoUbxyuZt7aL2OdNhbLgomU2k/DekljRSbXowj0e8Y/Lk3F1f6bxOUIYM+PzLONLj b6ELWSKSV3CT6wsUkINqMcimY4pASEpj6xMAhNeNHgXGHyYtZQa4NRPteSkvBE26SRIT diiy5cLNxMdSDIG5yal0iIA6P+ltlOKM+r2puorBlH//RV9+0TS2XJnM4oroA7Kxr9gu E6qg== 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=EP1zrm670XkMo8KCPbZsfPrz4SZTLQl6uR5GdiRGDVw=; b=QpO/rc841g8cWrr+oxID/Dr5AhUYs3qqyuLpEvHRCtRG4AcuLL+MesAggJO/7Nc3Vg UHw6nk/cOlRzy0OlulLX/s+npBUE7BLjqmEOBlvfo9QCDPH5wCa0OoBELVxwR7ax1EN/ JaYYil6yi5WCe01YH4HqHHEuY8AXgMRq6FdcPFNzVjszL4eN++mbZOvYYoCZlHtbWThA TVmIRQEdkMV1limMLAiuyg+AYHL00bP1gB4v25/ZBdlT2xzj6Df85RWFKrt7sZ/yGg2m x5urjLC7RHHkCgdhe9za36FVTAiOd2JxDqy2MLONkqhRhhT4x3a33zXj2awZPXLFw4V8 q7ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b="vSbvr/z4"; 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 z4si1405706plo.166.2019.03.29.01.44.26; Fri, 29 Mar 2019 01:44:42 -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="vSbvr/z4"; 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 S1729150AbfC2Inq (ORCPT + 99 others); Fri, 29 Mar 2019 04:43:46 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:35254 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729102AbfC2Inq (ORCPT ); Fri, 29 Mar 2019 04:43:46 -0400 Received: by mail-wm1-f66.google.com with SMTP id y197so1801077wmd.0 for ; Fri, 29 Mar 2019 01:43:45 -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=EP1zrm670XkMo8KCPbZsfPrz4SZTLQl6uR5GdiRGDVw=; b=vSbvr/z4Ea6ahtF4IXK8dlUzhQVKtb5yVtl22uqikWMSoi2Xq6LEijIMvvPPhflQNk PwLzZUNC+uISPlESPgiQTQ4TWuJgYupAqlvU/EUZKcciHM4+YEkG9+5No6fHSto/Tat3 vwnnRSVe2ls80/Xv8M6dO1sEP24NMdFtPcW1AhGERF3q7KVsHfnY7xZuTN0i2g5qA0Bn dKuuX8GIB+rzudDBTZDi0HpEJ1eN3CRX//LNQnJNv3/oQB7mG0qdS4F329JBQyRlDmKG 8AKlvXKtOjvrgTi/hn2YFt3idxhwifKiMKRFbNae3RDpWAgF4oTSyaIe+zx1rV8GeE6i j7lA== 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=EP1zrm670XkMo8KCPbZsfPrz4SZTLQl6uR5GdiRGDVw=; b=N9uPxuFgyJIAuuca+Jx0MPXFHQsf/gI2pPUe7j8e7rWbPqKQkXlvb3pmXWbee4b9Q6 4zd3B4or2IjCceYwy0r+AOWd3/N67YZwoiSgv67ozOeMb0m2tFUgk4bgcTeiE3/p0PpF wBsHANsIDCaaxGiQSCl4A3tV1ExWzGSJVumkUU3yBk4ap+3RMxs0Obe6yS6mJSny/Irc 11ithoz0pfN+0J4Vp6ysJRCBEQQ+8ra7PX5AtOvswfhM/ufIalpn6VR2oHFuyBkEdUkW dG/36Cr7JqrkwTkyStf+V36iG3B9Ujua/5Iz04HVstNu6Yex13iKua099QglMwd5s6nO c1Pg== X-Gm-Message-State: APjAAAW+63f2AcUhLbSYwOjSEv9TkSmb1pbKBkJpSBdG7QwxI7GAquTp RpxBGObe3Luf3+90dc+nn1nwHA== X-Received: by 2002:a05:600c:24f:: with SMTP id 15mr2629966wmj.48.1553849024707; Fri, 29 Mar 2019 01:43:44 -0700 (PDT) Received: from localhost (ip-94-113-223-73.net.upcbroadband.cz. [94.113.223.73]) by smtp.gmail.com with ESMTPSA id a10sm1418923wrs.19.2019.03.29.01.43.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2019 01:43:44 -0700 (PDT) Date: Fri, 29 Mar 2019 09:43:43 +0100 From: Jiri Pirko To: Michal Kubecek Cc: David Miller , netdev@vger.kernel.org, Jakub Kicinski , Andrew Lunn , Florian Fainelli , 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: <20190329084343.GU14297@nanopsycho> References: <20190327201237.GG14297@nanopsycho> <20190327225607.GW26076@unicorn.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190327225607.GW26076@unicorn.suse.cz> 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 Wed, Mar 27, 2019 at 11:56:08PM CET, mkubecek@suse.cz wrote: >On Wed, Mar 27, 2019 at 09:12:37PM +0100, Jiri Pirko wrote: >> Mon, Mar 25, 2019 at 06:08:30PM CET, mkubecek@suse.cz wrote: >> >Requests a contents of one or more string sets, i.e. indexed arrays of >> >strings; this information is provided by ETHTOOL_GSSET_INFO and >> >ETHTOOL_GSTRINGS commands of ioctl interface. There are three types of >> >requests: >> > >> > - no NLM_F_DUMP, no device: get "global" stringsets >> > - no NLM_F_DUMP, with device: get string sets related to the device >> > - NLM_F_DUMP, no device: get device related string sets for all devices >> > >> >It's possible to request all string sets of given type or only specific >> >sets. With ETHA_STRSET_COUNTS flag, only set sizes (number of strings) are >> >returned. >> > >> >Signed-off-by: Michal Kubecek >> >--- >> > Documentation/networking/ethtool-netlink.txt | 46 +- >> > include/uapi/linux/ethtool.h | 2 + >> > include/uapi/linux/ethtool_netlink.h | 43 ++ >> > net/ethtool/Makefile | 2 +- >> > net/ethtool/netlink.c | 8 + >> > net/ethtool/netlink.h | 4 + >> > net/ethtool/strset.c | 447 +++++++++++++++++++ >> > 7 files changed, 549 insertions(+), 3 deletions(-) >> > create mode 100644 net/ethtool/strset.c >> >> First of all, the code is hard to follow. For reasons I mentioned in >> other replies (lack of prefixes, wrappers, etc). >> >> More importantly, why do we need this? This concept of having strings in >> kernel for various things and features and sending them to userspace is >> weird. Certainly not common for Netlink interface. I believe these >> strings should be avoided and all should be communicated to userspace >> and back in form of well-defined Netlink attributes. We are introducing >> new Netlink API, lets do it properly and don't bring baggage from past. > >For some of the global string sets where the values have fixed meaning >and new values are only appended to, it would be possible. But even for >those, keeping the list in sync between kernel and ethtool is often less >than perfect. And ethtool is only one of the tools using the interface. >So even in this case, I don't see string identifiers (or tags or names >or whatever we call them) as a baggage from past, rather as a solution >to a problem some of the existing interfaces have. > >Then e.g. netdev features are not fixed in this sense: the same bit >index represents different feature in different kernels. I guess we Should not be exposed in bits in first place. See devlink params for example. >could introduce some fixed numeric identifiers for them and map between >those and actual indices but I don't see an advantage of such approach. > >But the really important question is how would you handle what is >currently described by "per device" string sets, i.e. private flags, >(ethtool) statistics, tests, ...? For these, the list depends on the >driver or even device. Yes, those per-driver things have to be strings. That's what we did for devlink params. Tests also could be handled in similar way as devlink params. For stats, I believe that uint->string per-driver mapping needs to be exposed.