Re: [PATCH net] net: thunderbolt: Count delivered packets in rx_packets and rx_bytes

From
Mika Westerberg <mika.westerberg@linux.intel.com>
Date
2026-08-19 06:08:39
Also in
lkml
Reply to
Fan Ye via B4 Relay, 2026-08-15
On Sat, Aug 15, 2026 at 10:21:52AM +0000, Fan Ye via B4 Relay wrote:
From: Fan Ye <redacted>

tbnet_poll() increments rx_packets once per received frame because that is
the NAPI work unit, and then adds the same number to stats.rx_packets. An
skb is handed to the stack only when the last frame of a packet arrives,
so once the MTU exceeds TBNET_MAX_PAYLOAD_SIZE the statistic reports
frames. tx_packets is bumped once per skb, so the two ends of a link
disagree: at MTU 65330 the receiver reports 16 times the packets its
sender sent.

rx_bytes has the matching problem: frames of a packet that is later
dropped mid-assembly are already accounted, so it does not correspond to
rx_packets as documented. Account for both where the packet is completed,
and leave the NAPI work counter alone.

Fixes: e69b6c02b4c3 ("net: Add support for networking over Thunderbolt cable")
Assisted-by: Claude:claude-opus-5
Signed-off-by: Fan Ye <redacted>
Acked-by: Mika Westerberg <westeri@kernel.org>
Thread (4 messages) 4 messages, 4 authors, last reply 2026-08-20
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help