ixgbe: Check DDM existence in transceiver before access
authorMauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
Thu, 23 May 2019 19:11:12 +0000 (16:11 -0300)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 26 Jun 2019 16:18:54 +0000 (09:18 -0700)
Some transceivers may comply with SFF-8472 but not implement the Digital
Diagnostic Monitoring (DDM) interface described in it. The existence of
such area is specified by bit 6 of byte 92, set to 1 if implemented.

Currently, due to not checking this bit ixgbe fails trying to read SFP
module's eeprom with the follow message:

ethtool -m enP51p1s0f0
Cannot get Module EEPROM data: Input/output error

Because it fails to read the additional 256 bytes in which it was assumed
to exist the DDM data.

This issue was noticed using a Mellanox Passive DAC PN 01FT738. The eeprom
data was confirmed by Mellanox as correct and present in other Passive
DACs in from other manufacturers.

Signed-off-by: "Mauro S. M. Rodrigues" <maurosr@linux.vnet.ibm.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h

index acba067..7c52ae8 100644 (file)
@@ -3226,7 +3226,8 @@ static int ixgbe_get_module_info(struct net_device *dev,
                page_swap = true;
        }
 
-       if (sff8472_rev == IXGBE_SFF_SFF_8472_UNSUP || page_swap) {
+       if (sff8472_rev == IXGBE_SFF_SFF_8472_UNSUP || page_swap ||
+           !(addr_mode & IXGBE_SFF_DDM_IMPLEMENTED)) {
                /* We have a SFP, but it does not support SFF-8472 */
                modinfo->type = ETH_MODULE_SFF_8079;
                modinfo->eeprom_len = ETH_MODULE_SFF_8079_LEN;
index 214b010..6544c45 100644 (file)
@@ -45,6 +45,7 @@
 #define IXGBE_SFF_SOFT_RS_SELECT_10G           0x8
 #define IXGBE_SFF_SOFT_RS_SELECT_1G            0x0
 #define IXGBE_SFF_ADDRESSING_MODE              0x4
+#define IXGBE_SFF_DDM_IMPLEMENTED              0x40
 #define IXGBE_SFF_QSFP_DA_ACTIVE_CABLE         0x1
 #define IXGBE_SFF_QSFP_DA_PASSIVE_CABLE                0x8
 #define IXGBE_SFF_QSFP_CONNECTOR_NOT_SEPARABLE 0x23