From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46EB1C43381 for ; Wed, 27 Mar 2019 20:12:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1402F2087C for ; Wed, 27 Mar 2019 20:12:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20150623.gappssmtp.com header.i=@resnulli-us.20150623.gappssmtp.com header.b="BXavTnUf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729816AbfC0UMk (ORCPT ); Wed, 27 Mar 2019 16:12:40 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38740 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727451AbfC0UMk (ORCPT ); Wed, 27 Mar 2019 16:12:40 -0400 Received: by mail-wr1-f66.google.com with SMTP id k11so12707346wro.5 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=ca7Bv7mBhcR6oVXpP3c7x2V9XPKki+zal2EAE8DPA80ifJ8QsTl5Ipc2hq5JIfJzKM lqtBkP6+FmFpS5YJJd2Nl8IAUrM+Y1nSJ5/r6y3mZvO8xUgSFGRBBPaM+7daGkaHAwb6 2Oc0XUpMCLKKp30Y1v7ZsZxYGaGu8hm/rR8MLvvgRIeoeNTh8lP8aFK3AyZq63O+ipIL axcGk123CSm4EXKegBlzrXZgZ2Gen1srlBKtrPhW9+6flfzVaUBpgoX11lYXnfe2HBYe lUjfJxlu8MXY00ZCPurw5BoH7qbZc/WCHoQjrtuKPe66Q9sLV0M87kYnj+RxOh920VX2 CLmQ== X-Gm-Message-State: APjAAAVDlGk+IitsZvHIuLO2/2xbLdo3vQBbBkxah0WWGJtwEqcuGR+l 8+9aUmdOB6mrqypl5eczqGZqGQ== X-Google-Smtp-Source: APXvYqxlmrn4vCOCM63n0bYHkqdHPNQb6gpsY1ifkSBPQaaoJEJyOXcMw8pyvr3T9qt0hsicoCm+Xw== 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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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.