Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5689339img; Wed, 27 Mar 2019 13:15:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKaY80U7wSqrkOERLcNf/CefvxG1p3vLr94hXLcprNVQ1ExwkU8TjCiTQyX7llMXJi2i1E X-Received: by 2002:a63:e050:: with SMTP id n16mr35861649pgj.210.1553717709664; 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=StArOW+sSHUIR+S5CwQdgATe5q1WsDDU2sweevfH+Pb7bdaCb4S3WFWZss4RbFwCUx PiosQSQzINXGWobdFmzuNpkYQKwwlXfZY7tH2Q0yn1x6X/gV9EYHgNB83l5Po0osXCzt BAapWnXyPbCFKmXBoDlRW1gwegYGnJxLXHDxmu9oCuqX/zfdgEdJPfmLWK6CnXoyViRO 1KXdtkFAOaKfHURpV5oKQFlGRHZjHnumuO4CQo90JJvbNIPPgE/55808OlaDQadOAtps brc8hcwuyxV0bJFmyPThSWk+/wgS2zluCZW4JUJJmqGMDMKckap4bxIF3FHOiUbrUXua U6qg== 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=FNBgucpkMNgGRsfVdEySULJb6WHUk4KUPjmP57c/Q+4=; b=H6JN0vXtW+LTcgXnoX6qh5woy/eY4o7FTVbG+7oOeTC/FBZSeF8zlHEuKSHq7ZBdEz dPys3nJouGxe4nNpAzpICiJ49y/HYI5jKjah3WVtHRnMxOOfzCP0utEKBKaF8LvNAl2C MyXy+EE3tymon//jl68h/gVpHlDyEPmo2LnUlBGKZ5KvGBzcZhPUprpWvSFovQomFIrv gZEXfCD+Tqzdd5kr80r969mKuLgPuDWipfFoQ6Zdf0dhWq1Yse63eUpZ09hf7RrLg2ZW 3zvRLp7kq4iWX/6Im91xnx9cK6EnLC6YPLHV6XA4tFVpfZPKufN76gPooHhI4t37Ly7O YKwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20150623.gappssmtp.com header.s=20150623 header.b=PPWumTec; 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 a64si19828988pfb.56.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=PPWumTec; 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 S1729062AbfC0UOQ (ORCPT + 99 others); Wed, 27 Mar 2019 16:14:16 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:35710 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727089AbfC0UOP (ORCPT ); Wed, 27 Mar 2019 16:14:15 -0400 Received: by mail-wr1-f68.google.com with SMTP id w1so20153935wrp.2 for ; Wed, 27 Mar 2019 13:14:13 -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=FNBgucpkMNgGRsfVdEySULJb6WHUk4KUPjmP57c/Q+4=; b=PPWumTecNYnJXxhqHS2pVc/QT7vIoLPGfTPz3MNLqybZJUsU34kNknXHN2zyNXkjYW h+XIZr+uSinJwH6e30JapBnGwjq1QRaU4CRum/gUX452K3lo1R6/fBSRoYCXgp60Pyq3 rdY2Qa6kp3IxfvjrCOGh3/DRrIFqnd60/R0G7liPSCdIZIDiR3a5rsXujrZ01AuYT92Y tB2bZCY5T5tr0xlr7t8GKW7yc+NpwQzwDNpHDLhaGGcZtlZjqDwwJ45yul/xMJI8/5o/ QrCr1nNW7lq4EnGrb4CK4ytpSsxG0mJxz9Jwsuhlph1hX7pFvP7DcMVzU0V5QMTkUegB rw4w== 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=FNBgucpkMNgGRsfVdEySULJb6WHUk4KUPjmP57c/Q+4=; b=cAPTe2vlj5xaXXEzhdw7eXxbqm5KBgYMkGIl6ppqdcarNrulD096bR5502giB41xpN peB+aoFSzFu2NQju3STZUrE2iWzyxdeCGB7+gVak8PgcmI06ImzV7Sg9qUyvNX9OrUoG zGJbXGLNNxBnjuaa6nIzpuCesXBGvNBwcqRm8FClSFqzHGuSwvHGQjBAW1imEqVZHd8c gGUUuu4F1f+KEpWQ5YKH2Hdkpf5pMOe2IPjoF9TMZRrodNu9IoHBEl16Em4qlPEN+SjJ dYa20uwR25ubbhhZNery5BsM4BtyYhtFZFT/IYixKSimf0VGrcMZZK482VlYoB0YJH5k 5k3w== X-Gm-Message-State: APjAAAUgwhMW92w/jxwDDwKFrTHbymS71+aofOTI+rkj3Bftl/e51B7M 7BQSKEOPYaSF2sdBTDcRBf9MDg== X-Received: by 2002:adf:dd4a:: with SMTP id u10mr26067814wrm.322.1553717653074; Wed, 27 Mar 2019 13:14:13 -0700 (PDT) Received: from localhost (ip-94-113-223-73.net.upcbroadband.cz. [94.113.223.73]) by smtp.gmail.com with ESMTPSA id 66sm6336011wmd.3.2019.03.27.13.14.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 13:14:12 -0700 (PDT) Date: Wed, 27 Mar 2019 21:14:11 +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 13/22] ethtool: provide driver/device information in GET_INFO request Message-ID: <20190327201411.GH14297@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:33PM CET, mkubecek@suse.cz wrote: >Implement GET_INFO request to get basic driver and device information as >provided by ETHTOOL_GDRVINFO ioct command. The information is read only so >that the corresponding SET_INFO message is only used in kernel replies. > >Move most of ethtool_get_drvinfo() int common.c so that the code can be >shared by both ioctl and netlink interface. > >Signed-off-by: Michal Kubecek >--- > Documentation/networking/ethtool-netlink.txt | 43 ++++- > include/uapi/linux/ethtool_netlink.h | 30 ++++ > net/ethtool/Makefile | 2 +- > net/ethtool/common.c | 52 ++++++ > net/ethtool/common.h | 2 + > net/ethtool/info.c | 158 +++++++++++++++++++ > net/ethtool/ioctl.c | 50 +----- > net/ethtool/netlink.c | 8 + > net/ethtool/netlink.h | 1 + > 9 files changed, 299 insertions(+), 47 deletions(-) > create mode 100644 net/ethtool/info.c > >diff --git a/Documentation/networking/ethtool-netlink.txt b/Documentation/networking/ethtool-netlink.txt >index 1508c16a236e..cffa508ca6c6 100644 >--- a/Documentation/networking/ethtool-netlink.txt >+++ b/Documentation/networking/ethtool-netlink.txt >@@ -129,6 +129,8 @@ List of message types > ETHNL_CMD_EVENT notification only > ETHNL_CMD_GET_STRSET > ETHNL_CMD_SET_STRSET response only >+ ETHNL_CMD_GET_INFO >+ ETHNL_CMD_SET_INFO response only > > All constants use ETHNL_CMD_ prefix, usually followed by "GET", "SET" or "ACT" > to indicate the type. >@@ -209,6 +211,45 @@ ETHA_STRSET_COUNTS tells kernel to only return string counts of the sets, not > the actual strings. > > >+GET_INFO >+-------- >+ >+GET_INFO requests information provided by ioctl commands ETHTOOL_GDRVINFO, >+ETHTOOL_GPERMADDR and ETHTOOL_GET_TS_INFO to provide basic device information. >+Common pattern is that all information is read only so that SET_INFO message >+exists but is only used by kernel for replies to GET_INFO requests. There is >+also no corresponding notification. >+ >+Request contents: >+ >+ ETHA_INFO_DEV (nested) device identification >+ ETHA_INFO_INFOMASK (u32) info mask >+ ETHA_INFO_COMPACT (flag) request compact bitsets >+ >+Info mask bits meaning: >+ >+ ETH_INFO_IM_DRVINFO driver info (GDRVINFO) >+ ETH_INFO_IM_PERMADDR permanent HW address (GPERMADDR) >+ ETH_INFO_IM_TSINFO timestamping info (GET_TS_INFO) >+ >+Kernel response contents: >+ >+ ETHA_INFO_DEV (nested) device identification >+ ETHA_INFO_DRVINFO (nested) driver information >+ ETHA_DRVINFO_DRIVER (string) driver name >+ ETHA_DRVINFO_FWVERSION (string) firmware version >+ ETHA_DRVINFO_BUSINFO (string) device bus address >+ ETHA_DRVINFO_EROM_VER (string) expansion ROM version These are already very nicely supported in devlink. No need to duplicate here.