Re: [PATCH net-next v2 1/4] eth: mpnic: count packets, bytes, and drops per ring
From: Sebastian Andrzej Siewior
Date: Fri Oct 16 2026 - 18:10:14 EST
On 2026-10-12 05:04:34 [-0700], Daniel Zahka wrote:
> Keep packet, byte and drop counters on each Tx work, Tx completion, and
> Rx completion queue. Report them to the core via the rtnl_link_stats64
> interface.
>
> Rx completion queues also count errors. Frames the device marked with an
> uncorrectable error are counted as errors, and frames that fail for any
> other reason are counted as drops.
>
> All packets cleaned from the TWQ during mpnic_flush() are counted as
> drops, though completions for some of them may have been DMA'd into
> the completion ring between the time mpnic_poll() last ran and before
> mpnic_wait_all_queues_idle() returns. This is done for code simplicity.
>
> An RCU approach is used because ndo_get_stats64 is not called with the
> instance lock.
Why do you have the two mpnic_base_stats and fold the stats into into
it? My guess would be that on stop the counters are reset and you want
to preserve the stats.
> Signed-off-by: Daniel Zahka <daniel.zahka@xxxxxxxxx>
Sebastian