Skip to contentSkip to conversation

i40e: implement per-queue stats

PATCH In review Paolo Abeni 5 participants 10 messages Apr 8 – Apr 14

Subsystems (3)
lore
Share & tools
lore

Paolo Abeni

author maintainer
#0 lore raw

cover i40e: implement per-queue stats

The i40e driver already collects some per queue statistics, but does not expose them to the user-space using the standard interface.

Implement the stat_ops callbacks and extends the already collected info with basic GSO counters. Overall this allows passing the kernel NIC drivers TSO test cases.

Paolo Abeni (2):
i40e: implement basic per-queue stats
i40e: keep track of per queue gso counters.

 drivers/net/ethernet/intel/i40e/i40e.h        |   9 ++
 drivers/net/ethernet/intel/i40e/i40e_main.c   | 144 ++++++++++++++++++
 drivers/net/ethernet/intel/i40e/i40e_txrx.c   |   8 +-
 drivers/net/ethernet/intel/i40e/i40e_txrx.h   |   2 +
 .../ethernet/intel/i40e/i40e_txrx_common.h    |   6 +-
 drivers/net/ethernet/intel/i40e/i40e_xsk.c    |   2 +-
 6 files changed, 168 insertions(+), 3 deletions(-)
Signature · 1 line
2.53.0
author maintainer
#1 lore raw

PATCH 1/2 i40e: implement basic per-queue stats

Only expose the counters currently available (bytes, packets); add account for base stats to deal with ring clear.

---
 drivers/net/ethernet/intel/i40e/i40e.h      |   7 ++
 drivers/net/ethernet/intel/i40e/i40e_main.c | 133 ++++++++++++++++++++
 2 files changed, 140 insertions(+)
drivers/net/ethernet/intel/i40e/i40e.h +7 -0
index dcb50c2e1aa2..fe642c464e9c 100644
@@ -836,16 +836,23 @@ struct i40e_vsi {
 	struct i40e_eth_stats eth_stats;
 	struct i40e_eth_stats eth_stats_offsets;
 	u64 tx_restart;
+	u64 tx_restart_base;
 	u64 tx_busy;
+	u64 tx_busy_base;
 	u64 tx_linearize;
 	u64 tx_force_wb;
 	u64 tx_stopped;
+	u64 tx_stopped_base;
+	u64 tx_bytes;
+	u64 tx_packets;
 	u64 rx_buf_failed;
 	u64 rx_page_failed;
 	u64 rx_page_reuse;
 	u64 rx_page_alloc;
 	u64 rx_page_waive;
 	u64 rx_page_busy;
+	u64 rx_bytes;
+	u64 rx_packets;
 
 	/* These are containers of ring pointers, allocated at run-time */
 	struct i40e_ring **rx_rings;
drivers/net/ethernet/intel/i40e/i40e_main.c +133 -0

163 lines not on this page · raw message

Signature · 1 line
2.53.0
#2 lore raw

RE: [Intel-wired-lan] [PATCH iwl-next 1/2] i40e: implement basic per-queue stats

Quoted 37 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Paolo Abeni
Sent: Wednesday, April 8, 2026 1:44 PM
To: [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]>; Alexei Starovoitov <[email protected]>; Daniel Borkmann <[email protected]>; Jesper Dangaard Brouer <[email protected]>; John Fastabend <[email protected]>; Stanislav Fomichev <[email protected]>; [email protected]
Subject: [Intel-wired-lan] [PATCH iwl-next 1/2] i40e: implement basic per-queue stats

Only expose the counters currently available (bytes, packets); add account for base stats to deal with ring clear.

---
 drivers/net/ethernet/intel/i40e/i40e.h      |   7 ++
 drivers/net/ethernet/intel/i40e/i40e_main.c | 133
++++++++++++++++++++
 2 files changed, 140 insertions(+)
drivers/net/ethernet/intel/i40e/i40e.h +0 -0
index dcb50c2e1aa2..fe642c464e9c 100644
@@ -836,16 +836,23 @@ struct i40e_vsi {
 	struct i40e_eth_stats eth_stats;
 	struct i40e_eth_stats eth_stats_offsets;
 	u64 tx_restart;

...

Quoted 16 lines

+static void i40e_zero_tx_ring_stats(struct netdev_queue_stats_tx *tx) {

drivers/net/ethernet/intel/i40e/i40e.h +14 -0
+	tx->bytes = 0;
+	tx->packets = 0;
+	tx->stop = 0;
+	tx->wake = 0;
+	tx->hw_drops = 0;
+}
+
+static void i40e_add_tx_ring_stats(struct i40e_ring *tx_ring,
+				   struct netdev_queue_stats_tx *tx) {
+	u64 bytes, packets;
+	unsigned int start;
+
+	do {
+		start = u64_stats_fetch_begin(&tx_ring->syncp);

drivers/net/ethernet/intel/i40e/i40e.h

Quoted 10 lines
drivers/net/ethernet/intel/i40e/i40e.h +10 -0
+		bytes = tx_ring->stats.bytes;
+		packets = tx_ring->stats.packets;
+	} while (u64_stats_fetch_retry(&tx_ring->syncp, start));
+
+	tx->bytes += bytes;
+	tx->packets += packets;
+
+	tx->stop += tx_ring->tx_stats.tx_stopped;
+	tx->wake += tx_ring->tx_stats.restart_queue;
+	tx->hw_drops += tx_ring->tx_stats.tx_busy; }

Why the reads are outside the seqlock region? On 32-bit kernels, unprotected u64 reads can tear IMHO

Quoted 3 lines
drivers/net/ethernet/intel/i40e/i40e.h +3 -0
+
+static void i40e_get_queue_stats_tx(struct net_device *dev, int idx,
+				    struct netdev_queue_stats_tx *tx) {

...

Quoted 5 lines
drivers/net/ethernet/intel/i40e/i40e.h +0 -1
 	netdev->netdev_ops = &i40e_netdev_ops;
 	netdev->watchdog_timeo = 5 * HZ;
 	i40e_set_ethtool_ops(netdev);
--

2.53.0

author maintainer
#3 lore raw

Re: [Intel-wired-lan] [PATCH iwl-next 1/2] i40e: implement basic per-queue stats

Quoted 58 lines · Aleksandr
Quoted 35 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Paolo Abeni
Sent: Wednesday, April 8, 2026 1:44 PM
To: [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]>; Alexei Starovoitov <[email protected]>; Daniel Borkmann <[email protected]>; Jesper Dangaard Brouer <[email protected]>; John Fastabend <[email protected]>; Stanislav Fomichev <[email protected]>; [email protected]
Subject: [Intel-wired-lan] [PATCH iwl-next 1/2] i40e: implement basic per-queue stats

Only expose the counters currently available (bytes, packets); add account for base stats to deal with ring clear.

---
 drivers/net/ethernet/intel/i40e/i40e.h      |   7 ++
 drivers/net/ethernet/intel/i40e/i40e_main.c | 133
++++++++++++++++++++
 2 files changed, 140 insertions(+)
drivers/net/ethernet/intel/i40e/i40e.h +0 -0
index dcb50c2e1aa2..fe642c464e9c 100644
@@ -836,16 +836,23 @@ struct i40e_vsi {
 	struct i40e_eth_stats eth_stats;
 	struct i40e_eth_stats eth_stats_offsets;
 	u64 tx_restart;

...

Quoted 20 lines

+static void i40e_zero_tx_ring_stats(struct netdev_queue_stats_tx *tx) {

drivers/net/ethernet/intel/i40e/i40e.h +18 -0
+	tx->bytes = 0;
+	tx->packets = 0;
+	tx->stop = 0;
+	tx->wake = 0;
+	tx->hw_drops = 0;
+}
+
+static void i40e_add_tx_ring_stats(struct i40e_ring *tx_ring,
+				   struct netdev_queue_stats_tx *tx) {
+	u64 bytes, packets;
+	unsigned int start;
+
+	do {
+		start = u64_stats_fetch_begin(&tx_ring->syncp);
+		bytes = tx_ring->stats.bytes;
+		packets = tx_ring->stats.packets;
+	} while (u64_stats_fetch_retry(&tx_ring->syncp, start));
+
Quoted 8 lines

drivers/net/ethernet/intel/i40e/i40e.h

Quoted 6 lines
drivers/net/ethernet/intel/i40e/i40e.h +6 -0
+	tx->bytes += bytes;
+	tx->packets += packets;
+
+	tx->stop += tx_ring->tx_stats.tx_stopped;
+	tx->wake += tx_ring->tx_stats.restart_queue;
+	tx->hw_drops += tx_ring->tx_stats.tx_busy; }

Why the reads are outside the seqlock region? On 32-bit kernels, unprotected u64 reads can tear IMHO

Currently there is no seqlock on the write side; to keep the series small I preferred avoid fixing the pre-existing issue. In any case I think moving stop, wake, hw_drops (and others) under seqlock protection is an orthogonal change.

/P

#4 lore raw

Re: [Intel-wired-lan] [PATCH iwl-next 1/2] i40e: implement basic per-queue stats

Quoted 59 lines · Paolo Abeni
Quoted 58 lines · Aleksandr
Quoted 35 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Paolo Abeni
Sent: Wednesday, April 8, 2026 1:44 PM
To: [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]>; Alexei Starovoitov <[email protected]>; Daniel Borkmann <[email protected]>; Jesper Dangaard Brouer <[email protected]>; John Fastabend <[email protected]>; Stanislav Fomichev <[email protected]>; [email protected]
Subject: [Intel-wired-lan] [PATCH iwl-next 1/2] i40e: implement basic per-queue stats

Only expose the counters currently available (bytes, packets); add account for base stats to deal with ring clear.

---
 drivers/net/ethernet/intel/i40e/i40e.h      |   7 ++
 drivers/net/ethernet/intel/i40e/i40e_main.c | 133
++++++++++++++++++++
 2 files changed, 140 insertions(+)
drivers/net/ethernet/intel/i40e/i40e.h +0 -0
index dcb50c2e1aa2..fe642c464e9c 100644
@@ -836,16 +836,23 @@ struct i40e_vsi {
 	struct i40e_eth_stats eth_stats;
 	struct i40e_eth_stats eth_stats_offsets;
 	u64 tx_restart;

...

Quoted 20 lines

+static void i40e_zero_tx_ring_stats(struct netdev_queue_stats_tx *tx) {

drivers/net/ethernet/intel/i40e/i40e.h +18 -0
+	tx->bytes = 0;
+	tx->packets = 0;
+	tx->stop = 0;
+	tx->wake = 0;
+	tx->hw_drops = 0;
+}
+
+static void i40e_add_tx_ring_stats(struct i40e_ring *tx_ring,
+				   struct netdev_queue_stats_tx *tx) {
+	u64 bytes, packets;
+	unsigned int start;
+
+	do {
+		start = u64_stats_fetch_begin(&tx_ring->syncp);
+		bytes = tx_ring->stats.bytes;
+		packets = tx_ring->stats.packets;
+	} while (u64_stats_fetch_retry(&tx_ring->syncp, start));
+
Quoted 9 lines
Quoted 8 lines

drivers/net/ethernet/intel/i40e/i40e.h

Quoted 6 lines
drivers/net/ethernet/intel/i40e/i40e.h +6 -0
+	tx->bytes += bytes;
+	tx->packets += packets;
+
+	tx->stop += tx_ring->tx_stats.tx_stopped;
+	tx->wake += tx_ring->tx_stats.restart_queue;
+	tx->hw_drops += tx_ring->tx_stats.tx_busy; }

Why the reads are outside the seqlock region? On 32-bit kernels, unprotected u64 reads can tear IMHO

Paolo is correct that just moving these into the do/while loop is useless, since the increments aren't protected properly.

Quoted 6 lines

Currently there is no seqlock on the write side; to keep the series small I preferred avoid fixing the pre-existing issue. In any case I think moving stop, wake, hw_drops (and others) under seqlock protection is an orthogonal change.

/P

I ended up doing some work on ice to fix a lot of similar issues a few months ago.. The intel drivers weren't using u64_stats_t, and several error/debug counters were not being handled appropriately.

I'd personally prefer fixing existing issues before we compound them by adding even more incorrect code. Even on 64bit systems we need to use READ_ONCE/WRITE_ONCE or local64_t, which the u64_stats_t type uses internally.

I can understand the desire to limit scope of work, and the issues may feel "minor" but ultimately I'd rather not see us continue making the problem bigger instead of fixing it.

However.. if other maintainers feel strongly that the additions are acceptable despite being incorrect w.r.t. the stats logic, I suppose we can continue this and have someone from Intel look into cleaning up the mess like I did for ice.

It looks like the series has some other requested changes either way though.

maintainer
#5 lore raw

Re: [PATCH iwl-next 1/2] i40e: implement basic per-queue stats

In reply to Paolo Abeni
Quoted 9 lines · On Wed, 8 Apr 2026 13:43:45 +0200 Paolo Abeni wrote:
drivers/net/ethernet/intel/i40e/i40e_main.c +9 -0
+static void i40e_get_queue_stats_tx(struct net_device *dev, int idx,
+				    struct netdev_queue_stats_tx *tx)
+{
+	struct i40e_netdev_priv *np = netdev_priv(dev);
+	struct i40e_vsi *vsi = np->vsi;
+	struct i40e_ring *tx_ring;
+
+	rcu_read_lock();
+	tx_ring = READ_ONCE(vsi->tx_rings[idx]);

drivers/net/ethernet/intel/i40e/i40e_main.c static const struct net_device_ops i40e_netdev_ops = { · line 13730

Quoted 10 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +10 -0
+	if (!tx_ring)
+		goto out;
+
+	i40e_zero_tx_ring_stats(tx);
+	i40e_add_tx_ring_stats(tx_ring, tx);
+
+	if (i40e_enabled_xdp_vsi(vsi)) {
+		tx_ring = READ_ONCE(vsi->xdp_rings[idx]);
+		if (tx_ring)
+			i40e_add_tx_ring_stats(tx_ring, tx);

If XDP Tx happens on dedicated queues it should be added to base, not to the stats of the "stack" queue. This is in anticipation of XDP being its own queue type one day, we'll then isolate those out of base. Ripping the out of TX could cause regressions.

Quoted 22 lines
drivers/net/ethernet/intel/i40e/i40e_main.c +22 -0
+	}
+
+out:
+	rcu_read_unlock();
+}
+
+static void i40e_get_base_stats(struct net_device *dev,
+				struct netdev_queue_stats_rx *rx,
+				struct netdev_queue_stats_tx *tx)
+{
+	struct i40e_netdev_priv *np = netdev_priv(dev);
+	struct i40e_vsi *vsi = np->vsi;
+
+	tx->bytes = vsi->tx_bytes;
+	tx->packets = vsi->tx_packets;
+	tx->wake = vsi->tx_restart_base;
+	tx->stop = vsi->tx_stopped_base;
+	tx->hw_drops = vsi->tx_busy_base;
+
+	rx->bytes = vsi->rx_bytes;
+	rx->packets = vsi->rx_packets;
+}
author maintainer
#6 lore raw

PATCH 2/2 i40e: keep track of per queue gso counters.

In reply to Paolo Abeni

Track the number of GSO and wire packets transmitted and expose the counters via the queue stats.

---
 drivers/net/ethernet/intel/i40e/i40e.h             |  2 ++
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 13 ++++++++++++-
 drivers/net/ethernet/intel/i40e/i40e_txrx.c        |  8 +++++++-
 drivers/net/ethernet/intel/i40e/i40e_txrx.h        |  2 ++
 drivers/net/ethernet/intel/i40e/i40e_txrx_common.h |  6 +++++-
 drivers/net/ethernet/intel/i40e/i40e_xsk.c         |  2 +-
 6 files changed, 29 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +2 -0
index fe642c464e9c..4a88c7d69f61 100644
@@ -845,6 +845,8 @@ struct i40e_vsi {
 	u64 tx_stopped_base;
 	u64 tx_bytes;
 	u64 tx_packets;
+	u64 tx_gso_packets;
+	u64 tx_gso_wire_packets;
 	u64 rx_buf_failed;
 	u64 rx_page_failed;
 	u64 rx_page_reuse;
drivers/net/ethernet/intel/i40e/i40e_main.c +12 -1
index 0d0b3619ec56..7c2af738ccc5 100644
@@ -11695,6 +11695,8 @@ static void i40e_vsi_aggregate_tx_counters(struct i40e_vsi *vsi,
 
 	vsi->tx_bytes += tx_ring->stats.bytes;
 	vsi->tx_packets += tx_ring->stats.packets;
+	vsi->tx_gso_packets += tx_ring->tx_stats.tx_gso_packets;
+	vsi->tx_gso_wire_packets += tx_ring->tx_stats.tx_gso_wire_packets;
 }
 
 static void i40e_vsi_aggregate_rx_counters(struct i40e_vsi *vsi,
@@ -13684,6 +13686,8 @@ static void i40e_zero_tx_ring_stats(struct netdev_queue_stats_tx *tx)
 {
 	tx->bytes = 0;
 	tx->packets = 0;
+	tx->hw_gso_packets = 0;
+	tx->hw_gso_wire_packets = 0;
 	tx->stop = 0;
 	tx->wake = 0;
 	tx->hw_drops = 0;
@@ -13692,17 +13696,21 @@ static void i40e_zero_tx_ring_stats(struct netdev_queue_stats_tx *tx)
 static void i40e_add_tx_ring_stats(struct i40e_ring *tx_ring,
 				   struct netdev_queue_stats_tx *tx)
 {
-	u64 bytes, packets;
+	u64 bytes, packets, gso_packets, gso_wire_packets;
 	unsigned int start;
 
 	do {
 		start = u64_stats_fetch_begin(&tx_ring->syncp);
 		bytes = tx_ring->stats.bytes;
 		packets = tx_ring->stats.packets;
+		gso_packets = tx_ring->tx_stats.tx_gso_packets;
+		gso_wire_packets = tx_ring->tx_stats.tx_gso_wire_packets;
 	} while (u64_stats_fetch_retry(&tx_ring->syncp, start));
 
 	tx->bytes += bytes;
 	tx->packets += packets;
+	tx->hw_gso_packets += gso_packets;
+	tx->hw_gso_wire_packets += gso_wire_packets;
 
 	tx->stop += tx_ring->tx_stats.tx_stopped;
 	tx->wake += tx_ring->tx_stats.restart_queue;
@@ -13743,6 +13751,9 @@ static void i40e_get_base_stats(struct net_device *dev,
 
 	tx->bytes = vsi->tx_bytes;
 	tx->packets = vsi->tx_packets;
+	tx->hw_gso_packets = vsi->tx_gso_packets;
+	tx->hw_gso_wire_packets = vsi->tx_gso_wire_packets;
+
 	tx->wake = vsi->tx_restart_base;
 	tx->stop = vsi->tx_stopped_base;
 	tx->hw_drops = vsi->tx_busy_base;
drivers/net/ethernet/intel/i40e/i40e_txrx.c +7 -1
index 894f2d06d39d..ec61cc43ae39 100644
@@ -928,6 +928,7 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,
 			      struct i40e_ring *tx_ring, int napi_budget,
 			      unsigned int *tx_cleaned)
 {
+	unsigned int total_gso_packets = 0, total_gso_wire_packets = 0;
 	int i = tx_ring->next_to_clean;
 	struct i40e_tx_buffer *tx_buf;
 	struct i40e_tx_desc *tx_head;
@@ -959,6 +960,10 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,
 		/* update the statistics for this packet */
 		total_bytes += tx_buf->bytecount;
 		total_packets += tx_buf->gso_segs;
+		if (tx_buf->gso_segs > 1) {
+			total_gso_packets++;
+			total_gso_wire_packets += tx_buf->gso_segs;
+		}
 
 		/* free the skb/XDP data */
 		if (ring_is_xdp(tx_ring))
@@ -1018,7 +1023,8 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,
 
 	i += tx_ring->count;
 	tx_ring->next_to_clean = i;
-	i40e_update_tx_stats(tx_ring, total_packets, total_bytes);
+	i40e_update_tx_stats(tx_ring, total_packets, total_bytes,
+			     total_gso_packets, total_gso_wire_packets);
 	i40e_arm_wb(tx_ring, vsi, budget);
 
 	if (ring_is_xdp(tx_ring))
drivers/net/ethernet/intel/i40e/i40e_txrx.h +2 -0
index 1e5fd63d47f4..15c608378467 100644
@@ -295,6 +295,8 @@ struct i40e_tx_queue_stats {
 	u64 tx_linearize;
 	u64 tx_force_wb;
 	u64 tx_stopped;
+	u64 tx_gso_packets;
+	u64 tx_gso_wire_packets;
 	int prev_pkt_ctr;
 };
 
drivers/net/ethernet/intel/i40e/i40e_txrx_common.h +5 -1
index e26807fd2123..24220594ff1a 100644
@@ -45,11 +45,15 @@ static inline __le64 build_ctob(u32 td_cmd, u32 td_offset, unsigned int size,
  **/
 static inline void i40e_update_tx_stats(struct i40e_ring *tx_ring,
 					unsigned int total_packets,
-					unsigned int total_bytes)
+					unsigned int total_bytes,
+					unsigned int total_gso,
+					unsigned int total_gso_wire)
 {
 	u64_stats_update_begin(&tx_ring->syncp);
 	tx_ring->stats.bytes += total_bytes;
 	tx_ring->stats.packets += total_packets;
+	tx_ring->tx_stats.tx_gso_packets += total_gso;
+	tx_ring->tx_stats.tx_gso_wire_packets += total_gso_wire;
 	u64_stats_update_end(&tx_ring->syncp);
 	tx_ring->q_vector->tx.total_bytes += total_bytes;
 	tx_ring->q_vector->tx.total_packets += total_packets;
drivers/net/ethernet/intel/i40e/i40e_xsk.c +1 -1
index 9f47388eaba5..c2a465416a33 100644
@@ -599,7 +599,7 @@ static bool i40e_xmit_zc(struct i40e_ring *xdp_ring, unsigned int budget)
 	i40e_set_rs_bit(xdp_ring);
 	i40e_xdp_ring_update_tail(xdp_ring);
 
-	i40e_update_tx_stats(xdp_ring, nb_pkts, total_bytes);
+	i40e_update_tx_stats(xdp_ring, nb_pkts, total_bytes, 0, 0);
 
 	return nb_pkts < budget;
 }
Signature · 1 line
2.53.0
Reviewed-by on v1 2/2
#7 lore raw

RE: [Intel-wired-lan] [PATCH iwl-next 2/2] i40e: keep track of per queue gso counters.

Quoted 18 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Paolo Abeni
Sent: Wednesday, April 8, 2026 1:44 PM
To: [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]>; Alexei Starovoitov <[email protected]>; Daniel Borkmann <[email protected]>; Jesper Dangaard Brouer <[email protected]>; John Fastabend <[email protected]>; Stanislav Fomichev <[email protected]>; [email protected]
Subject: [Intel-wired-lan] [PATCH iwl-next 2/2] i40e: keep track of per queue gso counters.

Please remove trailing '.'

Quoted 22 lines

Track the number of GSO and wire packets transmitted and expose the counters via the queue stats.

---
 drivers/net/ethernet/intel/i40e/i40e.h             |  2 ++
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 13 ++++++++++++-
 drivers/net/ethernet/intel/i40e/i40e_txrx.c        |  8 +++++++-
 drivers/net/ethernet/intel/i40e/i40e_txrx.h        |  2 ++
 drivers/net/ethernet/intel/i40e/i40e_txrx_common.h |  6 +++++-
 drivers/net/ethernet/intel/i40e/i40e_xsk.c         |  2 +-
 6 files changed, 29 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +0 -0
index fe642c464e9c..4a88c7d69f61 100644
@@ -845,6 +845,8 @@ struct i40e_vsi {
 	u64 tx_stopped_base;
 	u64 tx_bytes;
 	u64 tx_packets;

...

Quoted 5 lines

return nb_pkts < budget;
}
--
2.53.0

#8 lore raw
In reply to Paolo Abeni

Dear Paolo,

Thank you for your patches.

Am 08.04.26 um 13:43 schrieb Paolo Abeni:

Quoted 4 lines

The i40e driver already collects some per queue statistics, but does not expose them to the user-space using the standard interface.

Implement the stat_ops callbacks and extends the already collected info

s/extends/extend/

Quoted 2 lines

with basic GSO counters. Overall this allows passing the kernel NIC drivers TSO test cases.

It’d be great, if you added the commands to show the stats, and to run the test cases.

Quoted 3 lines

Paolo Abeni (2):
i40e: implement basic per-queue stats
i40e: keep track of per queue gso counters.

No period needed at the end of the summary/title.

Quoted 8 lines
  drivers/net/ethernet/intel/i40e/i40e.h        |   9 ++
  drivers/net/ethernet/intel/i40e/i40e_main.c   | 144 ++++++++++++++++++
  drivers/net/ethernet/intel/i40e/i40e_txrx.c   |   8 +-
  drivers/net/ethernet/intel/i40e/i40e_txrx.h   |   2 +
  .../ethernet/intel/i40e/i40e_txrx_common.h    |   6 +-
  drivers/net/ethernet/intel/i40e/i40e_xsk.c    |   2 +-
  6 files changed, 168 insertions(+), 3 deletions(-)

Kind regards,

Paul

author maintainer
#9 lore raw
Quoted 10 lines · Paul Menzel

Dear Paolo,

Thank you for your patches.

Am 08.04.26 um 13:43 schrieb Paolo Abeni:

Quoted 4 lines

The i40e driver already collects some per queue statistics, but does not expose them to the user-space using the standard interface.

Implement the stat_ops callbacks and extends the already collected info

Quoted 7 lines

s/extends/extend/

Quoted 2 lines

with basic GSO counters. Overall this allows passing the kernel NIC drivers TSO test cases.

It’d be great, if you added the commands to show the stats, and to run the test cases.

I'll add some "show stats" examples in the v2 cover, hopefully fixing the typos while at it.

How to run NID driver H/W self-tests is IMHO a bit too wide topic to be discussed in the cover letter, but there is already a quite comprehensive readme in the selftests dir:

https://elixir.bootlin.com/linux/v7.0-rc7/source/tools/testing/selftests/drivers/net/README.rst

/P