mlxsw: spectrum: Add Spectrum-2 ASIC port type-speed operations
authorShalom Toledo <shalomt@mellanox.com>
Fri, 22 Feb 2019 13:56:45 +0000 (13:56 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 23 Feb 2019 21:54:36 +0000 (13:54 -0800)
commitd3eaf1085a247344848e8bf454c6130b045fe495
tree0a488cdc13f741d71bbb29f2fc42fdeb89e43485
parent9ce8439718b6dfef2509dc72ec841740b14cc6d5
mlxsw: spectrum: Add Spectrum-2 ASIC port type-speed operations

Add Spectrum-2 ASIC port type-speed operations.

Since multiple ethtool link modes are represented using a single bit in the
ASIC, the driver forces the user to configure all types per a specific
speed. For example, if the user wants to advertise 100Gbps 4-lanes speed,
he should advertise all the types of 100Gbps 4-lanes speed that are
supported by the ASIC as shown below:

  Supported ethtool bits for 100Gbps 4-lanes:
      0x1000000000      100000baseKR4 Full
      0x2000000000      100000baseSR4 Full
      0x4000000000      100000baseCR4 Full
      0x8000000000      100000baseLR4_ER4 Full

  Command for advertising 100Gbps 4-lanes:
      ethtool -s enp3s0np1 advertise 0xF000000000

Signed-off-by: Shalom Toledo <shalomt@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h