bnx2x: Check if transceiver implements DDM before access
PATCH 1/1 bnx2x: Check if transceiver implements DDM before access
Some transceivers may comply with SFF-8472 even though they do not implement the Digital Diagnostic Monitoring (DDM) interface described in the spec. The existence of such area is specified by the 6th bit of byte 92, set to 1 if implemented.
Currently, without checking this bit, bnx2x fails trying to read sfp module's EEPROM with the follow message:
ethtool -m enP5p1s0f1
Cannot get Module EEPROM data: Input/output error
Because it fails to read the additional 256 bytes in which it is 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 similar to other Passive DACs from other manufacturers.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 3 ++- drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +2 -1
@@ -1609,7 +1609,8 @@ static int bnx2x_get_module_info(struct net_device *dev, }if (!sff8472_comp || - (diag_type &SFP_EEPROM_DIAG_ADDR_CHANGE_REQ )) { + (diag_type &SFP_EEPROM_DIAG_ADDR_CHANGE_REQ ) || + !(diag_type &SFP_EEPROM_DDM_IMPLEMENTED )) { modinfo->type =ETH_MODULE_SFF_8079 ; modinfo->eeprom_len =ETH_MODULE_SFF_8079_LEN ; }else {
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h +1 -0
@@ -62,6 +62,7 @@#define SFP_EEPROM_DIAG_TYPE_ADDR 0x5c#define SFP_EEPROM_DIAG_TYPE_SIZE 1#define SFP_EEPROM_DIAG_ADDR_CHANGE_REQ (1<<2) +#define SFP_EEPROM_DDM_IMPLEMENTED (1<<6)#define SFP_EEPROM_SFF_8472_COMP_ADDR 0x5e#define SFP_EEPROM_SFF_8472_COMP_SIZE 1
Signature · 1 line
2.21.0
David Miller
maintainerFrom: "Mauro S. M. Rodrigues" <[email protected]>
Date: Thu, 13 Jun 2019 16:25:40 -0300
Quoted 11 lines
Some transceivers may comply with SFF-8472 even though they do not implement the Digital Diagnostic Monitoring (DDM) interface described in the spec. The existence of such area is specified by the 6th bit of byte 92, set to 1 if implemented.
Currently, without checking this bit, bnx2x fails trying to read sfp module's EEPROM with the follow message:
ethtool -m enP5p1s0f1
Cannot get Module EEPROM data: Input/output error
Quoted 8 lines
Because it fails to read the additional 256 bytes in which it is 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 similar to other Passive DACs from other manufacturers.
Signed-off-by Mauro S. M. Rodrigues <[email protected]>
Marvell folks, please review.
Quoted 27 lines
-----Original Message-----
From: David Miller <[email protected]>
Sent: Monday, June 17, 2019 2:09 AM
To: [email protected]
Cc: [email protected]; Ariel Elior <[email protected]>; Sudarsana Reddy Kalluru <[email protected]>; GR-everest-linux-l2 <GR-everest- [email protected]>
Subject: Re: [PATCH net] bnx2x: Check if transceiver implements DDM before accessFrom: "Mauro S. M. Rodrigues" <[email protected]>
Date: Thu, 13 Jun 2019 16:25:40 -0300Quoted 14 lines
Some transceivers may comply with SFF-8472 even though they do not implement the Digital Diagnostic Monitoring (DDM) interface described in the spec. The existence of such area is specified by the 6th bit of byte 92, set to 1 if implemented.
Currently, without checking this bit, bnx2x fails trying to read sfp module's EEPROM with the follow message:
ethtool -m enP5p1s0f1
Cannot get Module EEPROM data: Input/output errorBecause it fails to read the additional 256 bytes in which it is assumed to exist the DDM data.
Quoted 7 lines
Quoted 5 lines
This issue was noticed using a Mellanox Passive DAC PN 01FT738. The EEPROM data was confirmed by Mellanox as correct and similar to other Passive DACs from other manufacturers.
Signed-off-by Mauro S. M. Rodrigues <[email protected]>Marvell folks, please review.
From: "Mauro S. M. Rodrigues" <[email protected]>
Date: Thu, 13 Jun 2019 16:25:40 -0300
Quoted 11 lines
Some transceivers may comply with SFF-8472 even though they do not implement the Digital Diagnostic Monitoring (DDM) interface described in the spec. The existence of such area is specified by the 6th bit of byte 92, set to 1 if implemented.
Currently, without checking this bit, bnx2x fails trying to read sfp module's EEPROM with the follow message:
ethtool -m enP5p1s0f1
Cannot get Module EEPROM data: Input/output error
Quoted 8 lines
Because it fails to read the additional 256 bytes in which it is 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 similar to other Passive DACs from other manufacturers.
Signed-off-by Mauro S. M. Rodrigues <[email protected]>
Applied, thank you.