summaryrefslogtreecommitdiff
path: root/scripts/basic
diff options
context:
space:
mode:
authorShahar Shitrit <shshitrit@nvidia.com>2026-09-02 19:46:33 +0300
committerJakub Kicinski <kuba@kernel.org>2026-09-05 13:14:48 -0700
commitb9d755c5a37519fb1354034db1dfeb30e1ba6856 (patch)
treeb4cc6ea82e0bbc8515131b844ace0422ef85bb64 /scripts/basic
parent802eedcc0b25bb3e1b492f0600ab74325274d53b (diff)
downloadlinux-b9d755c5a37519fb1354034db1dfeb30e1ba6856.tar.gz
linux-b9d755c5a37519fb1354034db1dfeb30e1ba6856.zip
net/mlx5e: Fix setting RS FEC after remapping
When a user sets a FEC mode via ethtool, the driver maps the ethtool FEC type to the lowest mlx5 bit of that type. For RS FEC, this is MLX5E_FEC_RS_528_514 (bit 2). The driver then checks whether this bit is supported by at least one link mode by inspecting the fec_override_cap fields via mlx5e_fec_in_caps(), and returns -EOPNOTSUPP if not. This check is incorrect. RS FEC has three supported hardware variants: RS_528_514 (bit 2), RS_544_514_INTERLEAVED_QUAD (bit 4), and RS_544_514 (bit 7). mlx5e_remap_fec_conf_mode() already remaps bit 2 to the appropriate RS variant per link mode when writing the admin fields, but the early capability check is done against the raw unmapped bit. As a result, a device that supports RS_544_514 or RS_544_514_INTERLEAVED_QUAD but not RS_528_514 will incorrectly reject the user's RS FEC request. Remove the early support check from mlx5e_set_fec_mode() and fold it into the existing write loop, checking caps against the remapped policy per link mode. Return -EOPNOTSUPP before the final register write if no link mode accepted the policy. Fixes: 2608a2f831c4 ("net/mlx5e: Fix return status when setting unsupported FEC mode") Signed-off-by: Shahar Shitrit <shshitrit@nvidia.com> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com> Reviewed-by: Yael Chemla <ychemla@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20260902164634.3657606-3-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions