Thread (38 messages) flat view 38 messages, 7 authors, 2020-12-23

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

From: Andrew Lunn <andrew@lunn.ch>
Date: 2020-12-19 23:32:25
Also in: linux-arm-kernel, lkml

+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help