From: Michael Chan <michael.chan@broadcom.com>
Date: Thu, 26 Apr 2018 17:44:37 -0400
Subject: bnxt_en: Do not allow VF to read EEPROM.
Patch-mainline: v4.18-rc1
Git-commit: 4cebbaca12514986039b2ac7d30e36ecd2222f64
References: bsc#1086282 FATE#324873
Firmware does not allow the operation and would return failure, causing
a warning in dmesg. So check for VF and disallow it in the driver.
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 5 +++++
1 file changed, 5 insertions(+)
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -1806,6 +1806,11 @@ static int nvm_get_dir_info(struct net_d
static int bnxt_get_eeprom_len(struct net_device *dev)
{
+ struct bnxt *bp = netdev_priv(dev);
+
+ if (BNXT_VF(bp))
+ return 0;
+
/* The -1 return value allows the entire 32-bit range of offsets to be
* passed via the ethtool command-line utility.
*/