summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAya Levin <ayal@nvidia.com>2021-03-11 17:46:35 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-30 14:40:11 +0200
commita9923184fa20f20098c780b3387457c4cfb3fdf7 (patch)
tree930a988bb21abcca321033649053775aa27f5c77
parent235d33fe3dfae78767cca5f0910a2cb1f8ff281e (diff)
downloadlinux-stable-a9923184fa20f20098c780b3387457c4cfb3fdf7.tar.gz
linux-stable-a9923184fa20f20098c780b3387457c4cfb3fdf7.tar.bz2
linux-stable-a9923184fa20f20098c780b3387457c4cfb3fdf7.zip
net/mlx5e: Fix error path for ethtool set-priv-flag
[ Upstream commit 4eacfe72e3e037e3fc019113df32c39a705148c2 ] Expose error value when failing to comply to command: $ ethtool --set-priv-flags eth2 rx_cqe_compress [on/off] Fixes: be7e87f92b58 ("net/mlx5e: Fail safe cqe compressing/moderation mode setting") Signed-off-by: Aya Levin <ayal@nvidia.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
index c3f1e2d76a46..377f91885bda 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -1747,6 +1747,7 @@ static int set_pflag_rx_cqe_compress(struct net_device *netdev,
{
struct mlx5e_priv *priv = netdev_priv(netdev);
struct mlx5_core_dev *mdev = priv->mdev;
+ int err;
if (!MLX5_CAP_GEN(mdev, cqe_compression))
return -EOPNOTSUPP;
@@ -1756,7 +1757,10 @@ static int set_pflag_rx_cqe_compress(struct net_device *netdev,
return -EINVAL;
}
- mlx5e_modify_rx_cqe_compression_locked(priv, enable);
+ err = mlx5e_modify_rx_cqe_compression_locked(priv, enable);
+ if (err)
+ return err;
+
priv->channels.params.rx_cqe_compress_def = enable;
return 0;