Commit 29a943d7 authored by Gal Pressman's avatar Gal Pressman Committed by Jakub Kicinski
Browse files

net/mlx5e: Use extack in get coalesce callback



In case of errors in get coalesce, reflect it through extack instead of
a dmesg print.

Signed-off-by: default avatarGal Pressman <gal@nvidia.com>
Reviewed-by: default avatarCosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: default avatarTariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20240808055927.2059700-8-tariqt@nvidia.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ab666b52
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1180,7 +1180,8 @@ int mlx5e_ethtool_set_channels(struct mlx5e_priv *priv,
			       struct ethtool_channels *ch);
int mlx5e_ethtool_get_coalesce(struct mlx5e_priv *priv,
			       struct ethtool_coalesce *coal,
			       struct kernel_ethtool_coalesce *kernel_coal);
			       struct kernel_ethtool_coalesce *kernel_coal,
			       struct netlink_ext_ack *extack);
int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv,
			       struct ethtool_coalesce *coal,
			       struct kernel_ethtool_coalesce *kernel_coal,
+6 −3
Original line number Diff line number Diff line
@@ -545,12 +545,15 @@ static int mlx5e_set_channels(struct net_device *dev,

int mlx5e_ethtool_get_coalesce(struct mlx5e_priv *priv,
			       struct ethtool_coalesce *coal,
			       struct kernel_ethtool_coalesce *kernel_coal)
			       struct kernel_ethtool_coalesce *kernel_coal,
			       struct netlink_ext_ack *extack)
{
	struct dim_cq_moder *rx_moder, *tx_moder;

	if (!MLX5_CAP_GEN(priv->mdev, cq_moderation))
	if (!MLX5_CAP_GEN(priv->mdev, cq_moderation)) {
		NL_SET_ERR_MSG_MOD(extack, "CQ moderation not supported");
		return -EOPNOTSUPP;
	}

	rx_moder = &priv->channels.params.rx_cq_moderation;
	coal->rx_coalesce_usecs		= rx_moder->usec;
@@ -574,7 +577,7 @@ static int mlx5e_get_coalesce(struct net_device *netdev,
{
	struct mlx5e_priv *priv = netdev_priv(netdev);

	return mlx5e_ethtool_get_coalesce(priv, coal, kernel_coal);
	return mlx5e_ethtool_get_coalesce(priv, coal, kernel_coal, extack);
}

static int mlx5e_ethtool_get_per_queue_coalesce(struct mlx5e_priv *priv, u32 queue,
+1 −1
Original line number Diff line number Diff line
@@ -386,7 +386,7 @@ static int mlx5e_rep_get_coalesce(struct net_device *netdev,
{
	struct mlx5e_priv *priv = netdev_priv(netdev);

	return mlx5e_ethtool_get_coalesce(priv, coal, kernel_coal);
	return mlx5e_ethtool_get_coalesce(priv, coal, kernel_coal, extack);
}

static int mlx5e_rep_set_coalesce(struct net_device *netdev,
+1 −1
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ static int mlx5i_get_coalesce(struct net_device *netdev,
{
	struct mlx5e_priv *priv = mlx5i_epriv(netdev);

	return mlx5e_ethtool_get_coalesce(priv, coal, kernel_coal);
	return mlx5e_ethtool_get_coalesce(priv, coal, kernel_coal, extack);
}

static int mlx5i_get_ts_info(struct net_device *netdev,