OSDN Git Service

mlxsw: core: Extend QSFP EEPROM size for ethtool
authorVadim Pasternak <vadimp@mellanox.com>
Mon, 21 Oct 2019 10:30:31 +0000 (13:30 +0300)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 22 Oct 2019 17:30:41 +0000 (10:30 -0700)
commita45bfb5a50701cec6799cf24386c2be56770328d
treefb3c9a2f2a99bcb0de1a598ac45a1f9bc7c639ba
parentf366cd2a2e510b155e18b21a2d149332aa08eb61
mlxsw: core: Extend QSFP EEPROM size for ethtool

Extend the size of QSFP EEPROM for the cable types SSF8436 and SFF8636
from 256 to 640 bytes in order to expose all the EEPROM pages by
ethtool.

For SFF-8636 and SFF-8436 specifications, the driver exposes 256 bytes
of data for ethtool's get_module_eeprom() callback. This is because the
driver uses the below defines to specify SFF module length in ethtool's
get_module_info() callback:
'ETH_MODULE_SFF_8636_LEN' and 'ETH_MODULE_SFF_8436_LEN' (both are 256).

As a result of exposing 256 bytes only, ethtool shows wrong "zero" info
for pages 1, 2, 3.

The patch changes the length returned by callback for get_module_info()
to the values from the next defines: 'ETH_MODULE_SFF_8636_MAX_LEN' and
'ETH_MODULE_SFF_8436_MAX_LEN' (both are 640) to allow exposing of upper
page 1, 2 and 3.

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
drivers/net/ethernet/mellanox/mlxsw/core_env.c