aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/data.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-10-02 03:53:24 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2016-10-02 06:24:10 +0200
commit2f05eb3738e47aafc70fa63b4dc0ccd161f5c0b0 (patch)
treefd180890d1a3b6ed2e3567b50e7f7ccfdceb0211 /src/data.c
parentremote-run: reflect recent makefile changes (diff)
downloadwireguard-monolithic-historical-2f05eb3738e47aafc70fa63b4dc0ccd161f5c0b0.tar.xz
wireguard-monolithic-historical-2f05eb3738e47aafc70fa63b4dc0ccd161f5c0b0.zip
send: only avoid parallel path when there aren't inflight jobs
Otherwise we get packet reordering.
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/data.c b/src/data.c
index 5969ca5..fbab31e 100644
--- a/src/data.c
+++ b/src/data.c
@@ -234,7 +234,7 @@ int packet_create_data(struct sk_buff *skb, struct wireguard_peer *peer, void(*c
ctx->keypair = keypair;
#ifdef CONFIG_WIREGUARD_PARALLEL
- if (parallel && cpumask_weight(cpu_online_mask) > 1) {
+ if ((parallel || padata_queue_len(peer->device->parallel_send) > 0) && cpumask_weight(cpu_online_mask) > 1) {
unsigned int cpu = choose_cpu(keypair->remote_index);
ret = start_encryption(peer->device->parallel_send, &ctx->padata, cpu);
if (unlikely(ret < 0))