From nobody Thu Jan 19 03:52:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ny7xD3sWRz2sv67; Thu, 19 Jan 2023 03:52:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ny7xD2SMXz3hvg; Thu, 19 Jan 2023 03:52:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4rmRH9QaB4M7o94MDp2okezDiG6hEoqwFdbEy3vDRW4=; b=PHQKe3a2mzvdwuefa03Bsjc+OO9rrY5q6928gDX85brJg6ik8tVDSPTTX6qVYMgtsm7uJ4 IHsHJXnutF8TSo2Fp52Yq+vpgVtgYCtSB9g6kVXLM7nwCeg8dtpVZDfg0xBTdlgGh/mGIs OSiHnOzWaLUQZn9k2V1nfkK/J59IXYvnqNRH/oMUnV8PdhNG6mOPfnbanA5KdUzboqaGe8 /j105/iVmf9wtBev50cl2IFmv8jnAuxY2VJ0wcnZApX7TR3tqkBvJMJ+D9YAKWu+HdJJLM soyFrKUTCaTpZfdxepea4/e1sxP9DOspB7hgIzNY6DzDpFLinbMm24OE5AiF3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674100336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4rmRH9QaB4M7o94MDp2okezDiG6hEoqwFdbEy3vDRW4=; b=hyp5tcyM2N6NZPDFvJdH4frrZjJkxJC9WTM89bGZvj5zjCrm6ew0/gLx1fw/4Jy0pGfYnm m5juyfq65Yr7humc9MYU6jG17G4NM6Iw+EcNoPBU2AhL8YpKUQFAi1Y+hybzO6uJjwyC4i nFF0goRL8hXk4zZSKWcbklLhIjyfhfsyROdzdcP1dWCejbqPn5T6/AtpBMa744Zy5rW97s WjvWXlCrdrXBDLraN5pk4tPJg5m7FN6KI9nDY1o/T3MJHiAE7HO5JM45G8HoL0iYAh0eg6 6VhyWrOPOnBo+LncG3bnT8+HgUtOVeieS4vvzMmDpRN9W5dfMv7rXF/GS/3gag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674100336; a=rsa-sha256; cv=none; b=ayo6bRjEmjGSkC1ZCZSD+/YBNCyAojBiQQ78j/ZEpCkYk32eePGQ6oNVrUhj+JR1NK5FKm MvRMJG0952NhK4XinUq/9bK7BBtqxKjXi6s45GQkfjCvMZdpA85Wof7q2hn0L6EaugXAY5 JIUykUTF/QtFEnZun13rj7WA/f5xd5AFVXJ344ASqBnq48HH/V7DE+mE3n//pwyVD8s4g+ maMQtU2om7qxY7FJl7WaE9H8K3YCHxyIKyAsMXsdVQ1uguorDFlzdW4c6TtM9g5zTKVOeI j4ZrMUDoJgEHjB1Tn4RguiPl3PGdEsvP39iL3QogY9Q/1Wm5pqEJv4Fzbeckaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ny7xD1YbdzcT3; Thu, 19 Jan 2023 03:52:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30J3qGUp022026; Thu, 19 Jan 2023 03:52:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30J3qGu8022025; Thu, 19 Jan 2023 03:52:16 GMT (envelope-from git) Date: Thu, 19 Jan 2023 03:52:16 GMT Message-Id: <202301190352.30J3qGu8022025@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 9142a68da29f - stable/13 - if_bnxt: Display firmware version along with SIT package version List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9142a68da29fdfe28f9b1f3eeee34e661c5eed4f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9142a68da29fdfe28f9b1f3eeee34e661c5eed4f commit 9142a68da29fdfe28f9b1f3eeee34e661c5eed4f Author: Sumit Saxena AuthorDate: 2022-11-04 22:18:38 +0000 Commit: Warner Losh CommitDate: 2023-01-19 01:00:06 +0000 if_bnxt: Display firmware version along with SIT package version Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D36441 (cherry picked from commit 6033382aab2e6108e6faa273fd945274e161cd5b) --- sys/dev/bnxt/bnxt.h | 3 +++ sys/dev/bnxt/bnxt_hwrm.c | 28 ++++++++++++++++++++++++++++ sys/dev/bnxt/bnxt_sysctl.c | 3 +++ 3 files changed, 34 insertions(+) diff --git a/sys/dev/bnxt/bnxt.h b/sys/dev/bnxt/bnxt.h index 753d1aac92de..9638ad78fb6d 100644 --- a/sys/dev/bnxt/bnxt.h +++ b/sys/dev/bnxt/bnxt.h @@ -471,6 +471,8 @@ struct bnxt_full_tpa_start { /* All the version information for the part */ #define BNXT_VERSTR_SIZE (3*3+2+1) /* ie: "255.255.255\0" */ #define BNXT_NAME_SIZE 17 +#define FW_VER_STR_LEN 32 +#define BC_HWRM_STR_LEN 21 struct bnxt_ver_info { uint8_t hwrm_if_major; uint8_t hwrm_if_minor; @@ -481,6 +483,7 @@ struct bnxt_ver_info { char mgmt_fw_ver[BNXT_VERSTR_SIZE]; char netctrl_fw_ver[BNXT_VERSTR_SIZE]; char roce_fw_ver[BNXT_VERSTR_SIZE]; + char fw_ver_str[FW_VER_STR_LEN]; char phy_ver[BNXT_VERSTR_SIZE]; char pkg_ver[64]; diff --git a/sys/dev/bnxt/bnxt_hwrm.c b/sys/dev/bnxt/bnxt_hwrm.c index eb1c60ac35d6..91e6865449ac 100644 --- a/sys/dev/bnxt/bnxt_hwrm.c +++ b/sys/dev/bnxt/bnxt_hwrm.c @@ -546,6 +546,7 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc) const char nastr[] = ""; const char naver[] = ""; uint32_t dev_caps_cfg; + uint16_t fw_maj, fw_min, fw_bld, fw_rsv, len; softc->hwrm_max_req_len = HWRM_MAX_REQ_LEN; softc->hwrm_cmd_timeo = 1000; @@ -620,6 +621,32 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc) strlcpy(softc->ver_info->roce_fw_name, resp->roce_fw_name, BNXT_NAME_SIZE); } + + fw_maj = le32toh(resp->hwrm_fw_major); + if (softc->hwrm_spec_code > 0x10803 && fw_maj) { + fw_min = le16toh(resp->hwrm_fw_minor); + fw_bld = le16toh(resp->hwrm_fw_build); + fw_rsv = le16toh(resp->hwrm_fw_patch); + len = FW_VER_STR_LEN; + } else { + fw_maj = resp->hwrm_fw_maj_8b; + fw_min = resp->hwrm_fw_min_8b; + fw_bld = resp->hwrm_fw_bld_8b; + fw_rsv = resp->hwrm_fw_rsvd_8b; + len = BC_HWRM_STR_LEN; + } + + snprintf (softc->ver_info->fw_ver_str, len, "%d.%d.%d.%d", + fw_maj, fw_min, fw_bld, fw_rsv); + + if (strlen(resp->active_pkg_name)) { + int fw_ver_len = strlen (softc->ver_info->fw_ver_str); + + snprintf(softc->ver_info->fw_ver_str + fw_ver_len, + FW_VER_STR_LEN - fw_ver_len - 1, "/pkg %s", + resp->active_pkg_name); + } + softc->ver_info->chip_num = le16toh(resp->chip_num); softc->ver_info->chip_rev = resp->chip_rev; softc->ver_info->chip_metal = resp->chip_metal; @@ -1470,6 +1497,7 @@ bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, /* TBD */ if (BNXT_CHIP_P5(softc)) return 0; + bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_RSS_CFG); req.hash_type = htole32(hash_type); diff --git a/sys/dev/bnxt/bnxt_sysctl.c b/sys/dev/bnxt/bnxt_sysctl.c index e8b3edc27e4d..36afed71a726 100644 --- a/sys/dev/bnxt/bnxt_sysctl.c +++ b/sys/dev/bnxt/bnxt_sysctl.c @@ -834,6 +834,9 @@ bnxt_create_ver_sysctls(struct bnxt_softc *softc) SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "roce_fw", CTLFLAG_RD, vi->roce_fw_ver, 0, "RoCE firmware version"); + SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "fw_ver", CTLFLAG_RD, vi->fw_ver_str, 0, + "Firmware version"); SYSCTL_ADD_STRING(&vi->ver_ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "phy", CTLFLAG_RD, vi->phy_ver, 0, "PHY version");