Commit 54dd5e35 authored by Erez Alfasi's avatar Erez Alfasi Committed by Greg Kroah-Hartman

net/mlx4_en: ethtool, Remove unsupported SFP EEPROM high pages query

[ Upstream commit 135dd9594f127c8a82d141c3c8430e9e2143216a ]

Querying EEPROM high pages data for SFP module is currently
not supported by our driver but is still tried, resulting in
invalid FW queries.

Set the EEPROM ethtool data length to 256 for SFP module to
limit the reading for page 0 only and prevent invalid FW queries.

Fixes: 7202da8b ("ethtool, net/mlx4_en: Cable info, get_module_info/eeprom ethtool support")
Signed-off-by: default avatarErez Alfasi <>
Signed-off-by: default avatarTariq Toukan <>
Signed-off-by: default avatarDavid S. Miller <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent cc475966
......@@ -1906,6 +1906,8 @@ static int mlx4_en_set_tunable(struct net_device *dev,
return ret;
#define MLX4_EEPROM_PAGE_LEN 256
static int mlx4_en_get_module_info(struct net_device *dev,
struct ethtool_modinfo *modinfo)
......@@ -1940,7 +1942,7 @@ static int mlx4_en_get_module_info(struct net_device *dev,
modinfo->type = ETH_MODULE_SFF_8472;
modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN;
modinfo->eeprom_len = MLX4_EEPROM_PAGE_LEN;
return -ENOSYS;
......@@ -1398,11 +1398,6 @@ int mlx4_get_module_info(struct mlx4_dev *dev, u8 port,
size -= offset + size - I2C_PAGE_SIZE;
i2c_addr = I2C_ADDR_LOW;
if (offset >= I2C_PAGE_SIZE) {
/* Reset offset to high page */
i2c_addr = I2C_ADDR_HIGH;
offset -= I2C_PAGE_SIZE;
cable_info = (struct mlx4_cable_info *)inmad->data;
cable_info->dev_mem_address = cpu_to_be16(offset);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment