diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-11-29 18:39:26 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-11-30 06:50:50 +0300 |
commit | 886fcee939adb5e2af92741b90643a59f2b54f97 (patch) | |
tree | 781d38534bf4bf0309a6ce97a514a986d7866308 /drivers/net/wireguard/queueing.h | |
parent | 20ae1d6aa159eb91a9bf09ff92ccaa94dbea92c2 (diff) | |
download | linux-886fcee939adb5e2af92741b90643a59f2b54f97.tar.xz |
wireguard: receive: use ring buffer for incoming handshakes
Apparently the spinlock on incoming_handshake's skb_queue is highly
contended, and a torrent of handshake or cookie packets can bring the
data plane to its knees, simply by virtue of enqueueing the handshake
packets to be processed asynchronously. So, we try switching this to a
ring buffer to hopefully have less lock contention. This alleviates the
problem somewhat, though it still isn't perfect, so future patches will
have to improve this further. However, it at least doesn't completely
diminish the data plane.
Reported-by: Streun Fabio <fstreun@student.ethz.ch>
Reported-by: Joel Wanner <joel.wanner@inf.ethz.ch>
Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/wireguard/queueing.h')
-rw-r--r-- | drivers/net/wireguard/queueing.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireguard/queueing.h b/drivers/net/wireguard/queueing.h index 4ef2944a68bc..e2388107f7fd 100644 --- a/drivers/net/wireguard/queueing.h +++ b/drivers/net/wireguard/queueing.h @@ -23,7 +23,7 @@ struct sk_buff; /* queueing.c APIs: */ int wg_packet_queue_init(struct crypt_queue *queue, work_func_t function, unsigned int len); -void wg_packet_queue_free(struct crypt_queue *queue); +void wg_packet_queue_free(struct crypt_queue *queue, bool purge); struct multicore_worker __percpu * wg_packet_percpu_multicore_worker_alloc(work_func_t function, void *ptr); |