diff mbox series

ixgbe: Check DDM existence in transceiver before access

Message ID 20190523191112.14572-1-maurosr@linux.vnet.ibm.com
State Accepted
Delegated to: Jeff Kirsher
Headers show
Series ixgbe: Check DDM existence in transceiver before access | expand

Commit Message

Mauro S. M. Rodrigues May 23, 2019, 7:11 p.m. UTC
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>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 3 ++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h     | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Jesse Brandeburg May 23, 2019, 9:20 p.m. UTC | #1
On Thu, 23 May 2019 16:11:12 -0300 Mauro wrote:
> 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>

Looks reasonable, thanks for the patch!

Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Bowers, AndrewX June 13, 2019, 9:27 p.m. UTC | #2
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On
> Behalf Of Mauro S. M. Rodrigues
> Sent: Thursday, May 23, 2019 12:11 PM
> To: intel-wired-lan@lists.osuosl.org; Kirsher, Jeffrey T
> <jeffrey.t.kirsher@intel.com>
> Cc: gromero@linux.vnet.ibm.com
> Subject: [Intel-wired-lan] [PATCH] ixgbe: Check DDM existence in transceiver
> before access
> 
> 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>
> ---
>  drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 3 ++-
>  drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h     | 1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index acba067cc15a..7c52ae8ac005 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -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;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h
index 214b01085718..693c615017cc 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h
@@ -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