]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5e: Do not use non-EXT link modes in EXT mode
authorEran Ben Elisha <eranbe@mellanox.com>
Sun, 17 Nov 2019 13:17:05 +0000 (15:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Nov 2019 09:07:40 +0000 (10:07 +0100)
commitbfb6d2cab46f2ee8cc7d9eaf66c481c5bb1f083f
treeeb39fc34616e9da144e0f37ff5495fc6357ee508
parentf07b4f021e9562967b4673f078d15f871d6c1e91
net/mlx5e: Do not use non-EXT link modes in EXT mode

[ Upstream commit 24960574505c49b102ca1dfa6bf109669bca2a66 ]

On some old Firmwares, connector type value was not supported, and value
read from FW was 0. For those, driver used link mode in order to set
connector type in link_ksetting.

After FW exposed the connector type, driver translated the value to ethtool
definitions. However, as 0 is a valid value, before returning PORT_OTHER,
driver run the check of link mode in order to maintain backward
compatibility.

Cited patch added support to EXT mode.  With both features (connector type
and EXT link modes) ,if connector_type read from FW is 0 and EXT mode is
set, driver mistakenly compare EXT link modes to non-EXT link mode.
Fixed that by skipping this comparison if we are in EXT mode, as connector
type value is valid in this scenario.

Fixes: 6a897372417e ("net/mlx5: ethtool, Add ethtool support for 50Gbps per lane link modes")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Reviewed-by: Aya Levin <ayal@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c