From nobody Fri Nov 04 22:55:50 2022 X-Original-To: dev-commits-src-main@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 4N3wvp6MZ1z4gywH; Fri, 4 Nov 2022 22:55:50 +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 4N3wvp3HmMz40Zd; Fri, 4 Nov 2022 22:55:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667602550; 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=qqLGpM95WuUMFs/+Ms5VhWoULICjllWqbC/2zdBM7L0=; b=iwR0rXMGfQJAUWEeXgvJ9iZJOUy59PBx4phtH2Ds++nI8AoytQ20ctY1jki2B1hhvFNkuQ HmvIvSVlD51TFg2LjDR6ZJUu56s5jGxat3zNGY7Y/Gk6Xj8ZDwaSm78buwjC0MZIm1y7+W +ILeS+qffOJg1DS/xTfoE+Lei2HWukmCFBB/07N9HYKFUp5KrMIHlUO50wo9klJkDGbcNA l3sy8rPOmmCPojEU66mqBlSVDd7DezoJThEEtFTJBcPmZ2ef9bnUBdJt9XNZvnMkT35JCh YmPbjJ2QgWe5hSbqogLoVfc7QVIbhjc6HnqPr2YvgfjOdIoB3RS8/jAHJ6gX7Q== 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 4N3wvp2MhLzJwM; Fri, 4 Nov 2022 22:55:50 +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 2A4Mto7c032644; Fri, 4 Nov 2022 22:55:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A4MtoVS032643; Fri, 4 Nov 2022 22:55:50 GMT (envelope-from git) Date: Fri, 4 Nov 2022 22:55:50 GMT Message-Id: <202211042255.2A4MtoVS032643@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 6033382aab2e - main - if_bnxt: Display firmware version along with SIT package version List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 6033382aab2e6108e6faa273fd945274e161cd5b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667602550; 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=qqLGpM95WuUMFs/+Ms5VhWoULICjllWqbC/2zdBM7L0=; b=Z0AaCi9+1n6maqfcLfcQ5cg6MiAf22hNJu2+zt/fDUPQbFWKIP6rMw+wX6/AMP3D2Yhm8O abgNWTTISdZtY10bzfzxuSVASmj7SZXgzS37nusdCnLjDhoRRBp1VLBu+htoQD+rdgyEF1 zMUGLJOwXnKvQq7V7WPsdo3tQJa6GpSGBuTiVa86CvyYopbdtADJ5RfBcTgnQ6u6rc9QCI kYZVoP4vXnpshp+Ka1s0XbG7QvshE/mDm2QePIPjS1tWAizJstBCnnBATIVJAMdOLIkowg ibrKRITJ4UjBxa5BXjE6mjYjVY1yX7TLbsh8QLeCEZgUb/rPL0azpYWSonnE0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667602550; a=rsa-sha256; cv=none; b=CVZfRcMFx6eAFNSTCZVK/fcgQfoRazkphe8RDPg1S9/qyPyRA+LQKThGgeEVNI9BCDQxAl kbHc1FsP1/Xa+xKhbku5YcyBSj9Xch8bCSZG9jGFkMnnj9z8JVdrGPfoYgDJ9t2h7EXJfB Vk9mJlCkGnn1snVt1KSsmr8Pq0S410Rx7hEUvyfo1lGgcEdaw25fS/Neiazsqq11IEsGZP hR1JVH1q5VHasmty2VylnIEZV2TJQg4RRBMCpKEGdwM4TGZrkH5ecXp0cXdIAi44k5Y9QZ /znSQK5J0lxxIngLFkPq3v720rshb5fGw6d/TE4lrWDkLXCoeCms9DrTAVorwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6033382aab2e6108e6faa273fd945274e161cd5b commit 6033382aab2e6108e6faa273fd945274e161cd5b Author: Sumit Saxena AuthorDate: 2022-11-04 22:18:38 +0000 Commit: Warner Losh CommitDate: 2022-11-04 22:18:38 +0000 if_bnxt: Display firmware version along with SIT package version Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D36441 --- 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");