Blame SOURCES/0022-netdrv-bnxt_en-Read-package-version-from-firmware.patch

f95c89
From d3c5c8c9f03aef9ee1560babaf9513478e3b3bf2 Mon Sep 17 00:00:00 2001
f95c89
From: Jonathan Toppins <jtoppins@redhat.com>
f95c89
Date: Wed, 2 Oct 2019 18:22:37 -0400
f95c89
Subject: [PATCH 22/96] [netdrv] bnxt_en: Read package version from firmware
f95c89
f95c89
Message-id: <47986fa0bee271229f9f3fd74257117edf28b159.1570027456.git.jtoppins@redhat.com>
f95c89
Patchwork-id: 276440
f95c89
O-Subject: [RHEL-8.2 PATCH 15/78] bnxt_en: Read package version from firmware.
f95c89
Bugzilla: 1724766
f95c89
RH-Acked-by: John Linville <linville@redhat.com>
f95c89
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
f95c89
f95c89
HWRM_VER_GET firmware command returns package name that is running
f95c89
actively on the adapter.  Use this version instead of parsing from
f95c89
the package log in NVRAM.
f95c89
f95c89
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
f95c89
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
f95c89
Signed-off-by: David S. Miller <davem@davemloft.net>
f95c89
(cherry picked from commit 691aa62045c2b23152ce3b64feb601502aab97c5)
f95c89
Bugzilla: 1724766
f95c89
Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=23809532
f95c89
Tested: build, boot, basic ping
f95c89
Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
f95c89
Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
f95c89
---
f95c89
 drivers/net/ethernet/broadcom/bnxt/bnxt.c         | 9 +++++++++
f95c89
 drivers/net/ethernet/broadcom/bnxt/bnxt.h         | 1 +
f95c89
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 3 ++-
f95c89
 3 files changed, 12 insertions(+), 1 deletion(-)
f95c89
f95c89
Index: src/drivers/net/ethernet/broadcom/bnxt/bnxt.c
f95c89
===================================================================
f95c89
--- src.orig/drivers/net/ethernet/broadcom/bnxt/bnxt.c	2020-02-06 16:23:13.099537119 +0100
f95c89
+++ src/drivers/net/ethernet/broadcom/bnxt/bnxt.c	2020-02-06 16:23:13.240535824 +0100
f95c89
@@ -6710,6 +6710,15 @@
f95c89
 		 resp->hwrm_fw_maj_8b, resp->hwrm_fw_min_8b,
f95c89
 		 resp->hwrm_fw_bld_8b, resp->hwrm_fw_rsvd_8b);
f95c89
 
f95c89
+	if (strlen(resp->active_pkg_name)) {
f95c89
+		int fw_ver_len = strlen(bp->fw_ver_str);
f95c89
+
f95c89
+		snprintf(bp->fw_ver_str + fw_ver_len,
f95c89
+			 FW_VER_STR_LEN - fw_ver_len - 1, "/pkg %s",
f95c89
+			 resp->active_pkg_name);
f95c89
+		bp->fw_cap |= BNXT_FW_CAP_PKG_VER;
f95c89
+	}
f95c89
+
f95c89
 	bp->hwrm_cmd_timeout = le16_to_cpu(resp->def_req_timeout);
f95c89
 	if (!bp->hwrm_cmd_timeout)
f95c89
 		bp->hwrm_cmd_timeout = DFLT_HWRM_CMD_TIMEOUT;
f95c89
Index: src/drivers/net/ethernet/broadcom/bnxt/bnxt.h
f95c89
===================================================================
f95c89
--- src.orig/drivers/net/ethernet/broadcom/bnxt/bnxt.h	2020-02-06 16:23:13.099537119 +0100
f95c89
+++ src/drivers/net/ethernet/broadcom/bnxt/bnxt.h	2020-02-06 16:23:13.240535824 +0100
f95c89
@@ -1483,6 +1483,7 @@
f95c89
 	#define BNXT_FW_CAP_KONG_MB_CHNL		0x00000080
f95c89
 	#define BNXT_FW_CAP_OVS_64BIT_HANDLE		0x00000400
f95c89
 	#define BNXT_FW_CAP_TRUSTED_VF			0x00000800
f95c89
+	#define BNXT_FW_CAP_PKG_VER			0x00004000
f95c89
 	#define BNXT_FW_CAP_PCIE_STATS_SUPPORTED	0x00020000
f95c89
 	#define BNXT_FW_CAP_EXT_STATS_SUPPORTED		0x00040000
f95c89
 
f95c89
Index: src/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
f95c89
===================================================================
f95c89
--- src.orig/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c	2020-02-06 16:23:12.957538422 +0100
f95c89
+++ src/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c	2020-02-06 16:23:13.241535815 +0100
f95c89
@@ -3305,7 +3305,8 @@
f95c89
 	struct net_device *dev = bp->dev;
f95c89
 	int i, rc;
f95c89
 
f95c89
-	bnxt_get_pkgver(dev);
f95c89
+	if (!(bp->fw_cap & BNXT_FW_CAP_PKG_VER))
f95c89
+		bnxt_get_pkgver(dev);
f95c89
 
f95c89
 	if (bp->hwrm_spec_code < 0x10704 || !BNXT_SINGLE_PF(bp))
f95c89
 		return;