]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Fix matching of speed to PRM link modes
authorAya Levin <ayal@mellanox.com>
Sun, 16 Jun 2019 10:20:29 +0000 (13:20 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 25 Jul 2019 20:31:00 +0000 (13:31 -0700)
commit8ea6c2029ea7922872093d666f27fcbe38c00ccc
tree867a527fe156ee68324093c05e036597dd9b49e6
parent8b8c40c9403c45ff7d70d78b88c5a6a10fe56fa0
net/mlx5e: Fix matching of speed to PRM link modes

Speed translation is performed based on legacy or extended PTYS
register. Translate speed with respect to:
1) Capability bit of extended PTYS table.
2) User request:
 a) When auto-negotiation is turned on, inspect advertisement whether it
 contains extended link modes.
 b) When auto-negotiation is turned off, speed > 100Gbps (maximal
 speed supported in legacy mode).
With both conditions fulfilled translation is done with extended PTYS
table otherwise use legacy PTYS table.
Without this patch 25/50/100 Gbps speed cannot be set, since try to
configure in extended mode but read from legacy mode.

Fixes: 28d697d61a52 ("net/mlx5: ethtool, Allow legacy link-modes configuration via non-extended ptys")
Signed-off-by: Aya Levin <ayal@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en/port.c
drivers/net/ethernet/mellanox/mlx5/core/en/port.h
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c