[RFC PATCH v2 7/8] net: sparx5: add ethtool configuration and statistics support

Andrew Lunn andrew at lunn.ch
Sat Dec 19 18:31:11 EST 2020


> +void sparx5_get_stats64(struct net_device *ndev,
> +			struct rtnl_link_stats64 *stats)
> +{
> +	struct sparx5_port *port = netdev_priv(ndev);
> +	struct sparx5 *sparx5 = port->sparx5;
> +	u64 *portstats;
> +
> +	if (!sparx5->stats)
> +		return;		/* Not initialized yet */
> +
> +	portstats = &sparx5->stats[port->portno * sparx5->num_stats];
> +
> +	mutex_lock(&sparx5->stats_lock);

There was a big discussion about stats64 not being able to take a lock
a few weeks ago. You probably want to go read the thread. The aim was
to allow sleeping, but i don't know if that as been achieved yet.

   Andrew



More information about the linux-arm-kernel mailing list