summaryrefslogtreecommitdiff
path: root/drivers/net/wireguard/queueing.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-11-29 19:50:50 -0800
committerJakub Kicinski <kuba@kernel.org>2021-11-29 19:50:51 -0800
commitafd02352ddd8fd448620078b1a2784b71b74e60a (patch)
tree92b3d56e173a3bf1b17a9387f5d126a2f3dfb216 /drivers/net/wireguard/queueing.c
parente295886bcbaef6f7e4740d16d12d9f6b72908226 (diff)
parent0065ed65b309439c1ea2d70c717c73672550ae6a (diff)
downloadwireguard-linux-trimmed-afd02352ddd8fd448620078b1a2784b71b74e60a.tar.gz
wireguard-linux-trimmed-afd02352ddd8fd448620078b1a2784b71b74e60a.zip
Merge branch 'wireguard-siphash-patches-for-5-16-rc6'
Jason A. Donenfeld says: ==================== wireguard/siphash patches for 5.16-rc Here's quite a largeish set of stable patches I've had queued up and testing for a number of months now: - Patch (1) squelches a sparse warning by fixing an annotation. - Patches (2), (3), and (5) are minor improvements and fixes to the test suite. - Patch (4) is part of a tree-wide cleanup to have module-specific init and exit functions. - Patch (6) fixes a an issue with dangling dst references, by having a function to release references immediately rather than deferring, and adds an associated test case to prevent this from regressing. - Patches (7) and (8) help mitigate somewhat a potential DoS on the ingress path due to the use of skb_list's locking hitting contention on multiple cores by switching to using a ring buffer and dropping packets on contention rather than locking up another core spinning. - Patch (9) switches kvzalloc to kvcalloc for better form. - Patch (10) fixes alignment traps in siphash with clang-13 (and maybe other compilers) on armv6, by switching to using the unaligned functions by default instead of the aligned functions by default. ==================== Link: https://lore.kernel.org/r/20211129153929.3457-1-Jason@zx2c4.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/wireguard/queueing.c')
-rw-r--r--drivers/net/wireguard/queueing.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireguard/queueing.c b/drivers/net/wireguard/queueing.c
index 48e7b98..1de413b 100644
--- a/drivers/net/wireguard/queueing.c
+++ b/drivers/net/wireguard/queueing.c
@@ -38,11 +38,11 @@ int wg_packet_queue_init(struct crypt_queue *queue, work_func_t function,
return 0;
}
-void wg_packet_queue_free(struct crypt_queue *queue)
+void wg_packet_queue_free(struct crypt_queue *queue, bool purge)
{
free_percpu(queue->worker);
- WARN_ON(!__ptr_ring_empty(&queue->ring));
- ptr_ring_cleanup(&queue->ring, NULL);
+ WARN_ON(!purge && !__ptr_ring_empty(&queue->ring));
+ ptr_ring_cleanup(&queue->ring, purge ? (void(*)(void*))kfree_skb : NULL);
}
#define NEXT(skb) ((skb)->prev)