From: Andrew Lunn <andrew@lunn.ch>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
kernel@pengutronix.de, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next v1 1/1] phy: dp83tg720: Add statistics support
Date: Mon, 19 Aug 2024 23:57:26 +0200 [thread overview]
Message-ID: <654c3a17-fea7-4e28-be36-5229eb106737@lunn.ch> (raw)
In-Reply-To: <20240819113625.2072283-1-o.rempel@pengutronix.de>
> +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
next prev parent reply other threads:[~2024-08-19 21:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-19 11:36 Oleksij Rempel
2024-08-19 21:57 ` Andrew Lunn [this message]
2024-08-20 5:11 ` Oleksij Rempel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=654c3a17-fea7-4e28-be36-5229eb106737@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®