Skip to content

Commit 281900a

Browse files
amoreton-xilinxdavem330
authored andcommitted
sfc: Fix module EEPROM reporting for QSFP modules
The sfc driver does not report QSFP module EEPROM contents correctly as only the first page is fetched from hardware. Commit 0e1a2a3 ("ethtool: Add SFF-8436 and SFF-8636 max EEPROM length definitions") added ETH_MODULE_SFF_8436_MAX_LEN for the overall size of the EEPROM info, so use that to report the full EEPROM contents. Fixes: 9b17010 ("sfc: Add ethtool -m support for QSFP modules") Signed-off-by: Andy Moreton <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f858e2f commit 281900a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/net/ethernet/sfc/mcdi_port_common.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -972,12 +972,15 @@ static u32 efx_mcdi_phy_module_type(struct efx_nic *efx)
972972

973973
/* A QSFP+ NIC may actually have an SFP+ module attached.
974974
* The ID is page 0, byte 0.
975+
* QSFP28 is of type SFF_8636, however, this is treated
976+
* the same by ethtool, so we can also treat them the same.
975977
*/
976978
switch (efx_mcdi_phy_get_module_eeprom_byte(efx, 0, 0)) {
977-
case 0x3:
979+
case 0x3: /* SFP */
978980
return MC_CMD_MEDIA_SFP_PLUS;
979-
case 0xc:
980-
case 0xd:
981+
case 0xc: /* QSFP */
982+
case 0xd: /* QSFP+ */
983+
case 0x11: /* QSFP28 */
981984
return MC_CMD_MEDIA_QSFP_PLUS;
982985
default:
983986
return 0;
@@ -1075,7 +1078,7 @@ int efx_mcdi_phy_get_module_info(struct efx_nic *efx, struct ethtool_modinfo *mo
10751078

10761079
case MC_CMD_MEDIA_QSFP_PLUS:
10771080
modinfo->type = ETH_MODULE_SFF_8436;
1078-
modinfo->eeprom_len = ETH_MODULE_SFF_8436_LEN;
1081+
modinfo->eeprom_len = ETH_MODULE_SFF_8436_MAX_LEN;
10791082
break;
10801083

10811084
default:

0 commit comments

Comments
 (0)