OSDN Git Service

mlxsw: ethtool: Pass link mode in use to ethtool
authorDanielle Ratson <danieller@nvidia.com>
Tue, 2 Feb 2021 18:06:11 +0000 (20:06 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 4 Feb 2021 02:37:29 +0000 (18:37 -0800)
commit25a96f057a0fab318376c85bd83afda267f8ad33
tree3234b5861265d434ca85e193c34478c5c03e31f9
parent763ece86f0c27c751d6fac6b15863f5124f79a52
mlxsw: ethtool: Pass link mode in use to ethtool

Currently, when user space queries the link's parameters, as speed and
duplex, each parameter is passed from the driver to ethtool.

Instead, pass the link mode bit in use.
In Spectrum-1, simply pass the bit that is set to '1' from PTYS register.
In Spectrum-2, pass the first link mode bit in the mask of the used
link mode.

Signed-off-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c