From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: [RFC net-next 0/6] devlink: add device (driver) information API Date: Mon, 14 Jan 2019 17:00:07 -0800 Message-ID: <040f3d7e-f315-05c1-00a7-f47c4c19eacd@gmail.com> References: <20190115005009.16025-1-jakub.kicinski@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, oss-drivers@netronome.com, jiri@resnulli.us To: Jakub Kicinski , davem@davemloft.net Return-path: Received: from mail-yw1-f68.google.com ([209.85.161.68]:33903 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727389AbfAOBAR (ORCPT ); Mon, 14 Jan 2019 20:00:17 -0500 Received: by mail-yw1-f68.google.com with SMTP id g75so436021ywb.1 for ; Mon, 14 Jan 2019 17:00:16 -0800 (PST) In-Reply-To: <20190115005009.16025-1-jakub.kicinski@netronome.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 1/14/19 4:50 PM, Jakub Kicinski wrote: > Hi! > > For quite some time now the ethtool -i API has been showing its age. > The driver version field is generally considered obsolete these > days, and driver authors are encouraged to report the kernel version. > fw_version field does not suit modern needs with 31 characters being > quite limiting on more complex systems. There is also no distinction > between the running and flashed versions of the firmware. > > Since the driver information pertains to the entire device, rather > than a particular netdev, it seems wise to move it do devlink, at > the same time fixing the aforementioned issues. > > The new API allows exposing the device serial number and versions > of the components of the card - both hardware, firmware (running > and flashed). Driver authors can choose descriptive identifiers > for the version fields. There is a potential for defining common > fields here, but given the general direction of the stack I don't > think people would like that. I does not seem realistic to expect people to agree on that indeed :) Took a quick look and this is pretty sensible thanks Jakub! > > Example: > $ devlink info show > pci/0000:05:00.0: > serial_number: 00:15:4d:12:20:7e > versions: > fixed: > board.model carbon > board.partno AMDA0099-0001 > board.revision 07 > board.vendor SMA > running: > fw.mgmt: 010156.010156.010156 > fw.cpld: 0x44 > fw.app: sriov-2.1.16 > stored: > fw.mgmt: 010158.010158.010158 > fw.cpld: 0x44 > fw.app: sriov-2.1.20 > > Jakub Kicinski (6): > devlink: add device information API > devlink: add version reporting API > nfp: devlink: report serial number > nfp: devlink: report fixed versions > nfp: nsp: add support for versions command > nfp: devlink: report the running and flashed versions > > .../net/ethernet/netronome/nfp/nfp_devlink.c | 154 +++++++++++++++ > .../ethernet/netronome/nfp/nfpcore/nfp_nsp.c | 53 ++++++ > .../ethernet/netronome/nfp/nfpcore/nfp_nsp.h | 14 ++ > include/net/devlink.h | 15 ++ > include/uapi/linux/devlink.h | 10 + > net/core/devlink.c | 177 ++++++++++++++++++ > 6 files changed, 423 insertions(+) > -- Florian