public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Andrew Lunn <andrew@lunn.ch>,
	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 v2 3/3] phy: dp83tg720: Add statistics support
Date: Wed, 21 Aug 2024 10:16:22 +0200	[thread overview]
Message-ID: <20240821101622.3ef23d29@fedora-3.home> (raw)
In-Reply-To: <20240820122914.1958664-4-o.rempel@pengutronix.de>

Hello Oleksij,

On Tue, 20 Aug 2024 14:29:14 +0200
Oleksij Rempel <o.rempel@pengutronix.de> wrote:

> Introduce statistics support for the DP83TG720 PHY driver, enabling
> detailed monitoring and reporting of link quality and packet-related
> metrics.
> 
> To avoid double reading of certain registers, the implementation caches
> all relevant register values in a single operation. This approach
> ensures accurate and consistent data retrieval, particularly for
> registers that clear upon reading or require special handling.
> 
> Some of the statistics, such as link training times, do not increment
> and therefore require special handling during the extraction process.

This all looks good to me, I do have one small nit bellow :

> +/**
> + * dp83tg720_get_stats - Get the statistics values.
> + * @phydev: Pointer to the phy_device structure.
> + * @stats: Pointer to the ethtool_stats structure.
> + * @data: Pointer to the buffer where the statistics values will be stored.
> + *
> + * Fills the buffer with the statistics values, filtering out those that are
> + * not applicable based on the PHY's operating mode (e.g., RGMII).

I don't see how this filtering is actually implemented, is this comment
correct ?

> + */
> +static void dp83tg720_get_stats(struct phy_device *phydev,
> +				struct ethtool_stats *stats, u64 *data)
> +{
> +	int i, j = 0;
> +
> +	dp83tg720_cache_reg_values(phydev);
> +
> +	for (i = 0; i < ARRAY_SIZE(dp83tg720_hw_stats); i++) {
> +		data[j] = dp83tg720_extract_stat_value(phydev, i);
> +		j++;
> +	}
> +}

Thanks,

Maxime

  reply	other threads:[~2024-08-21  8:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-20 12:29 [PATCH net-next v2 0/3] Add Statistics Support for DP83TG720 PHY Oleksij Rempel
2024-08-20 12:29 ` [PATCH net-next v2 1/3] phy: open_alliance_helpers: Add defines for link quality metrics Oleksij Rempel
2024-08-20 12:29 ` [PATCH net-next v2 2/3] phy: Add defines for standardized PHY generic counters Oleksij Rempel
2024-08-20 12:29 ` [PATCH net-next v2 3/3] phy: dp83tg720: Add statistics support Oleksij Rempel
2024-08-21  8:16   ` Maxime Chevallier [this message]
2024-08-21  9:01     ` 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=20240821101622.3ef23d29@fedora-3.home \
    --to=maxime.chevallier@bootlin.com \
    --cc=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