Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1877283ybi; Thu, 4 Jul 2019 01:11:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzp8BXso7mClowgxgcIPm7yxz7rD9TMbO4Fx/cg3jF7jLPJqw/5xyV1yae3omlf382NYVYS X-Received: by 2002:a17:902:6b07:: with SMTP id o7mr46606043plk.180.1562227873480; Thu, 04 Jul 2019 01:11:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562227873; cv=none; d=google.com; s=arc-20160816; b=WnaAp6IXZCNSLc2MFFVc+hABRCv7Jwppli5oBXiYGUjrImT/pU5059Ap+Sn9GA1JAE CrJcCGoiZBXNluaULIX8NmVjkGYsCqxL/AZee2Twkd05fPP2luft3QHGHfdAOdBRmCkW LmGQyoIrzm6aVrj9We++jZUizgMl7ZS0T5szBBNcKrd5i5YPYWA3yba4dbgvhNQPO2Pq qk/6HWBWuxcpgBhQ6BZFKIb+Bl1GzdCQL2PIGQMVrec+snBe+sQfSOsiZk9xK+6XvDbP OcilN89pUUTVY2ml9BmtNi0xjiBc4HG4A+IJL8K17Ms3GpLiYIBtWHD/EoROqwO1Er1j 7n3A== 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=ikIOKBV36H/Xx1iuFIPI2qkuopRb0oqwGFKJA2jzmY4=; b=uQzZcwBiii1XtWnllVhQ/2u0Ss6K3N4PdRSlRZCaG1K9p0KBVRSj2133GTYl4sUK9P wHB6RhaONRXxqHA7j58HsjfujQOJHBvL5tJ/V3GXY+77XTx9WshXNy3Yei02v3eMKHNq TWyz609zoJgDHL8ubHr5FViCwbrUMBVZw7Rsxa3ubcHCHBUGE+sjLaXNAaHr8KpxJCZk ztzBI0b8FaGTnNMLpopX4H6y+17C2Ll4i+jwJJYA0ud8BNr+FISEeC089+zMhmKqouiU 7wKThT8v9gfadhw4M7N7KhMsl/lhSOen5MGY6APwxea3nJHc0JHDvQm93HGf+3voOLks H21A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b="I/Limrpi"; 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 q8si5003348pfc.155.2019.07.04.01.10.57; Thu, 04 Jul 2019 01:11:13 -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="I/Limrpi"; 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 S1727032AbfGDIJ6 (ORCPT + 99 others); Thu, 4 Jul 2019 04:09:58 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:36775 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbfGDIJ5 (ORCPT ); Thu, 4 Jul 2019 04:09:57 -0400 Received: by mail-wr1-f65.google.com with SMTP id n4so5583133wrs.3 for ; Thu, 04 Jul 2019 01:09:56 -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=ikIOKBV36H/Xx1iuFIPI2qkuopRb0oqwGFKJA2jzmY4=; b=I/LimrpioiWUl+TQIxDzRUuF3Atd37fYhfeZDCXfS3Ifza1QV3qL8hlvjJ/vGuk8Yz 2UY8Fd26nxylwrUL52R1hDOuoT0hPmJYMLXXLavrZAeWDIyuIFJvxMRrerEhw+ecH9HY 6MX+olxNieSfywey7Cw8GkZ3JOaYzvSXAaT6SLHt6pbdfOIIU7vG86ffZJCUM+L2Jtkr QbJ42HuXTdTckIw4vuToyYxZ0rY6jmRgzM6dVveKzM3OZA42KZ3Zx+aLz9ZAg2L/O816 HODt2JTXwQzDhEQpB7Rkl/r7tN3LUYg/l3R/D/jLTQ98VrZIHEYzqT3bt20m8h/aC+SQ hOig== 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=ikIOKBV36H/Xx1iuFIPI2qkuopRb0oqwGFKJA2jzmY4=; b=THWjLmVOixQ4EBvYZM0QXkYOLlAgpG8q3yFsrQzNyXrAR5tilYMq7rvHfSbfRtUDpP aeyi8K3EbqyC6h1ixdpa/dHK/OhQiI2Vxu6CojclXpRFvR5zg5w8sWASDeYJxWncJY8J tj+3GMqJuB7RHEZ/ktXNTdF0umO0VJskx4tfRADDNEMepo43KFOIwGyd/OCs3E4dTJer WUInCMrTUsHyk/3Fpdhlz10qBRKT12nLjfufKJUFJxhEwoN7kLwjZb3AdlMAOcYKKZo6 zmK2fckRstk4s2Kib1XdovhzioNAK1EktXBlILo5VUf8hIdwxq2RkulOK3qJjN70iFcI vp3g== X-Gm-Message-State: APjAAAU/c3aGAZfYVo4mhIV89sS02m23+3DeR78+gdtqTGf9uCeuj7HS M9ga5huTvvZJT49szCp/Jf+0+g== X-Received: by 2002:a5d:6182:: with SMTP id j2mr21751875wru.275.1562227795632; Thu, 04 Jul 2019 01:09:55 -0700 (PDT) Received: from localhost (ip-213-220-235-213.net.upcbroadband.cz. [213.220.235.213]) by smtp.gmail.com with ESMTPSA id a2sm5896823wmj.9.2019.07.04.01.09.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 04 Jul 2019 01:09:55 -0700 (PDT) Date: Thu, 4 Jul 2019 10:09:54 +0200 From: Jiri Pirko To: Michal Kubecek Cc: netdev@vger.kernel.org, David Miller , Jakub Kicinski , Andrew Lunn , Florian Fainelli , John Linville , Stephen Hemminger , Johannes Berg , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v6 08/15] ethtool: move string arrays into common file Message-ID: <20190704080954.GH2250@nanopsycho> References: <0647ac484dac2c655d0e4260d81e86405688ff5b.1562067622.git.mkubecek@suse.cz> <20190703134452.GZ2250@nanopsycho> <20190703143722.GN20101@unicorn.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190703143722.GN20101@unicorn.suse.cz> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Wed, Jul 03, 2019 at 04:37:22PM CEST, mkubecek@suse.cz wrote: >On Wed, Jul 03, 2019 at 03:44:52PM +0200, Jiri Pirko wrote: >> Tue, Jul 02, 2019 at 01:50:19PM CEST, mkubecek@suse.cz wrote: >> >Introduce file net/ethtool/common.c for code shared by ioctl and netlink >> >ethtool interface. Move name tables of features, RSS hash functions, >> >tunables and PHY tunables into this file. >> > >> >Signed-off-by: Michal Kubecek >> >--- >> > net/ethtool/Makefile | 2 +- >> > net/ethtool/common.c | 84 ++++++++++++++++++++++++++++++++++++++++++++ >> > net/ethtool/common.h | 17 +++++++++ >> > net/ethtool/ioctl.c | 83 ++----------------------------------------- >> > 4 files changed, 104 insertions(+), 82 deletions(-) >> > create mode 100644 net/ethtool/common.c >> > create mode 100644 net/ethtool/common.h >> > >> >diff --git a/net/ethtool/Makefile b/net/ethtool/Makefile >> >index 482fdb9380fa..11782306593b 100644 >> >--- a/net/ethtool/Makefile >> >+++ b/net/ethtool/Makefile >> >@@ -1,6 +1,6 @@ >> > # SPDX-License-Identifier: GPL-2.0 >> > >> >-obj-y += ioctl.o >> >+obj-y += ioctl.o common.o >> > >> > obj-$(CONFIG_ETHTOOL_NETLINK) += ethtool_nl.o >> > >> >diff --git a/net/ethtool/common.c b/net/ethtool/common.c >> >new file mode 100644 >> >index 000000000000..b0ce420e994e >> >--- /dev/null >> >+++ b/net/ethtool/common.c >> >@@ -0,0 +1,84 @@ >> >+// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note >> >+ >> >+#include "common.h" >> >+ >> >+const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = { >> >> const char *netdev_features_strings[NETDEV_FEATURE_COUNT] = { >> ? >> >> Same with the other arrays. > >These are not new tables, this patch only moves existing tables from >ioctl.c (originally net/core/ethtool.c) into common.c so that they can >be used by both ioctl and netlink code. > >This fixed size string array format is used by ETHTOOL_GSTRINGS ioctl >command. So if we switch these into simple const char *table[], we can >get rid of some complexity in strset.c and bitset.c (the "simple" vs. >"legacy" string set mess) but we would have to convert them into the >fixed size string array in ioctl ETHTOOL_GSTRINGS handler. And then we >would also have to convert (or rather "index") string sets retrieved >from NIC driver (e.g. private flags, stats, tests) - which also means an >extra kmalloc() (or rather kmalloc_array()). > >It an option I'm certainly open to if we agree on it but it's not for >free. Got it. I don't think we need to do this now. But it would be certainly nice to fix this later on. > >Michal