Skip to content

Commit

Permalink
net/mlx5e: Fix error path for ethtool set-priv-flag
Browse files Browse the repository at this point in the history
[ Upstream commit 4eacfe7 ]

Expose error value when failing to comply to command:
$ ethtool --set-priv-flags eth2 rx_cqe_compress [on/off]

Fixes: be7e87f ("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>
  • Loading branch information
Aya Levin authored and gregkh committed Mar 30, 2021
1 parent 1c178ae commit c4421a1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1876,6 +1876,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;
Expand All @@ -1885,7 +1886,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;
Expand Down

0 comments on commit c4421a1

Please sign in to comment.