HomeFreeBSD

ena: Batch RX statistics updates

Description

ena: Batch RX statistics updates

Move per-packet counter_enter/counter_exit pairs out of the RX
processing loop and batch them into a single update after the
loop completes.

Previously, each received packet triggered two separate
counter_enter/counter_exit blocks -- one for bytes and one for
packet count. This commit accumulates totals in local variables
and updates all four counters (ring and hw stats for both packets
and bytes) in a single counter_enter/counter_exit block after the
loop.

Also move the stats update to after the refill and LRO flush
so that the error path (goto update_stats) and the normal path
converge at the same label, avoiding code duplication.

Submitted by: David Arinzon <darinzon@amazon.com>
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D58240

Details

Provenance
darinzon_amazon.comAuthored on Apr 16 2026, 11:22 AM
akiyano_amazon.comCommitted on Jul 16 2026, 6:20 PM
Reviewer
cperciva
Differential Revision
D58240: ena: Batch RX statistics updates
Parents
rGf08def9ed97f: ena: Swap cleanup order
Branches
Unknown
Tags
Unknown