Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c98c66be authored by Aya Levin's avatar Aya Levin Committed by Greg Kroah-Hartman
Browse files

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: be7e87f9 ("net/mlx5e: Fail safe cqe compressing/moderation mode setting")
Signed-off-by: default avatarAya Levin <ayal@nvidia.com>
Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent df6f09cb
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1460,6 +1460,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;
@@ -1469,7 +1470,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;