]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Oct 2020 09:55:56 +0000 (11:55 +0200)
commitf2140d0c6b93ae21ba90ca6977b97987eabebd30
treeb15d9300aa3e255ed4d949331df1cc94550ff83e
parent96e80a3466347105d8e04515219347b0d6525397
net/mlx5e: Fix return status when setting unsupported FEC mode

[ Upstream commit 2608a2f831c47dfdf18885a7289be5af97182b05 ]

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: b5ede32d3329 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en/port.c