Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5689338img; Wed, 27 Mar 2019 13:15:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTggPUGq/Y9jf+22WT++MbaAlwczsfJQ7Ae7by0GBFTtXwFdcYm/kGwHVyuKFd6RxCaTot X-Received: by 2002:a17:902:864a:: with SMTP id y10mr39196315plt.76.1553717709660; Wed, 27 Mar 2019 13:15:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553717709; cv=none; d=google.com; s=arc-20160816; b=HizyiVSEEdcaBXM4WoS8OkJ7vzEKCRUUK7pLV/pwdt7cWJ3UJvcvdQiCMpF3K6AAZo /EwW8qsW3aGrwJSei2s//Kzwz32tnjlOZhYddlUZXrZa1n2wbbHFuJQN/O2cfOVojbGH xRRP9EGXjMDjrE3LeVadoo45z0XSDUayXhAi9sKRcsSnaKNV7caeunUwe9TH37OBAZXn bDvmUMsCIhJV0sGHpCQKEPzZhW5ZFJUXYuU+0FDg+TadKMmVPER5IfOCW+EYvV14Dm4E sF39DibsoSEaJc9i7SlodDJgLQx5f4v9mO1bvkDKrOtGqZZXK4VsyOVhuSoxBtOiBGz0 gJMg== 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=5Qtj+TKhffEuPFEN+GNxBncgzLuwne/LRQjWAl4/NcE=; b=Ou4pI0AGd7LHbGEZki5Ye3ZzbhaoJlZfSFV3sRci2iXaZSWPR4EMfbaV23c+EVlBNO LRDVxJwNd+43+zMnslt2drbNj3PluiD9VxSlDMu7ygloREISgciNGvv8Efb3OkfBuEzN u2Md6wvvUccYxqkqYRb8jhpa4DmkdHsUskDRn93DTrN6uDVY6NRcEunAhj7yAh1uoHlE hU8go2JAErVQimsylURzrxjs/uW6doAGWMvgO06BNMgln0Q5BR43hQAG1/yhvfsW6tXY i1S1FI7Vk3miXQpUgD6wpBhp8AKvtL/4wmcAggFXmHBwKpueuvRyZjP4zpOJ36WIyvVC NMfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=BXavTnUf; 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 s3si21436161plb.230.2019.03.27.13.14.52; Wed, 27 Mar 2019 13:15:09 -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=BXavTnUf; 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 S1729878AbfC0UMl (ORCPT + 99 others); Wed, 27 Mar 2019 16:12:41 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37832 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727568AbfC0UMk (ORCPT ); Wed, 27 Mar 2019 16:12:40 -0400 Received: by mail-wr1-f66.google.com with SMTP id w10so20111208wrm.4 for ; Wed, 27 Mar 2019 13:12:39 -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=5Qtj+TKhffEuPFEN+GNxBncgzLuwne/LRQjWAl4/NcE=; b=BXavTnUfrLsRhCj68BI69GAV/RiMP1sLllN7T8knRuW5yWay6Y64iDg9IiI9PrjN3+ mdHfuPnWT1OtOXdazjv1pxZuMtO/yhP/jd7YvduPbtVbC6H5/y0hSqvx7Pd/evbvQ67w E3C1+vO6qdIBEIgXPE6X9EsZBcQp9WYG68AbLOjiWHvM//qoOCG4svdhdDiVEPFCKRsC wSnAVK36TsCNjJhmawK8DHrdBFGE03VTQXit1OTxqiCVYD/xALfyYEtO7XMlTwR/OIjM Zw9pA1mnyXUz4H2odiiPZWUBUFZIDS1mo2y/jf2hoeatmQakizch7W234CVrmNY000D5 +5sw== 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=5Qtj+TKhffEuPFEN+GNxBncgzLuwne/LRQjWAl4/NcE=; b=VXZCQb43aiCQkAVopdaJgikvKIDgQ6SD/CGE35z4l6BCDy6RQJkkJPQPDPKiLMS3NI ZhX4gH0vZuSIb9CeX+tG0vdSEYgtNNk0XBPJkvCHS85jPLd2cGd+HL5TapOqybx/pLdn +ZeUbX5wp5cpqC78nExy+cFZR6iqHYGcJDVhIqdS76dtNvce6GXTJ4jv8lO7bTeVlJ4r r45t+KsfwGLGE8KHCm0WRr6kBF8mio2l/kfKP4V8JY6PZgcrtUBTgNIX6bwqT0xsTPbN 7NSjHhtKNsK8iejlkrL49bWi4feR8dbY16NlToQZ3yq63eE1mkZmV9FORGYIobZDrHiX TeeA== X-Gm-Message-State: APjAAAXKn9oNBwLM/FMJX6Y8vWL7Xs67mSfruocA/8KixZ7nbbctUA7c Lg98WHbE6+cP4iyj8mKXW+Ow2w== X-Received: by 2002:a5d:4751:: with SMTP id o17mr15836211wrs.121.1553717558870; Wed, 27 Mar 2019 13:12:38 -0700 (PDT) Received: from localhost (ip-94-113-223-73.net.upcbroadband.cz. [94.113.223.73]) by smtp.gmail.com with ESMTPSA id z8sm23147795wrh.80.2019.03.27.13.12.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 13:12:38 -0700 (PDT) Date: Wed, 27 Mar 2019 21:12:37 +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: <20190327201237.GG14297@nanopsycho> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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.