r8169: Use improved RTL8125 hw stats
Heiner Kallweit
maintainerPATCH 1/1 r8169: Use improved RTL8125 hw stats
The new hw stat fields partially duplicate existing fields, but with a larger field size now. Use these new fields to reduce the risk of overflows.
Signed-off-by Heiner Kallweit <[email protected]>
--- drivers/net/ethernet/realtek/r8169_main.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/net/ethernet/realtek/r8169_main.c +8 -0
@@ -1873,6 +1873,14 @@ static void rtl8169_get_ethtool_stats(struct net_device *dev, data[10 ] =le32_to_cpu (counters->rx_multicast); data[11 ] =le16_to_cpu (counters->tx_aborted); data[12 ] =le16_to_cpu (counters->tx_underrun); + +if (rtl_is_8125 (tp)) { + data[4 ] =le32_to_cpu (counters->rx_mac_missed); + data[5 ] =le32_to_cpu (counters->align_errors32); + data[10 ] =le64_to_cpu (counters->rx_multicast64); + data[11 ] =le32_to_cpu (counters->tx_aborted32); + data[12 ] =le32_to_cpu (counters->tx_underrun32); + } }static void rtl8169_get_strings (struct net_device *dev,u32 stringset,u8 *data)
Signature · 1 line
2.46.2
Heiner Kallweit
maintainerQuoted 18 lines · Heiner Kallweit
The new hw stat fields partially duplicate existing fields, but with a larger field size now. Use these new fields to reduce the risk of overflows.
Signed-off-by Heiner Kallweit <[email protected]>--- drivers/net/ethernet/realtek/r8169_main.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/net/ethernet/realtek/r8169_main.c +1
-0@@ -1873,6 +1873,14 @@ static void rtl8169_get_ethtool_stats(struct net_device *dev, data[10 ] =le32_to_cpu (counters->rx_multicast); data[11 ] =le16_to_cpu (counters->tx_aborted); data[12 ] =le16_to_cpu (counters->tx_underrun); +
drivers/net/ethernet/realtek/r8169_main.c static void rtl8169_get_ethtool_stats(struct net_device *dev, · line 1886
Quoted 10 lines
drivers/net/ethernet/realtek/r8169_main.c +7
-0+if (rtl_is_8125 (tp)) { + data[4 ] =le32_to_cpu (counters->rx_mac_missed); + data[5 ] =le32_to_cpu (counters->align_errors32); + data[10 ] =le64_to_cpu (counters->rx_multicast64); + data[11 ] =le32_to_cpu (counters->tx_aborted32); + data[12 ] =le32_to_cpu (counters->tx_underrun32); + } }static void rtl8169_get_strings (struct net_device *dev,u32 stringset,u8 *data)
When further testing I found an issue with an apparently incorrect counter value. I have to check this with Realtek. Please drop the patch for now.