Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4026916imm; Mon, 30 Jul 2018 07:29:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdDh97AUYdhnfWKZTJbrdtrKSZy3pHw7Piu3U7uhaOUBnmy6zkpIq0ikUw0RI8HQI0IvbE+ X-Received: by 2002:a62:57dc:: with SMTP id i89-v6mr18118739pfj.65.1532960999678; Mon, 30 Jul 2018 07:29:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532960999; cv=none; d=google.com; s=arc-20160816; b=N/ZRbWOE4LMiV4SbEme/IJi5JRV7+XpLhBCELtpwjM39tyWEVY2QV605Vl4qLLDL1I ohfgwxucDxWMwkpjYzgpfZtyYb+VWhsfp/EIBVyIVMQ1yNSIIpIxUn9q8cm9VjDqD6py 1KW8wj4FJJfdPpVfpPWnc2CXYOi3zvzrHGZrpItGAQaO4KKgdxzgk5F0x45s9FxEei5X SiJM9abW2dNrvlZzYpPkyf1ABdOhJvyH38C34DKB5/Gg/DGwYZkaaNNgvQJ05rAIMRjz X0D50F2h/DpiMv7sC4vGnLFRHgVz5awGJwzCvd/2hCNnHXyqL4kCdmiyoSMOm5KkjIt1 vMWg== 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:arc-authentication-results; bh=fjiPlCaY1t6zV53k/gsqhl6rMTct6uW1CJvISkNHZAU=; b=egy4PET9yM8EiZmR3uG0qNiBM1tmTOEWaQQ0T0vCw2N7UDUpKNzeKPTk0ypMenRzOe 1dEjyBfHx3VdqeCrDO/1v6WZ6Uy1KXWp3Snjy2ov3DUfjJuqIMmbiWzWP1O8nBNMrGJ3 khxpOpGT19yvd2Vv4CMNwX/kE+VtWrotlRAPexNdAHSTApUJJ4Mt44MByo3x1Ijui+SI GN9BT0N86q62DVDhhe6lKUKMrLsP/1uoI/RT30cs3iz3JjX26eS1G8y+nrV3rspBt0er 67VPDYbRPHgYscLLoRUMT08EQdQUaqFd5F0IegEYQVhaKw7HdGBKdDhqDarW+r34DCYW MXyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="wY/MtnDA"; 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 v129-v6si12019613pfc.330.2018.07.30.07.29.45; Mon, 30 Jul 2018 07:29:59 -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=@lunn.ch header.s=20171124 header.b="wY/MtnDA"; 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 S1731914AbeG3QDs (ORCPT + 99 others); Mon, 30 Jul 2018 12:03:48 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:50489 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726843AbeG3QDs (ORCPT ); Mon, 30 Jul 2018 12:03:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=fjiPlCaY1t6zV53k/gsqhl6rMTct6uW1CJvISkNHZAU=; b=wY/MtnDAEiD9YoN26fArm/FT/SX6JZuUEOV1R8VbJbtF9OxRCBkktA6BIItLC461MG9iY+omaWFI+WIi4a+SKN/IqKBV/EUehmov6xhKBJbxh48GZUmaIBspWZMd22i9++i1QfoeXmyuTjzdZrfJeJ555ZgKqQQXgGZzhlOtIzo=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1fk99t-0000Em-SA; Mon, 30 Jul 2018 16:28:25 +0200 Date: Mon, 30 Jul 2018 16:28:25 +0200 From: Andrew Lunn To: Michal Kubecek Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Pirko , David Miller , Florian Fainelli , Roopa Prabhu , Jakub Kicinski , "John W. Linville" Subject: Re: [RFC PATCH net-next v2 09/17] ethtool: implement GET_DRVINFO message Message-ID: <20180730142825.GL13198@lunn.ch> References: <4dcd60f25efe368ada4e0c035dc1d7612ab59132.1532953989.git.mkubecek@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4dcd60f25efe368ada4e0c035dc1d7612ab59132.1532953989.git.mkubecek@suse.cz> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 30, 2018 at 02:53:27PM +0200, Michal Kubecek wrote: > Requests the same information as ETHTOOL_GDRVINFO command in ioct > interface. This is read-only so that corresponding SET_DRVINFO exists but > is only used in kernel replies. > > Signed-off-by: Michal Kubecek > --- > Documentation/networking/ethtool-netlink.txt | 38 +++++- > include/uapi/linux/ethtool_netlink.h | 22 ++++ > net/ethtool/Makefile | 4 +- > net/ethtool/common.c | 43 ++++++ > net/ethtool/common.h | 3 + > net/ethtool/drvinfo.c | 131 +++++++++++++++++++ > net/ethtool/ioctl.c | 42 +----- > net/ethtool/netlink.c | 8 ++ > 8 files changed, 252 insertions(+), 39 deletions(-) > create mode 100644 net/ethtool/drvinfo.c > > diff --git a/Documentation/networking/ethtool-netlink.txt b/Documentation/networking/ethtool-netlink.txt > index 8b43f41a8140..1e3d5ffc97ab 100644 > --- a/Documentation/networking/ethtool-netlink.txt > +++ b/Documentation/networking/ethtool-netlink.txt > @@ -121,6 +121,8 @@ List of message types > ETHNL_CMD_EVENT notification only > ETHNL_CMD_GET_STRSET > ETHNL_CMD_SET_STRSET response only > + ETHNL_CMD_GET_DRVINFO > + ETHNL_CMD_SET_DRVINFO response only > > All constants use ETHNL_CMD_ prefix, usually followed by "GET", "SET" or "ACT" > to indicate the type. > @@ -156,6 +158,40 @@ and also multiple events of the same type (e.g. two or more newly registered > devices). > > > +GET_DRVINFO > +----------- > + > +GET_DRVINFO request corresponds to ETHTOOL_GDRVINFO ioctl command and provides > +basic driver information. > + > +Request contents: > + > + ETHA_DRVINFO_DEV (nested) device identification > + > +Kernel response contents: > + > + ETHA_DRVINFO_DEV (nested) device identification > + ETHA_DRVINFO_DRIVER (string) driver name > + ETHA_DRVINFO_VERSION (string) driver version Driver version is generally useless. Is version X.Y.Z of a driver the same when backported to some ancient enterprise kernel with 1000s of patches? Now seems like a good opportunity to drop it. > + ETHA_DRVINFO_FWVERSION (string) firmware version > + ETHA_DRVINFO_BUSINFO (string) device bus address > + ETHA_DRVINFO_EROM_VER (string) expansion ROM version > + ETHA_DRVINFO_N_PRIV_FLAGS (u32) number of private flags > + ETHA_DRVINFO_N_STATS (u32) number of device stats I know there is at least one driver that has somewhat dynamic number of statistics. It would be better to have the strings and the values in the same message, so there is no need to first get the number of strings, allocate the memory, get the strings, then get the values. > + ETHA_DRVINFO_TESTINFO_LEN (u32) number of test results In theory, this also does not need to be fixed. > + ETHA_DRVINFO_EEDUMP_LEN (u32) EEPROM dump size > + ETHA_DRVINFO_REGDUMP_LEN (u32) register dump size I would suggest removing all these _LEN properties, and let netlink return what it needs to return. Andrew