[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <654c3a17-fea7-4e28-be36-5229eb106737@lunn.ch>
Date: Mon, 19 Aug 2024 23:57:26 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Oleksij Rempel <o.rempel@...gutronix.de>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
kernel@...gutronix.de, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH net-next v1 1/1] phy: dp83tg720: Add statistics support
> +static const struct dp83tg720_hw_stat dp83tg720_hw_stats[] = {
> + {
> + .string = "esd_event_count",
> + .cache_index1 = DP83TG720_CACHE_A2D_REG_66,
> + .cache_index2 = DP83TG720_CACHE_EMPTY,
> + .mask1 = DP83TG720S_ESD_EVENT_COUNT_MASK,
> + .shift1 = 9,
> + .flags = DP83TG720_FLAG_COUNTER,
> + },
> + {
> + .string = "link_training_time",
> + .cache_index1 = DP83TG720_CACHE_LINK_QUAL_1,
> + .cache_index2 = DP83TG720_CACHE_EMPTY,
> + .mask1 = DP83TG720S_LINK_TRAINING_TIME_MASK,
> + },
> + {
> + .string = "remote_receiver_time",
> + .cache_index1 = DP83TG720_CACHE_LINK_QUAL_2,
> + .cache_index2 = DP83TG720_CACHE_EMPTY,
> + .mask1 = DP83TG720S_REMOTE_RECEIVER_TIME_MASK,
> + .shift1 = 8,
> + },
If i remember correctly, some of these are part of an Open Alliance
standard. Ideally, we want all PHYs which follow the standard to use
the same names of these statistics.
Maybe add to the open alliance header something like
#define TC42_ESD_EVENT_COUNT "esd_event_count"
Given that the Open Alliance failed to define the registers, i don't
think we can do much more than that?
> +static void dp83tg720_get_strings(struct phy_device *phydev, u8 *data)
> +{
> + int i, j = 0;
> +
> + for (i = 0; i < ARRAY_SIZE(dp83tg720_hw_stats); i++) {
> + strscpy(&data[j * ETH_GSTRING_LEN],
> + dp83tg720_hw_stats[i].string, ETH_GSTRING_LEN);
ethtool_puts()
Andrew
---
pw-bot: cr
Powered by blists - more mailing lists