]> 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>
Wed, 15 Mar 2023 13:39:55 +0000 (09:39 -0400)
commit5e49311e0177932e0f0323fd547eedb4e50bbb4d
treee4094968db0fd837c09baee4579649c777fcb4cf
parent6b488550ee57dc09b7d564aa22f9feb61778a89f
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)
sys/net/if_epair.c