net/mlx5e: Fix ethtool self test: link speed
authorAya Levin <ayal@mellanox.com>
Wed, 2 Oct 2019 13:53:21 +0000 (16:53 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 29 Oct 2019 23:27:20 +0000 (16:27 -0700)
commit534e7366f41b0c689b01af4375aefcd1462adedf
tree250ae3ead74a4c118f521cfaf57630edf4dca474
parent9df86bdb6746d7fcfc2fda715f7a7c3d0ddb2654
net/mlx5e: Fix ethtool self test: link speed

Ethtool self test contains a test for link speed. This test reads the
PTYS register and determines whether the current speed is valid or not.
Change current implementation to use the function mlx5e_port_linkspeed()
that does the same check and fails when speed is invalid. This code
redundancy lead to a bug when mlx5e_port_linkspeed() was updated with
expended speeds and the self test was not.

Fixes: 2c81bfd5ae56 ("net/mlx5e: Move port speed code from en_ethtool.c to en/port.c")
Signed-off-by: Aya Levin <ayal@mellanox.com>
Reviewed-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c