Skip to contentSkip to conversation

igbvf: ethtool statistics improvements

PATCH In review Kohei Enju 4 participants 9 messages Aug 18, 2025 – Sep 16, 2025

Subsystems (3)
lore
Share & tools
lore

Kohei Enju

author
#0 lore raw

v2 cover igbvf: ethtool statistics improvements

This series contains:
1. Add missing lbtx_packets and lbtx_bytes counters that are available in hardware but not exposed via ethtool
2. Remove rx_long_byte_count counter that shows the same value as rx_bytes

Tested on Intel Corporation I350 Gigabit Network Connection.

Changes:
v1: https://lore.kernel.org/intel-wired-lan/[email protected]/
v2:
- Remove Tested-by: tag
- Add Reviewed-by: tag
- s/duplicated/redundant/ in commit message of the 2/2 patch

Kohei Enju (2):
igbvf: add lbtx_packets and lbtx_bytes to ethtool statistics
igbvf: remove redundant counter rx_long_byte_count from ethtool
statistics

 drivers/net/ethernet/intel/igbvf/ethtool.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.48.1
author
#1 lore raw

PATCH v2 1/2 igbvf: add lbtx_packets and lbtx_bytes to ethtool statistics

Currently ethtool shows lbrx_packets and lbrx_bytes (Good RX Packets/Octets loopback Count), but doesn't show the TX-side equivalents (lbtx_packets and lbtx_bytes). Add visibility of those missing statistics by adding them to ethtool statistics.

In addition, the order of lbrx_bytes and lbrx_packets is not consistent with non-loopback statistics (rx_packets, rx_bytes). Therefore, align the order by swapping positions of lbrx_bytes and lbrx_packets.

Tested on Intel Corporation I350 Gigabit Network Connection.

Before:

  # ethtool -S ens5 | grep -E "x_(bytes|packets)"
       rx_packets: 135
       tx_packets: 106
       rx_bytes: 16010
       tx_bytes: 12451
       lbrx_bytes: 1148
       lbrx_packets: 12

After:

  # ethtool -S ens5 | grep -E "x_(bytes|packets)"
       rx_packets: 748
       tx_packets: 304
       rx_bytes: 81513
       tx_bytes: 33698
       lbrx_packets: 97
       lbtx_packets: 109
       lbrx_bytes: 12090
       lbtx_bytes: 12401
---
 drivers/net/ethernet/intel/igbvf/ethtool.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/igbvf/ethtool.c +3 -1
index 773895c663fd..c6defc495f13 100644
@@ -30,8 +30,10 @@ static const struct igbvf_stats igbvf_gstrings_stats[] = {
 	{ "rx_bytes", IGBVF_STAT(stats.gorc, stats.base_gorc) },
 	{ "tx_bytes", IGBVF_STAT(stats.gotc, stats.base_gotc) },
 	{ "multicast", IGBVF_STAT(stats.mprc, stats.base_mprc) },
-	{ "lbrx_bytes", IGBVF_STAT(stats.gorlbc, stats.base_gorlbc) },
 	{ "lbrx_packets", IGBVF_STAT(stats.gprlbc, stats.base_gprlbc) },
+	{ "lbtx_packets", IGBVF_STAT(stats.gptlbc, stats.base_gptlbc) },
+	{ "lbrx_bytes", IGBVF_STAT(stats.gorlbc, stats.base_gorlbc) },
+	{ "lbtx_bytes", IGBVF_STAT(stats.gotlbc, stats.base_gotlbc) },
 	{ "tx_restart_queue", IGBVF_STAT(restart_queue, zero_base) },
 	{ "tx_timeout_count", IGBVF_STAT(tx_timeout_count, zero_base) },
 	{ "rx_long_byte_count", IGBVF_STAT(stats.gorc, stats.base_gorc) },
Signature · 1 line
2.48.1
Reviewed-by on v2 1/2
#2 lore raw

RE: [Intel-wired-lan] [PATCH v2 iwl-next 1/2] igbvf: add lbtx_packets and lbtx_bytes to ethtool statistics

Quoted 49 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Kohei Enju
Sent: Monday, August 18, 2025 5:18 PM
To: [email protected]; [email protected]; linux- [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; [email protected]; Kohei Enju <[email protected]>; Paul Menzel <[email protected]>
Subject: [Intel-wired-lan] [PATCH v2 iwl-next 1/2] igbvf: add lbtx_packets and lbtx_bytes to ethtool statistics

Currently ethtool shows lbrx_packets and lbrx_bytes (Good RX Packets/Octets loopback Count), but doesn't show the TX-side equivalents (lbtx_packets and lbtx_bytes). Add visibility of those missing statistics by adding them to ethtool statistics.

In addition, the order of lbrx_bytes and lbrx_packets is not consistent with non-loopback statistics (rx_packets, rx_bytes). Therefore, align the order by swapping positions of lbrx_bytes and lbrx_packets.

Tested on Intel Corporation I350 Gigabit Network Connection.

Before:

  # ethtool -S ens5 | grep -E "x_(bytes|packets)"
       rx_packets: 135
       tx_packets: 106
       rx_bytes: 16010
       tx_bytes: 12451
       lbrx_bytes: 1148
       lbrx_packets: 12

After:

  # ethtool -S ens5 | grep -E "x_(bytes|packets)"
       rx_packets: 748
       tx_packets: 304
       rx_bytes: 81513
       tx_bytes: 33698
       lbrx_packets: 97
       lbtx_packets: 109
       lbrx_bytes: 12090
       lbtx_bytes: 12401
Quoted 2 lines
Quoted 28 lines
---
 drivers/net/ethernet/intel/igbvf/ethtool.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/igbvf/ethtool.c +3 -1
index 773895c663fd..c6defc495f13 100644
@@ -30,8 +30,10 @@ static const struct igbvf_stats
 igbvf_gstrings_stats[] = {
 	{ "rx_bytes", IGBVF_STAT(stats.gorc, stats.base_gorc) },
 	{ "tx_bytes", IGBVF_STAT(stats.gotc, stats.base_gotc) },
 	{ "multicast", IGBVF_STAT(stats.mprc, stats.base_mprc) },
-	{ "lbrx_bytes", IGBVF_STAT(stats.gorlbc, stats.base_gorlbc) },
 	{ "lbrx_packets", IGBVF_STAT(stats.gprlbc, stats.base_gprlbc)
 },
+	{ "lbtx_packets", IGBVF_STAT(stats.gptlbc, stats.base_gptlbc)
 },
+	{ "lbrx_bytes", IGBVF_STAT(stats.gorlbc, stats.base_gorlbc) },
+	{ "lbtx_bytes", IGBVF_STAT(stats.gotlbc, stats.base_gotlbc) },
drivers/net/ethernet/intel/igbvf/ethtool.c +0 -0
 	{ "tx_restart_queue", IGBVF_STAT(restart_queue, zero_base) },
 	{ "tx_timeout_count", IGBVF_STAT(tx_timeout_count, zero_base)

},
{ "rx_long_byte_count", IGBVF_STAT(stats.gorc, stats.base_gorc)
},
--
2.48.1

reviewer Reviewed-by on v2 1/2
#3 lore raw

Re: [PATCH v2 iwl-next 1/2] igbvf: add lbtx_packets and lbtx_bytes to ethtool statistics

In reply to Kohei Enju
Quoted 31 lines · Kohei Enju

Currently ethtool shows lbrx_packets and lbrx_bytes (Good RX Packets/Octets loopback Count), but doesn't show the TX-side equivalents (lbtx_packets and lbtx_bytes). Add visibility of those missing statistics by adding them to ethtool statistics.

In addition, the order of lbrx_bytes and lbrx_packets is not consistent with non-loopback statistics (rx_packets, rx_bytes). Therefore, align the order by swapping positions of lbrx_bytes and lbrx_packets.

Tested on Intel Corporation I350 Gigabit Network Connection.

Before:

  # ethtool -S ens5 | grep -E "x_(bytes|packets)"
       rx_packets: 135
       tx_packets: 106
       rx_bytes: 16010
       tx_bytes: 12451
       lbrx_bytes: 1148
       lbrx_packets: 12

After:

  # ethtool -S ens5 | grep -E "x_(bytes|packets)"
       rx_packets: 748
       tx_packets: 304
       rx_bytes: 81513
       tx_bytes: 33698
       lbrx_packets: 97
       lbtx_packets: 109
       lbrx_bytes: 12090
       lbtx_bytes: 12401
Quoted 2 lines
#4 lore raw

RE: [Intel-wired-lan] [PATCH v2 iwl-next 1/2] igbvf: add lbtx_packets and lbtx_bytes to ethtool statistics

Quoted 47 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Simon Horman
Sent: Wednesday, August 27, 2025 2:27 PM
To: Kohei Enju <[email protected]>
Cc: [email protected]; [email protected]; linux- [email protected]; Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; [email protected]; Paul Menzel <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH v2 iwl-next 1/2] igbvf: add lbtx_packets and lbtx_bytes to ethtool statistics

Quoted 31 lines · Kohei Enju

Currently ethtool shows lbrx_packets and lbrx_bytes (Good RX Packets/Octets loopback Count), but doesn't show the TX-side equivalents (lbtx_packets and lbtx_bytes). Add visibility of those missing statistics by adding them to ethtool statistics.

In addition, the order of lbrx_bytes and lbrx_packets is not consistent with non-loopback statistics (rx_packets, rx_bytes). Therefore, align the order by swapping positions of lbrx_bytes and lbrx_packets.

Tested on Intel Corporation I350 Gigabit Network Connection.

Before:

  # ethtool -S ens5 | grep -E "x_(bytes|packets)"
       rx_packets: 135
       tx_packets: 106
       rx_bytes: 16010
       tx_bytes: 12451
       lbrx_bytes: 1148
       lbrx_packets: 12

After:

  # ethtool -S ens5 | grep -E "x_(bytes|packets)"
       rx_packets: 748
       tx_packets: 304
       rx_bytes: 81513
       tx_bytes: 33698
       lbrx_packets: 97
       lbtx_packets: 109
       lbrx_bytes: 12090
       lbtx_bytes: 12401
Quoted 4 lines
Quoted 2 lines
author
#5 lore raw

PATCH v2 2/2 igbvf: remove redundant counter rx_long_byte_count from ethtool statistics

In reply to Kohei Enju

rx_long_byte_count shows the value of the GORC (Good Octets Received Count) register. However, the register value is already shown as rx_bytes and they always show the same value.

Remove rx_long_byte_count as the Intel ethernet driver e1000e did in commit 0a939912cf9c ("e1000e: cleanup redundant statistics counter").

Tested on Intel Corporation I350 Gigabit Network Connection.

---
 drivers/net/ethernet/intel/igbvf/ethtool.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/intel/igbvf/ethtool.c +0 -1
index c6defc495f13..9c08ebfad804 100644
@@ -36,7 +36,6 @@ static const struct igbvf_stats igbvf_gstrings_stats[] = {
 	{ "lbtx_bytes", IGBVF_STAT(stats.gotlbc, stats.base_gotlbc) },
 	{ "tx_restart_queue", IGBVF_STAT(restart_queue, zero_base) },
 	{ "tx_timeout_count", IGBVF_STAT(tx_timeout_count, zero_base) },
-	{ "rx_long_byte_count", IGBVF_STAT(stats.gorc, stats.base_gorc) },
 	{ "rx_csum_offload_good", IGBVF_STAT(hw_csum_good, zero_base) },
 	{ "rx_csum_offload_errors", IGBVF_STAT(hw_csum_err, zero_base) },
 	{ "rx_header_split", IGBVF_STAT(rx_hdr_split, zero_base) },
Signature · 1 line
2.48.1
Reviewed-by on v2 2/2
#6 lore raw

RE: [Intel-wired-lan] [PATCH v2 iwl-next 2/2] igbvf: remove redundant counter rx_long_byte_count from ethtool statistics

Quoted 21 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Kohei Enju
Sent: Monday, August 18, 2025 5:18 PM
To: [email protected]; [email protected]; linux- [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; [email protected]; Kohei Enju <[email protected]>; Paul Menzel <[email protected]>
Subject: [Intel-wired-lan] [PATCH v2 iwl-next 2/2] igbvf: remove redundant counter rx_long_byte_count from ethtool statistics

rx_long_byte_count shows the value of the GORC (Good Octets Received Count) register. However, the register value is already shown as rx_bytes and they always show the same value.

Quoted 7 lines

Remove rx_long_byte_count as the Intel ethernet driver e1000e did in commit 0a939912cf9c ("e1000e: cleanup redundant statistics counter").

Tested on Intel Corporation I350 Gigabit Network Connection.

Quoted 24 lines
---
 drivers/net/ethernet/intel/igbvf/ethtool.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/intel/igbvf/ethtool.c +0 -1
index c6defc495f13..9c08ebfad804 100644
@@ -36,7 +36,6 @@ static const struct igbvf_stats
 igbvf_gstrings_stats[] = {
 	{ "lbtx_bytes", IGBVF_STAT(stats.gotlbc, stats.base_gotlbc) },
 	{ "tx_restart_queue", IGBVF_STAT(restart_queue, zero_base) },
 	{ "tx_timeout_count", IGBVF_STAT(tx_timeout_count, zero_base)
 },
-	{ "rx_long_byte_count", IGBVF_STAT(stats.gorc, stats.base_gorc)
 },

{ "rx_csum_offload_good", IGBVF_STAT(hw_csum_good, zero_base)
},
{ "rx_csum_offload_errors", IGBVF_STAT(hw_csum_err, zero_base)
},
{ "rx_header_split", IGBVF_STAT(rx_hdr_split, zero_base) },
--
2.48.1

reviewer Reviewed-by on v2 2/2
#7 lore raw

Re: [PATCH v2 iwl-next 2/2] igbvf: remove redundant counter rx_long_byte_count from ethtool statistics

In reply to Kohei Enju
Quoted 11 lines · Kohei Enju

rx_long_byte_count shows the value of the GORC (Good Octets Received Count) register. However, the register value is already shown as rx_bytes and they always show the same value.

Remove rx_long_byte_count as the Intel ethernet driver e1000e did in commit 0a939912cf9c ("e1000e: cleanup redundant statistics counter").

Tested on Intel Corporation I350 Gigabit Network Connection.

Tested-by on the v2 series
#8 lore raw
In reply to Kohei Enju
Quoted 35 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Kohei Enju
Sent: Monday, August 18, 2025 5:18 PM
To: [email protected]; [email protected]; linux- [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; [email protected]; Kohei Enju <[email protected]>
Subject: [Intel-wired-lan] [PATCH v2 iwl-next 0/2] igbvf: ethtool statistics improvements

This series contains:
1. Add missing lbtx_packets and lbtx_bytes counters that are available in hardware but not exposed via ethtool 2. Remove rx_long_byte_count counter that shows the same value as rx_bytes

Tested on Intel Corporation I350 Gigabit Network Connection.

Changes:
v1: https://lore.kernel.org/intel-wired-lan/20250813075206.70114-1-
[email protected]/
v2:
- Remove Tested-by: tag
- Add Reviewed-by: tag
- s/duplicated/redundant/ in commit message of the 2/2 patch

Kohei Enju (2):
igbvf: add lbtx_packets and lbtx_bytes to ethtool statistics
igbvf: remove redundant counter rx_long_byte_count from ethtool
statistics

Quoted 5 lines
 drivers/net/ethernet/intel/igbvf/ethtool.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--
2.48.1