Thread (19 messages) 19 messages, 6 authors, 3d ago

Re: [PATCH net-next v2 2/4] eth: mpnic: report per-queue stats

flat view

From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-10-20 02:00:36
Also in: bpf, lkml

On Tue, 13 Oct 2026 09:30:02 -0400 Daniel Zahka wrote:
quoted
The counter semantics come from "eth: mpnic: count packets, bytes, and
drops per ring" earlier in this series. This patch is the one that
exposes them as qstats rx-packets and rx-bytes.

The later patch "eth: mpnic: count Rx allocation failures" also counts
skb build failures in alloc_failed. Those packets still stay in packets
and bytes.
So, the question is whether or not rx-packets, reported both to rtnl
stats and qstats, should count drops in the driver. Here, drops are
either running out of shinfo frags, but really just skb allocation
failure. 

The docs for rtnl stats strongly suggest an skb allocation failure
should still be counted for rx-packets.

The docs for qstats imply the opposite. Especially when xdp is not
present, which is the case as of this point. Once xdp is introduced,
though, counting an skb allocation failure in rx-packets becomes
reasonable by the qstats docs, because xdp runs before the point of skb
allocation.

Another option would be reporting rx-packets differently for the two
APIs. I think this is not desirable, and seems to violate what is in
the stats.py selftest.

So, I could either submit a v3, which would just be reverting to v1, or
take the approach here as is.
The rtnl stats and qstats are supposed to behave the same if maintained
by SW. I should have been clearer in the doc but "XDP is considered the
first layer" was supposed to mean - if you reach the point in the driver
where you'd call an XDP prog - its a successful Rx, whether the XDP prog
is actually attached & called, or is NULL & skipped.

I believe the series is good as is.

Acked-by: Jakub Kicinski <kuba@kernel.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help