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

From: Andrew Lunn <[email-masked]>
Date: Sun, 20 Dec 2020 00:31:11 +0100

> +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