mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 10:43:43 +00:00
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: Gal Pressman <gal@nvidia.com> Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20240808055927.2059700-8-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
ab666b5287
commit
29a943d71d
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user