mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
net/mlx5e: Enforce setting of a single FEC mode
[ Upstream commit 4bd9d5070b ]
Ethtool command allow setting of several FEC modes in a single set
command. The driver can only set a single FEC mode at a time. With this
patch driver will reply not-supported on setting several FEC modes.
Signed-off-by: Aya Levin <ayal@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0d03cbfdf3
commit
6d4330391c
@@ -1548,6 +1548,10 @@ static int mlx5e_set_fecparam(struct net_device *netdev,
|
||||
int mode;
|
||||
int err;
|
||||
|
||||
if (bitmap_weight((unsigned long *)&fecparam->fec,
|
||||
ETHTOOL_FEC_BASER_BIT + 1) > 1)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
for (mode = 0; mode < ARRAY_SIZE(pplm_fec_2_ethtool); mode++) {
|
||||
if (!(pplm_fec_2_ethtool[mode] & fecparam->fec))
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user