HomeFreeBSD

epair: Simplify the transmit path and address lost wakeups

Description

epair: Simplify the transmit path and address lost wakeups

epairs currently shuttle all transmitted packets through a single global
taskqueue thread. To hand packets over to the taskqueue thread, each
epair maintains a pair of ring buffers and a lockless scheme for
notifying the thread of pending work. The implementation can lead to
lost wakeups, causing to-be-transmitted packets to end up stuck in the
queue.

Rather than extending the existing scheme, simply replace it with a
linked list protected by a mutex, and use the mutex to synchronize
wakeups of the taskqueue thread. This appears to give equivalent or
better throughput with >= 16 producer threads and eliminates the lost
wakeups.

Approved by: re (cperciva)
Reviewed by: kp
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D38843

(cherry picked from commit df7bbd8c354a907d2c2f85a6e18f356f76458f57)
(cherry picked from commit 762ad964ee346cffdbf3eaa6ff87fa5b32d30738)

Details

Provenance
markjAuthored on Mar 1 2023, 8:21 PM
Reviewer
kp
Differential Revision
D38843: epair: Simplify the transmit path and reduce tail latency
Parents
rG6b488550ee57: epair: Avoid loading m_flags into a short
Branches
Unknown
Tags
Unknown