diff options
author | Kamal Heib | 2016-11-27 16:02:09 +0100 |
---|---|---|
committer | David S. Miller | 2016-11-28 21:09:35 +0100 |
commit | d605d6686dc7e7c767cd2dbf89a4ebd195891212 (patch) | |
tree | e9042ca98de1c4688cb7623644d77a4b725b9f64 /drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | |
parent | net/mlx5e: Add DCBX control interface (diff) | |
download | kernel-qcow2-linux-d605d6686dc7e7c767cd2dbf89a4ebd195891212.tar.gz kernel-qcow2-linux-d605d6686dc7e7c767cd2dbf89a4ebd195891212.tar.xz kernel-qcow2-linux-d605d6686dc7e7c767cd2dbf89a4ebd195891212.zip |
net/mlx5e: Add support for ethtool self diagnostics test
The self diagnostics test implementaion include the following features:
1. Link Test: Check that link is in up state.
2. Speed Test: Check that link was negotiated correctly.
3. Health Test: Check the device health.
Signed-off-by: Kamal Heib <kamalh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c index 9ea7b37f87f8..839c4e9f5322 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c @@ -180,6 +180,8 @@ static int mlx5e_get_sset_count(struct net_device *dev, int sset) case ETH_SS_PRIV_FLAGS: return ARRAY_SIZE(mlx5e_priv_flags); + case ETH_SS_TEST: + return mlx5e_self_test_num(priv); /* fallthrough */ default: return -EOPNOTSUPP; @@ -286,6 +288,9 @@ static void mlx5e_get_strings(struct net_device *dev, break; case ETH_SS_TEST: + for (i = 0; i < mlx5e_self_test_num(priv); i++) + strcpy(data + i * ETH_GSTRING_LEN, + mlx5e_self_tests[i]); break; case ETH_SS_STATS: @@ -1573,5 +1578,6 @@ const struct ethtool_ops mlx5e_ethtool_ops = { .get_module_info = mlx5e_get_module_info, .get_module_eeprom = mlx5e_get_module_eeprom, .get_priv_flags = mlx5e_get_priv_flags, - .set_priv_flags = mlx5e_set_priv_flags + .set_priv_flags = mlx5e_set_priv_flags, + .self_test = mlx5e_self_test, }; |