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

Andrew Lunn
2020-12-19T23:32:25Z

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