[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d64c9e64-879a-431a-b53f-06cb7166b940@lunn.ch>
Date: Tue, 8 Jul 2025 18:31:11 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Luo Jie <quic_luoj@...cinc.com>
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>,
netdev@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 1/3] net: phy: qcom: Add PHY counter support
> +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.
> + .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
---
pw-bot: cr
Powered by blists - more mailing lists