Subject: Re: [RFC PATCH net-next 3/3] net/mlx5e: Expose link down reason to ethtool

From: Andrew Lunn <[email-masked]>
Date: Wed, 21 Jun 2017 16:03:18 +0200

> +static int mlx5e_get_link_down_reason(struct net_device *netdev,
> +				      struct ethtool_link_down_reason *ldr)
> +{
> +	struct mlx5e_priv *priv = netdev_priv(netdev);
> +	u16 monitor_opcode;
> +	int err;
> +
> +	if (!netif_running(netdev)) {
> +		ldr->reason = ETHTOOL_LINK_NETDEV_CARRIER_DOWN;
> +		return 0;
> +	}

This is generic, will work for any interface. The same is true for
ADMIN_DOWN. Either it is not required at all, since the information is
available via other means, or it should be in the core.

	  Andrew