]> 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, 13 Mar 2023 15:53:16 +0000 (11:53 -0400)
commit762ad964ee346cffdbf3eaa6ff87fa5b32d30738
tree3ae3a83b5d264f88cdd818d3abe3b5fa52c77a61
parentc3bd32f225ec093ba0f7cd7fc1a000b02aad5211
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

(cherry picked from commit df7bbd8c354a907d2c2f85a6e18f356f76458f57)
sys/net/if_epair.c