mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luo Jie <quic_luoj@quicinc.com>
To: Andrew Lunn <andrew@lunn.ch>
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>,
	<netdev@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next 1/3] net: phy: qcom: Add PHY counter support
Date: Wed, 9 Jul 2025 13:17:47 +0800	[thread overview]
Message-ID: <0e60e901-2284-462e-b853-617dd66f1a30@quicinc.com> (raw)
In-Reply-To: <d64c9e64-879a-431a-b53f-06cb7166b940@lunn.ch>



On 7/9/2025 12:31 AM, Andrew Lunn wrote:
>> +static const struct qcom_phy_hw_stat qcom_phy_hw_stats[] = {
>> +	{
>> +		.string		= "phy_rx_good_frame",
>> +		.devad		= MDIO_MMD_AN,
>> +		.cnt_31_16_reg	= QCA808X_MMD7_CNT_RX_GOOD_CRC_31_16,
>> +		.cnt_15_0_reg	= QCA808X_MMD7_CNT_RX_GOOD_CRC_15_0,
>> +	},
>> +	{
>> +		.string		= "phy_rx_bad_frame",
>> +		.devad		= MDIO_MMD_AN,
>> +		.cnt_31_16_reg	= 0xffff,
>> +		.cnt_15_0_reg	= QCA808X_MMD7_CNT_RX_BAD_CRC,
>> +	},
>> +	{
>> +		.string		= "phy_tx_good_frame",
>> +		.devad		= MDIO_MMD_AN,
>> +		.cnt_31_16_reg	= QCA808X_MMD7_CNT_TX_GOOD_CRC_31_16,
>> +		.cnt_15_0_reg	= QCA808X_MMD7_CNT_TX_GOOD_CRC_15_0,
>> +	},
>> +	{
>> +		.string		= "phy_tx_bad_frame",
>> +		.devad		= MDIO_MMD_AN,
> 
> Are there any counters which might be added later which are not in
> MDIO_MMD_AN? It seems pointless having this if it is fixed.

Yes, this structure is designed to be extended in the future to support
10G-capable PHY chip, where the counter resides in the MDIO_MMD_PCS
when the link speed is 2500 Mbps or higher. I will add a comment to the
structure to clarify this intent.

> 
>> +		.cnt_31_16_reg	= 0xffff,
>> +		.cnt_15_0_reg	= QCA808X_MMD7_CNT_TX_BAD_CRC,
>> +	},
>> +};
> 
> There has been an attempt to try to standardise PHY statistics. Please
> look at:
> 
> **
>   * struct ethtool_phy_stats - PHY-level statistics counters
>   * @rx_packets: Total successfully received frames
>   * @rx_bytes: Total successfully received bytes
>   * @rx_errors: Total received frames with errors (e.g., CRC errors)
>   * @tx_packets: Total successfully transmitted frames
>   * @tx_bytes: Total successfully transmitted bytes
>   * @tx_errors: Total transmitted frames with errors
>   *
>   * This structure provides a standardized interface for reporting
>   * PHY-level statistics counters. It is designed to expose statistics
>   * commonly provided by PHYs but not explicitly defined in the IEEE
>   * 802.3 standard.
>   */
> struct ethtool_phy_stats {
>          u64 rx_packets;
>          u64 rx_bytes;
>          u64 rx_errors;
>          u64 tx_packets;
>          u64 tx_bytes;
>          u64 tx_errors;
> };
> 
> Please use this if possible.
> 
>      Andrew

Thank you for the suggestion. I will review the standardized PHY
statistics framework and update the implementation accordingly to
ensure alignment.

> 
> ---
> pw-bot: cr


  reply	other threads:[~2025-07-09  5:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-08 16:07 [PATCH net-next 0/3] Add shared PHY counter support for QCA807x and QCA808x Luo Jie
2025-07-08 16:07 ` [PATCH net-next 1/3] net: phy: qcom: Add PHY counter support Luo Jie
2025-07-08 16:31   ` Andrew Lunn
2025-07-09  5:17     ` Luo Jie [this message]
2025-07-08 16:07 ` [PATCH net-next 2/3] net: phy: qcom: qca808x: Support PHY counter Luo Jie
2025-07-08 16:07 ` [PATCH net-next 3/3] net: phy: qcom: qca807x: " Luo Jie

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=0e60e901-2284-462e-b853-617dd66f1a30@quicinc.com \
    --to=quic_luoj@quicinc.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --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®