HomeFreeBSD

ena: Adjust ena_[rt]x_cleanup to return bool

Description

ena: Adjust ena_[rt]x_cleanup to return bool

The ena_[rt]x_cleanup functions are limited internally to a maximum
number of packets; this ensures that TX doesn't starve RX (or vice
versa) and also attempts to ensure that we get a chance to refill
the RX buffer ring before the device runs out of buffers and starts
dropping packets.

Historically these functions have returned the number of packets which
they processed which ena_cleanup compares to their respective budgets
to decide whether to reinvoke them. This is unnecessary complication;
since the precise number of packets processed is never used, adjust
the APIs of those functions to return a bool indicating if they want
to be reinvoked (aka if they hit their limits).

Since ena_tx_cleanup now only uses work_done if diagnostics are
enabled (ena_log_io macros to nothing otherwise) eliminate that
variable and pass its value (ENA_TX_BUDGET - budget) to ena_log_io
directly.

No functional change intended; this will simplify a future commit.

Reviewed by: akiyano
Sponsored by: Amazon
MFC after: 6 days
Differential Revision: https://reviews.freebsd.org/D56478

Details

Provenance
cpercivaAuthored on Apr 17 2026, 5:13 PM
Differential Revision
D56478: ena: Adjust ena_[rt]x_cleanup to return bool
Parents
rGf31e6b198faa: speaker(4): move static data to text
Branches
Unknown
Tags
Unknown