bnxt_en: Do not allow VF to read EEPROM.
authorMichael Chan <michael.chan@broadcom.com>
Thu, 26 Apr 2018 21:44:37 +0000 (17:44 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Apr 2018 18:47:30 +0000 (14:47 -0400)
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>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

index 0ea8466d531b7daf29dc6f839b66962713eaca35..a699ca5493ef3f3bc296925a630e3a2c961f8a8b 100644 (file)
@@ -1818,6 +1818,11 @@ static int nvm_get_dir_info(struct net_device *dev, u32 *entries, u32 *length)
 
 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.
         */