]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Fix return status when setting unsupported FEC mode
authorAya Levin <ayal@mellanox.com>
Wed, 12 Aug 2020 07:44:36 +0000 (10:44 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 2 Oct 2020 17:59:57 +0000 (10:59 -0700)
commitf6ac60bc3f19d0fdbd3b41531cbfd07bb4a65d2e
tree0700f79971ddcacc9bb0dd54e80e074e036f40fa
parent19cf5402d47165986c305b7a87311bb9374e30a1
net/mlx5e: Fix return status when setting unsupported FEC mode

Verify the configured FEC mode is supported by at least a single link
mode before applying the command. Otherwise fail the command and return
"Operation not supported".
Prior to this patch, the command was successful, yet it falsely set all
link modes to FEC auto mode - like configuring FEC mode to auto. Auto
mode is the default configuration if a link mode doesn't support the
configured FEC mode.

Fixes: c6433ed33427 ("net/mlx5e: Add support for FEC modes based on 50G per lane links")
Signed-off-by: Aya Levin <ayal@mellanox.com>
Reviewed-by: Eran Ben Elisha <eranbe@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/port.c