Page MenuHomeFreeBSD

ena: Adjust ena_[rt]x_cleanup to return bool
ClosedPublic

Authored by cperciva on Apr 17 2026, 7:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 21, 10:20 AM
Unknown Object (File)
Tue, May 19, 7:17 AM
Unknown Object (File)
Mon, May 18, 9:03 AM
Unknown Object (File)
Mon, May 18, 9:00 AM
Unknown Object (File)
Fri, May 15, 2:16 PM
Unknown Object (File)
Fri, May 15, 5:16 AM
Unknown Object (File)
Thu, May 14, 8:29 PM
Unknown Object (File)
Wed, May 13, 12:17 PM
Subscribers

Details

Summary

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.

Sponsored by: Amazon
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable