Thread (26 messages) 26 messages, 4 authors, 2022-03-22

Re: [PATCH v9 net-next 08/11] net: dsa: microchip: add support for ethtool port counters

From: Andrew Lunn <andrew@lunn.ch>
Date: 2022-03-20 01:26:55
Also in: linux-devicetree, lkml

On Fri, Mar 18, 2022 at 02:25:37PM +0530, Prasanna Vengateshan wrote:
Added support for get_eth_**_stats() (phy/mac/ctrl) and
get_stats64()

Reused the KSZ common APIs for get_ethtool_stats() & get_sset_count()
along with relevant lan937x hooks for KSZ common layer and added
support for get_strings()
+static void lan937x_get_stats64(struct dsa_switch *ds, int port,
+				struct rtnl_link_stats64 *s)
+{
+	struct ksz_device *dev = ds->priv;
+	struct ksz_port_mib *mib = &dev->ports[port].mib;
+	u64 *ctr = mib->counters;
+
+	mutex_lock(&mib->cnt_mutex);
I think for stats64 you are not allowed to block.

https://lore.kernel.org/netdev/20220218104330.g3vfbpdqltdkp4sr@skbuf/T/ (local)

There was talk of changing this. but i don't think it ever happened.

      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