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=-3.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_GIT 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 5C444C282D7 for ; Wed, 30 Jan 2019 23:42:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0E75B20882 for ; Wed, 30 Jan 2019 23:42:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="UMkR4uAH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728755AbfA3XmA (ORCPT ); Wed, 30 Jan 2019 18:42:00 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:33726 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbfA3XmA (ORCPT ); Wed, 30 Jan 2019 18:42:00 -0500 Received: by mail-qt1-f194.google.com with SMTP id l11so1661110qtp.0 for ; Wed, 30 Jan 2019 15:41:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aL9OuntAJhnvyFoR0f+wlpKUq1br/h6nht2SJPKfDLE=; b=UMkR4uAHjugB8d/fFk8RPEeOWYcjDo0aMiA5qYJ/O9DsY3RNURq+NAUrhIuIWif9H7 vzM2me5/JNtYoym2znXGxBbBOKWTzPTVGUlzCoPpYHsnxBsa1eKhRlM0vAdaeVN6tRlL 85zV0rqeJcwg3C32BfWjjCG0mMWfEpahD+2TVgXlWXjdBEOl3FTntzgUXcygb/eRS1GC 56/aVE2IxL5qPECemHlVPOwS+Gl0Nzklr5KN3v2vihAyy6laP1xgBk9/790VZZjQYHJ6 JRhoktxrlGT1IvL8r+VOrZYGa67bEHwpsPtKxZhtCdN8yT1EHV9i/jFHf9OdBWrOS/EI dh6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aL9OuntAJhnvyFoR0f+wlpKUq1br/h6nht2SJPKfDLE=; b=uJpeYN7cDTO9ASplDc4YsF6Re9fPFK0++2HuqowBdRmZ1rhCJxkPf+v11r/VfzXdSn Umw8tqb6SeGH+XjqgAKBvCThXYDVeDsgeYQTC01/+WC1530TU8tqZUNP4xKPl2Fd8Mqc 9CKkawNsN+djpaqk6epdaYhYMnLiIBloU8dXFNF8KGV3DK9Tih5sE+48j3Q/LhTmYVR8 tsMaxrNd19eDelxl0lqcYjjoBeNj/1/LZdVqunK/N3dKWZNQ/dyqd11khNqR3hZOH46P bpatyNlOjkpt7OcpcfRk3xDSZOr2r803J7GjWoTjiF/7tFaKnNP1j1m8fgqoDWp7Bbfx q/5w== X-Gm-Message-State: AJcUukcacF62OyHmtmAjndF37Ox59l6jD3RS7zTS2Dcetek4G9EYZk9K TOWj5+NGVJ8LUo0gB6POnxhk3w== X-Google-Smtp-Source: ALg8bN429C4RNOgPpkJ9dMynY1nU54ZZ9Uq0pEhN0GXtO3NRuPcphuxpN4LsDFvgbedgbHOxR//5cQ== X-Received: by 2002:ac8:2a81:: with SMTP id b1mr32372841qta.110.1548891719345; Wed, 30 Jan 2019 15:41:59 -0800 (PST) Received: from jkicinski-Precision-T1700.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id q21sm4009163qtk.79.2019.01.30.15.41.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Jan 2019 15:41:58 -0800 (PST) From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, oss-drivers@netronome.com, jiri@resnulli.us, andrew@lunn.ch, f.fainelli@gmail.com, mkubecek@suse.cz, eugenem@fb.com, jonathan.lemon@gmail.com, Jakub Kicinski Subject: [PATCH net-next v3 0/8] devlink: add device (driver) information API Date: Wed, 30 Jan 2019 15:41:25 -0800 Message-Id: <20190130234133.4298-1-jakub.kicinski@netronome.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi! fw_version field in ethtool -i 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. A few version identifiers which seemed relevant for most devices have been added to the global devlink header. Example: $ devlink dev info pci/0000:05:00.0 pci/0000:05:00.0: driver nfp serial_number 16240145 versions: fixed: board.id AMDA0099-0001 board.rev 07 board.vendor SMA board.model carbon 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 Last patch also includes a compat code for ethtool. If driver reports no fw_version via the traditional ethtool API, ethtool can call into devlink and try to cram as many versions as possible into the 31 characters. v3 (Jiri): - rename various functions and attributes; - break out the version helpers per-type; - make the compat code parse a dump instead of special casing in each helper; - move generic version defines to a separate patch. v2: - rebase. this non-RFC, v3 some would say: - add three more versions in the NFP patches; - add last patch (ethool compat) - Andrew & Michal. RFCv2: - use one driver op; - allow longer serial number; - wrap the skb into an opaque request struct; - add some common identifier into the devlink header. Jakub Kicinski (8): devlink: add device information API devlink: add version reporting to devlink info API devlink: add generic info version names nfp: devlink: report driver name and serial number nfp: devlink: report fixed versions nfp: nsp: add support for versions command nfp: devlink: report the running and flashed versions ethtool: add compat for devlink info .../networking/devlink-info-versions.rst | 38 +++ Documentation/networking/index.rst | 1 + .../net/ethernet/netronome/nfp/nfp_devlink.c | 145 +++++++++++ .../ethernet/netronome/nfp/nfpcore/nfp_nsp.c | 61 +++++ .../ethernet/netronome/nfp/nfpcore/nfp_nsp.h | 20 ++ include/net/devlink.h | 72 ++++++ include/uapi/linux/devlink.h | 10 + net/core/devlink.c | 232 ++++++++++++++++++ net/core/ethtool.c | 7 + 9 files changed, 586 insertions(+) create mode 100644 Documentation/networking/devlink-info-versions.rst -- 2.19.2