When a driver has no interrupt of its own for transmit completions,
iflib_netmap_txsync() arms a 90 us timer each time it leaves frames
unreclaimed, to wake an application that sleeps in poll(2) for room in
the ring. It does this for every txsync, including those of a ring
whose user polls it and has told netmap so. nma_intr_enable(na, 0)
sets NKR_NOINTR on the rings for that, as a VALE port in polling mode
does for its kernel threads. Such a user syncs the ring again by
itself, and the timer costs it a callout_reset() per txsync and a
wakeup of the softclock thread each time the timer expires.
Do not arm the timer for a ring with NKR_NOINTR. The vtnet netmap code
already reads the flag this way and leaves the interrupt of such a
queue off.
Forwarding 14.9 Mpps of 60-byte frames between two X710 ports on an
8-core Atom, with the transmit rings polled and marked this way, took
about 5 % less CPU time without the timer. The context switches per
CPU fell from 32,000 to 23,000 a second, and under a lighter load the
cores were awake for 42 % of the time instead of 75 %.
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")