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 o 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
On ixl, this change interacts poorly with doorbell deferral via txq_max_db_deferred(). On ixl, I observed iflib sending doorbells only every 128 packets once traffic had ramped up, which caused LACP to flap constantly. I'm currently unsure if this is a problem in the patch, or a problem with doorbell deferral. For now, I have disabled doorbell deferral when we use a non-zero tx desc reclaim threshold as a workaround. That allowed a busy server to run for over 48hrs with no flaps using ixl. I would like to understand how doorbell deferral is supposed to work, as it seems to have no backstop timer to force doorbells on mosty-idle links (like my LACP problem)