]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5e: Refactor ptys2ethtool_adver_link()
authorShahar Shitrit <shshitrit@nvidia.com>
Wed, 19 Feb 2025 11:41:09 +0000 (13:41 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 21 Feb 2025 01:36:08 +0000 (17:36 -0800)
commit5246fd3fc232f50987dad73ffd9ded1f40f1e6f6
treeafc12a34e85c3ff221962e022406caaf611dd32f
parent3fe090ad025082556491604a4761cad87d7529da
net/mlx5e: Refactor ptys2ethtool_adver_link()

The function ptys2ethtool_adver_link() contains duplicated code that
is found in mlx5e_ethtool_get_speed_arr().

To eliminate this redundancy, we update mlx5e_ethtool_get_speed_arr()
to select the appropriate table based on the ext argument passed by
the caller, rather than querying the supported mode locally.

This allows us to replace the current logic in ptys2ethtool_adver_link()
with a call to mlx5e_ethtool_get_speed_arr().

This adjustment aligns with the ptys2ethtool_supported_link() function
and prepares for an upcoming patch that reduces code duplication.

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/20250219114112.403808-3-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c