[PATCH net-next v3 2/3] phy: Add defines for standardized PHY generic counters

Oleksij Rempel posted 3 patches 1 year, 5 months ago
[PATCH net-next v3 2/3] phy: Add defines for standardized PHY generic counters
Posted by Oleksij Rempel 1 year, 5 months ago
Introduce a set of defines for generic PHY-specific counters.
These defines provide standardized names for commonly
tracked statistics across different PHY drivers, ensuring consistency in
how these metrics are reported:

- `PHY_TX_PKT_COUNT`: Transmit packet count.
- `PHY_RX_PKT_COUNT`: Receive packet count.
- `PHY_TX_ERR_COUNT`: Transmit error count.
- `PHY_RX_ERR_COUNT`: Receive error count.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 include/linux/phy.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/phy.h b/include/linux/phy.h
index 6b7d40d49129d..65fd56ca8cb39 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -2209,4 +2209,10 @@ module_exit(phy_module_exit)
 bool phy_driver_is_genphy(struct phy_device *phydev);
 bool phy_driver_is_genphy_10g(struct phy_device *phydev);
 
+/* Defines for PHY specific counters */
+#define PHY_TX_PKT_COUNT	"tx_pkt_cnt"
+#define PHY_RX_PKT_COUNT	"rx_pkt_cnt"
+#define PHY_TX_ERR_COUNT	"tx_err_cnt"
+#define PHY_RX_ERR_COUNT	"rx_err_cnt"
+
 #endif /* __PHY_H */
-- 
2.39.2
Re: [PATCH net-next v3 2/3] phy: Add defines for standardized PHY generic counters
Posted by Andrew Lunn 1 year, 5 months ago
On Thu, Aug 22, 2024 at 01:59:38PM +0200, Oleksij Rempel wrote:
> Introduce a set of defines for generic PHY-specific counters.
> These defines provide standardized names for commonly
> tracked statistics across different PHY drivers, ensuring consistency in
> how these metrics are reported:
> 
> - `PHY_TX_PKT_COUNT`: Transmit packet count.
> - `PHY_RX_PKT_COUNT`: Receive packet count.
> - `PHY_TX_ERR_COUNT`: Transmit error count.
> - `PHY_RX_ERR_COUNT`: Receive error count.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew