From patchwork Wed Oct 18 12:35:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Vecera X-Patchwork-Id: 154866 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4757341vqb; Wed, 18 Oct 2023 05:37:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2LB/Q4VuerMN3qiFRiZbijDgXwTpADlDDk36690pWDqW9zAHnclD5NTWSXK953GPpViJQ X-Received: by 2002:a92:5213:0:b0:349:4e1f:e9a0 with SMTP id g19-20020a925213000000b003494e1fe9a0mr4873570ilb.2.1697632633560; Wed, 18 Oct 2023 05:37:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697632633; cv=none; d=google.com; s=arc-20160816; b=OTM5fa4XkJ0SAR/N4mR9ib1NarYzcJpVXskWcZ9CulUQGlJhpkhAVVLZwlPWMnThiS eJv2D7LVPngE596Ko1kw9qbzud2WBo3tJUmgYf85Rdq5A8q8hj5DSQBpcHleox5BDopT HkdkWe7bWXeUDbzOpwyY+sBwHetDsqtPZ+K7X08yYuN8fpZRXlkkrR1+gJU/aGkBiOR9 TIsjx0QJmdbIpI6NJux7aTr3wAkCN4h5EumDTZ+gnZ5QdRNBKv/JBjHpzAvMjrotFri5 e7/boHnuw+SRoIfFpnFCwmMRYFFkwiyrp6/QcK/SCWcyDCf2jrF35sA4sGaprSBvXuST AtRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=aPx8egapRZzyiG5lm1UPqh0dzOQ1EzfFBnJkY2r5zdM=; fh=oiOO+RDLaKpu6h3KTQsQ9gtR9g1qTTn56uRn+dB/xoE=; b=yb4U5S/12cS86YL2Zk1Nu1KTsGDodyxrmHlq135414cPa6fclO1HQ+LcLZx8lTLpS7 Xs0DJCto3alhjqRdsHf3oLrf/CpriBh4ggtF/InHayn6v7aweIdYFU73zsJqcW3GDuXo a7h/VZimV8J5nnswhvCf9+pTI+jS8y9hC7EqCekWqqjlSBagJzjx/a2YLjyjcccU9hju OGpcHCIL9POr+lguT5IUVg+qyTXE78bBBMYr0/OhA64zjAOxnbH8e/IgQiOE7aPRoFKq KpA2NGTFXBNN5IOjEM5n6JBFI9+oCGe5JQWMUs26Urw8+TmAmxvieRZmPPvV9ZNK70l8 Tb/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MIqKNmSL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id g4-20020a056a001a0400b006be2ee8929csi4019164pfv.313.2023.10.18.05.37.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 05:37:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MIqKNmSL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B5E1A80D756B; Wed, 18 Oct 2023 05:37:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231831AbjJRMhA (ORCPT + 23 others); Wed, 18 Oct 2023 08:37:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231835AbjJRMgy (ORCPT ); Wed, 18 Oct 2023 08:36:54 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA82C11B for ; Wed, 18 Oct 2023 05:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697632566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=aPx8egapRZzyiG5lm1UPqh0dzOQ1EzfFBnJkY2r5zdM=; b=MIqKNmSLxoO5MLLa+L7P0IMtoJbvWD0DNyv1pQ27wA5Ao7G+OiYrcy0ZVv7erACO1NpFzk Kaumg8Gtg0xBs8UV6dhOQU1zuF4vqvvKJVM4alC5/ngfTVQ8d4EnIFUdspmGJy3oSJrh11 ANzzSDmfgXecYT4Ia1Zfjf/QYxt43os= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-231-29pT3JhJOnSXy1dqd0TGlA-1; Wed, 18 Oct 2023 08:36:02 -0400 X-MC-Unique: 29pT3JhJOnSXy1dqd0TGlA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B0D7B1C05AB2; Wed, 18 Oct 2023 12:36:01 +0000 (UTC) Received: from p1.luc.com (unknown [10.45.226.105]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E48A2166B26; Wed, 18 Oct 2023 12:35:58 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org Cc: Jacob Keller , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Jesse Brandeburg , Tony Nguyen , linux-doc@vger.kernel.org (open list:DOCUMENTATION), linux-kernel@vger.kernel.org (open list), intel-wired-lan@lists.osuosl.org (moderated list:INTEL ETHERNET DRIVERS) Subject: [PATCH net-next] i40e: Align devlink info versions with ice driver and add docs Date: Wed, 18 Oct 2023 14:35:55 +0200 Message-ID: <20231018123558.552453-1-ivecera@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 18 Oct 2023 05:37:10 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780096836361932618 X-GMAIL-MSGID: 1780096836361932618 Align devlink info versions with ice driver so change 'fw.mgmt' version to be 2-digit version [major.minor], add 'fw.mgmt.build' that reports mgmt firmware build number and use '"fw.psid.api' for NVM format version instead of incorrect '"fw.psid'. Additionally add missing i40e devlink documentation. Fixes: 5a423552e0d9 ("i40e: Add handler for devlink .info_get") Cc: Jacob Keller Signed-off-by: Ivan Vecera Reviewed-by: Jacob Keller --- Documentation/networking/devlink/i40e.rst | 59 +++++++++++++++++++ Documentation/networking/devlink/index.rst | 1 + .../net/ethernet/intel/i40e/i40e_devlink.c | 18 +++++- 3 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 Documentation/networking/devlink/i40e.rst diff --git a/Documentation/networking/devlink/i40e.rst b/Documentation/networking/devlink/i40e.rst new file mode 100644 index 000000000000..d3cb5bb5197e --- /dev/null +++ b/Documentation/networking/devlink/i40e.rst @@ -0,0 +1,59 @@ +.. SPDX-License-Identifier: GPL-2.0 + +==================== +i40e devlink support +==================== + +This document describes the devlink features implemented by the ``i40e`` +device driver. + +Info versions +============= + +The ``i40e`` driver reports the following versions + +.. list-table:: devlink info versions implemented + :widths: 5 5 5 90 + + * - Name + - Type + - Example + - Description + * - ``board.id`` + - fixed + - K15190-000 + - The Product Board Assembly (PBA) identifier of the board. + * - ``fw.mgmt`` + - running + - 9.130 + - 2-digit version number of the management firmware that controls the + PHY, link, etc. + * - ``fw.mgmt.api`` + - running + - 1.15 + - 2-digit version number of the API exported over the AdminQ by the + management firmware. Used by the driver to identify what commands + are supported. + * - ``fw.mgmt.build`` + - running + - 73618 + - Build number of the source for the management firmware. + * - ``fw.undi`` + - running + - 1.3429.0 + - Version of the Option ROM containing the UEFI driver. The version is + reported in ``major.minor.patch`` format. The major version is + incremented whenever a major breaking change occurs, or when the + minor version would overflow. The minor version is incremented for + non-breaking changes and reset to 1 when the major version is + incremented. The patch version is normally 0 but is incremented when + a fix is delivered as a patch against an older base Option ROM. + * - ``fw.psid.api`` + - running + - 9.30 + - Version defining the format of the flash contents. + * - ``fw.bundle_id`` + - running + - 0x8000e5f3 + - Unique identifier of the firmware image file that was loaded onto + the device. Also referred to as the EETRACK identifier of the NVM. diff --git a/Documentation/networking/devlink/index.rst b/Documentation/networking/devlink/index.rst index b49749e2b9a6..2b78060aaa58 100644 --- a/Documentation/networking/devlink/index.rst +++ b/Documentation/networking/devlink/index.rst @@ -52,6 +52,7 @@ parameters, info versions, and other features it supports. bnxt etas_es58x hns3 + i40e ionic ice mlx4 diff --git a/drivers/net/ethernet/intel/i40e/i40e_devlink.c b/drivers/net/ethernet/intel/i40e/i40e_devlink.c index 9168ade8da47..74bc111b4849 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_devlink.c +++ b/drivers/net/ethernet/intel/i40e/i40e_devlink.c @@ -18,8 +18,14 @@ static void i40e_info_fw_mgmt(struct i40e_hw *hw, char *buf, size_t len) { struct i40e_adminq_info *aq = &hw->aq; - snprintf(buf, len, "%u.%u.%05d", - aq->fw_maj_ver, aq->fw_min_ver, aq->fw_build); + snprintf(buf, len, "%u.%u", aq->fw_maj_ver, aq->fw_min_ver); +} + +static void i40e_info_fw_mgmt_build(struct i40e_hw *hw, char *buf, size_t len) +{ + struct i40e_adminq_info *aq = &hw->aq; + + snprintf(buf, len, "%05d", aq->fw_build); } static void i40e_info_fw_api(struct i40e_hw *hw, char *buf, size_t len) @@ -77,6 +83,12 @@ static int i40e_devlink_info_get(struct devlink *dl, if (err) return err; + i40e_info_fw_mgmt_build(hw, buf, sizeof(buf)); + err = i40e_devlink_info_put(req, I40E_DL_VERSION_RUNNING, + "fw.mgmt.build", buf); + if (err) + return err; + i40e_info_fw_api(hw, buf, sizeof(buf)); err = i40e_devlink_info_put(req, I40E_DL_VERSION_RUNNING, DEVLINK_INFO_VERSION_GENERIC_FW_MGMT_API, @@ -86,7 +98,7 @@ static int i40e_devlink_info_get(struct devlink *dl, i40e_info_nvm_ver(hw, buf, sizeof(buf)); err = i40e_devlink_info_put(req, I40E_DL_VERSION_RUNNING, - DEVLINK_INFO_VERSION_GENERIC_FW_PSID, buf); + "fw.psid.api", buf); if (err) return err;