]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
epair: Simplify the transmit path and address lost wakeups
authorMark Johnston <markj@FreeBSD.org>
Wed, 1 Mar 2023 20:21:30 +0000 (15:21 -0500)
committerMark Johnston <markj@FreeBSD.org>
Mon, 6 Mar 2023 17:49:28 +0000 (12:49 -0500)
commitdf7bbd8c354a907d2c2f85a6e18f356f76458f57
treee6fc899c25e5dfbf82a1328bb59295faf8204c3f
parent48227d1c6db8fceaceebbf8578612302d64ca170
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.

Reviewed by: kp
MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D38843
sys/net/if_epair.c