aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/send.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-06-16 02:23:42 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-06-16 04:40:16 +0200
commitf8b57d580aeec5ffd5a23eba1ad626e9614e70a4 (patch)
treefb0dca3d99575a4768c9833a00908e330864b277 /src/send.c
parentqueueing: remove useless spinlocks on sc (diff)
downloadwireguard-monolithic-historical-f8b57d580aeec5ffd5a23eba1ad626e9614e70a4.tar.xz
wireguard-monolithic-historical-f8b57d580aeec5ffd5a23eba1ad626e9614e70a4.zip
queueing: re-enable preemption periodically to lower latency
Diffstat (limited to 'src/send.c')
-rw-r--r--src/send.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/send.c b/src/send.c
index 5151466..e97e439 100644
--- a/src/send.c
+++ b/src/send.c
@@ -256,6 +256,12 @@ void packet_encrypt_worker(struct work_struct *work)
}
}
queue_enqueue_per_peer(&PACKET_PEER(first)->tx_queue, first, state);
+
+ /* Don't totally kill scheduling latency by keeping preemption disabled forever. */
+ if (have_simd && need_resched()) {
+ chacha20poly1305_deinit_simd(have_simd);
+ have_simd = chacha20poly1305_init_simd();
+ }
}
chacha20poly1305_deinit_simd(have_simd);
}