Re: [PATCH net v2 2/4] net: macb: drop in-flight Tx SKBs on close
From: Jakub Kicinski
Date: Thu Apr 30 2026 - 19:54:11 EST
On Thu, 30 Apr 2026 18:20:01 +0200 Théo Lebrun wrote:
> - In macb_get_stats(), replace:
>
> netdev_stats_to_stats64(nstat, &bp->dev->stats);
>
> by:
>
> for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {
> u64_stats_fetch_begin(...);
> nstat->rx_packets += queue->stats.rx_packets;
> nstat->tx_packets += queue->stats.tx_packets;
you'd probably catch this when doing the real implementation but beware
of updating nstat directly in the fetch loop since the loop may retry
> // ... same for all stats ...
> }
>
> - Also the struct name (struct queue_stats) deserves a driver prefix.
>
> Notice we don't drop tx_dropped from `ethtool -S`. It might be useful to
> get per-queue stats and it doesn't cost much. We need per-queue
> counters anyway, let's keep exposing them.
There's a dedicated API now for exposing pre-queue stats.
Since tx_dropped was always zero we can as well delete it from ethtool
-S and think about adding netdev queue stats in net-next