]> www.infradead.org Git - users/hch/misc.git/commit
net/mlx5: Refactor link speed handling with mlx5_link_info struct
authorShahar Shitrit <shshitrit@nvidia.com>
Tue, 4 Mar 2025 16:06:16 +0000 (18:06 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 7 Mar 2025 01:53:34 +0000 (17:53 -0800)
commit65a5d3557184974608761b6abae0701f7e63a6de
tree4065a7c41ae52acb95c82859b8f46751966d6e3e
parenta2f61f1db85532e72fb8a3af51b06df94bb82912
net/mlx5: Refactor link speed handling with mlx5_link_info struct

Introduce struct mlx5_link_info with a speed field and change the
types of mlx5e_link_speed and mlx5e_ext_link_speed from arrays of
u32 to arrays of struct mlx5_link_info. These arrays are renamed
to mlx5e_link_info and mlx5e_ext_link_info, respectively.

This change prepares for a future patch that will introduce a lanes
field in struct mlx5_link_info and add lanes mapping alongside the
speed for each link mode in the two arrays.

Additionally, rename function mlx5_port_speed2linkmodes() to
mlx5_port_info2linkmodes() and function mlx5_port_ptys2speed()
to mlx5_port_ptys2info() and update the speed parameter/return
type to struct mlx5_link_info, in preparation for the upcoming
patch where these functions will also utilize the lanes field.

Signed-off-by: Shahar Shitrit <shshitrit@nvidia.com>
Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20250304160620.417580-3-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/port.c
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h
drivers/net/ethernet/mellanox/mlx5/core/port.c