diff options
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2018-07-05 22:27:29 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-07-08 18:45:41 +0200 |
commit | 5221eceb39a8a4f9bd637ebfa7c0f9c0958e8afa (patch) | |
tree | ce57c568080eec4e989f9ded04ad4b0e5d244b19 /src/queueing.c | |
parent | ca76b1066fc8d61ed63617893257c511b9af020e (diff) |
receive: use NAPI on the receive path
Suggested-by: Jason A. Donenfeld <Jason@zx2c4.com>
[Jason: fixed up the flushing of the rx_queue in peer_remove]
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/queueing.c')
-rw-r--r-- | src/queueing.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/queueing.c b/src/queueing.c index f33395e..c8394fc 100644 --- a/src/queueing.c +++ b/src/queueing.c @@ -28,12 +28,14 @@ int packet_queue_init(struct crypt_queue *queue, work_func_t function, bool mult ret = ptr_ring_init(&queue->ring, len, GFP_KERNEL); if (ret) return ret; - if (multicore) { - queue->worker = packet_alloc_percpu_multicore_worker(function, queue); - if (!queue->worker) - return -ENOMEM; - } else - INIT_WORK(&queue->work, function); + if (function) { + if (multicore) { + queue->worker = packet_alloc_percpu_multicore_worker(function, queue); + if (!queue->worker) + return -ENOMEM; + } else + INIT_WORK(&queue->work, function); + } return 0; } |