HomeFreeBSD

iflib: Implement tx desc reclaim threshold

Description

iflib: Implement tx desc reclaim threshold

On some iflib drivers, the txd reclaim routine can be fairly expensive
at high packet rates. Iflib was designed with the intent of only
reclaiming tx descriptors above a configurable threshold, but this
logic was left unimplemented.

This change:

  • implements 2 new knobs, iflib.tx_reclaim_thresh and iflib.tx_reclaim_ticks.
  • moves tx reclaim thresh from the if_shared_ctx and into the iflib_ctx as drivers don't need to see it, and it needs to be changed, so it can't be const
  • tx_reclaim_thresh and ticks are replicated into the txq to improve cache locality of data accessed in the hot path
    • ticks is used rather than more expensive timekeeping mechanism so as to keep things simple and cheap

This change substantially improves packet rates on bnxt. It has been
tested on bxnt and ixl

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D52561
Reviewed by: markj (initial version)

Details

Provenance
gallatinAuthored on Oct 1 2025, 10:43 PM
Reviewer
markj
Differential Revision
D52561: iflib: Implement tx desc reclaim threshold
Parents
rGd0c8a0b3e6fc: tests/netinet: extend IPv4 multicast testing framework
Branches
Unknown
Tags
Unknown