]> git.itanic.dy.fi Git - linux-stable/commit
mlxsw: core_env: Read transceiver module EEPROM in 128 bytes chunks
authorIdo Schimmel <idosch@nvidia.com>
Tue, 25 Jul 2023 12:04:05 +0000 (14:04 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 27 Jul 2023 04:49:27 +0000 (21:49 -0700)
commit1f4aea1f72da039d830862bc690dbd2d355dc992
tree8afc3c39439acc3319e140d1a270b6d605957ed4
parentc8dbf67883db98a1987eefd4872cf997c64ce7e7
mlxsw: core_env: Read transceiver module EEPROM in 128 bytes chunks

Old firmware versions could only read up to 48 bytes from a transceiver
module's EEPROM in one go. Newer versions can read up to 128 bytes,
resulting in fewer transactions.

Query support for the new capability during driver initialization and if
supported, read up to 128 bytes in one go.

This is going to be especially useful for upcoming transceiver module
firmware flashing support.

Before:

 # perf stat -e devlink:devlink_hwmsg -- ethtool -m swp11 page 0x1 offset 128 length 128 i2c 0x50
 [...]
  Performance counter stats for 'ethtool -m swp11 page 0x1 offset 128 length 128 i2c 0x50':

                  3      devlink:devlink_hwmsg

After:

 # perf stat -e devlink:devlink_hwmsg -- ethtool -m swp11 page 0x1 offset 128 length 128 i2c 0x50
 [...]
  Performance counter stats for 'ethtool -m swp11 page 0x1 offset 128 length 128 i2c 0x50':

                  1      devlink:devlink_hwmsg

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Link: https://lore.kernel.org/r/99d1618e8cd5acefb2f795dfde1a5b41caa07dcb.1690281940.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/core_env.c
drivers/net/ethernet/mellanox/mlxsw/reg.h