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=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham 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 2C171C169C4 for ; Thu, 31 Jan 2019 08:06:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 07F932087F for ; Thu, 31 Jan 2019 08:06:42 +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="a+yKHebI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726368AbfAaIGk (ORCPT ); Thu, 31 Jan 2019 03:06:40 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:50808 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725829AbfAaIGk (ORCPT ); Thu, 31 Jan 2019 03:06:40 -0500 Received: by mail-wm1-f65.google.com with SMTP id n190so1446631wmd.0 for ; Thu, 31 Jan 2019 00:06:38 -0800 (PST) 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=Z5r+47IUkg0DI/UP+elnHZyDtWPhmfpNiDQIbNbCDII=; b=a+yKHebIcn6o0cEaTzPfCZeu74X4LF5v+K1U99kcLwLcGLwP//OozCaZF7xad9ct6v ardnC3uyy/NcNm3h9Q+eHMBTXuCSGRbLbtHgdql7poOvLxRw5wsHgs7YyGHFB9ym1lzW BcLJmjBbg723bZpENDBr+s5LMkJ5pn1aJXXC195xW2UCDTqjnKvGCnwUYG4cq5WmChvF TJCrExyn6qfey+Z5G9G1apDW8iiZj9mk0qCFFazVWlgeKUfXmvLZ7Zc/ZKHN+O3KmoQv 2Z8+Jw8x9jnS8Cg2HX0GfSfSju3Keq7My9miN165IoYkhkioerG5KGpaYxieHPdAZ2he 4F1w== 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=Z5r+47IUkg0DI/UP+elnHZyDtWPhmfpNiDQIbNbCDII=; b=auM4TvFvkTPrDJLSlpLK6DrfLlahfdwYmjmghZfLWFpkE0PdPC5/QGA9q2twxBgs1s BjGLvlsk6u41tEay6qE5lGGKoIhQMFVbdg0M44I8VNRfmdc8Ykk72F7FMF3VUkrGghIU bch+kpCUVsJDKawreF4ruWvs1gjSsQ7K7yRKZcTVS/2NJP21Xz4kjO7sOKnmYkwX+/EL CQlAPH5o39aa950OyVuVtT6TrSwBd3FWDxIfEfdLxAWqArcRfc0wHfB60kiyE/G2668H nm/n9EuFTev/LCBspd7kcNiqzcsxNzS4mcZYDtNJbU/MKYjYenW+fY5mYthN46n8ZeoU SMpQ== X-Gm-Message-State: AJcUukctPT6SNVMlHQLAaO7sFNsMe+CJ7tw+9bY3llyiUyhPr2TW3VjJ aSs2my8dcBt8CasWzmR3RswZXQ== X-Google-Smtp-Source: ALg8bN5QlvEJ1nmLtHDBQBKdPKV7PonpJa4Y3LOOhWS/k8kiHoVmGJwHh428NGg6L6czN8StajT2Kw== X-Received: by 2002:a1c:c181:: with SMTP id r123mr28402765wmf.8.1548921998226; Thu, 31 Jan 2019 00:06:38 -0800 (PST) Received: from localhost (jirka.pirko.cz. [84.16.102.26]) by smtp.gmail.com with ESMTPSA id a132sm11136494wmh.5.2019.01.31.00.06.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Jan 2019 00:06:37 -0800 (PST) Date: Thu, 31 Jan 2019 08:57:37 +0100 From: Jiri Pirko To: Jakub Kicinski Cc: davem@davemloft.net, netdev@vger.kernel.org, oss-drivers@netronome.com, andrew@lunn.ch, f.fainelli@gmail.com, mkubecek@suse.cz, eugenem@fb.com, jonathan.lemon@gmail.com Subject: Re: [PATCH net-next v3 2/8] devlink: add version reporting to devlink info API Message-ID: <20190131075737.GB2523@nanopsycho.orion> References: <20190130234133.4298-1-jakub.kicinski@netronome.com> <20190130234133.4298-3-jakub.kicinski@netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190130234133.4298-3-jakub.kicinski@netronome.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Thu, Jan 31, 2019 at 12:41:27AM CET, jakub.kicinski@netronome.com wrote: >ethtool -i has a few fixed-size fields which can be used to report >firmware version and expansion ROM version. Unfortunately, modern >hardware has more firmware components. There is usually some >datapath microcode, management controller, PXE drivers, and a >CPLD load. Running ethtool -i on modern controllers reveals the >fact that vendors cram multiple values into firmware version field. > >Here are some examples from systems I could lay my hands on quickly: > >tg3: "FFV20.2.17 bc 5720-v1.39" >i40e: "6.01 0x800034a4 1.1747.0" >nfp: "0.0.3.5 0.25 sriov-2.1.16 nic" > >Add a new devlink API to allow retrieving multiple versions, and >provide user-readable name for those versions. > >While at it break down the versions into three categories: > - fixed - this is the board/fixed component version, usually vendors > report information like the board version in the PCI VPD, > but it will benefit from naming and common API as well; > - running - this is the running firmware version; > - stored - this is firmware in the flash, after firmware update > this value will reflect the flashed version, while the > running version may only be updated after reboot. > >v3: > - add per-type helpers instead of using the special argument (Jiri). >RFCv2: > - remove the nesting in attr DEVLINK_ATTR_INFO_VERSIONS (now > versions are mixed with other info attrs)l > - have the driver report versions from the same callback as > other info. > >Signed-off-by: Jakub Kicinski Acked-by: Jiri Pirko