]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ovpn: consolidate crypto allocations in one chunk
authorRalf Lici <ralf@mandelbit.com>
Fri, 14 Nov 2025 10:40:29 +0000 (11:40 +0100)
committerAntonio Quartulli <antonio@openvpn.net>
Tue, 17 Mar 2026 10:09:20 +0000 (11:09 +0100)
commitd3244af9c4c2bbce57465130c9cd509182207c2d
tree743094697a776deff15dc428c8adc440c4980fa2
parent7b80d8a33500bd8ae5081c053f0447b502581d79
ovpn: consolidate crypto allocations in one chunk

Currently ovpn uses three separate dynamically allocated structures to
set up cryptographic operations for both encryption and decryption. This
adds overhead to performance-critical paths and contribute to memory
fragmentation.

This commit consolidates those allocations into a single temporary blob,
similar to what esp_alloc_tmp() does.

The resulting performance gain is +7.7% and +4.3% for UDP when using AES
and ChaChaPoly respectively, and +4.3% for TCP.

Signed-off-by: Ralf Lici <ralf@mandelbit.com>
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
drivers/net/ovpn/crypto_aead.c
drivers/net/ovpn/io.c
drivers/net/ovpn/skb.h