summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-05-30 18:20:58 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-05-31 05:35:34 +0200
commit8a2d511d765c09ceebb872cda448e67e93b2ef38 (patch)
tree1f78379b5c3dd0cf7bc2d7df1fb1b9d3030ff212
parentcurve25519: add NEON versions for ARM (diff)
downloadwireguard-monolithic-historical-8a2d511d765c09ceebb872cda448e67e93b2ef38.tar.xz
wireguard-monolithic-historical-8a2d511d765c09ceebb872cda448e67e93b2ef38.zip
data: enable BH during parallel crypto on ARM/NEON
padata disables it, but in order to use SIMD on ARM, we can't be in an interrupt. We only do this on ARM since it adds jitter to the performance.
-rw-r--r--src/data.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/data.c b/src/data.c
index 8b6d59b..943d6e8 100644
--- a/src/data.c
+++ b/src/data.c
@@ -234,7 +234,13 @@ static inline void queue_encrypt_reset(struct sk_buff_head *queue, struct noise_
static void begin_parallel_encryption(struct padata_priv *padata)
{
struct encryption_ctx *ctx = container_of(padata, struct encryption_ctx, padata);
+#if IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && defined(CONFIG_ARM)
+ local_bh_enable();
+#endif
queue_encrypt_reset(&ctx->queue, ctx->keypair);
+#if IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && defined(CONFIG_ARM)
+ local_bh_disable();
+#endif
padata_do_serial(padata);
}
@@ -362,7 +368,13 @@ static void finish_decrypt_packet(struct decryption_ctx *ctx)
static void begin_parallel_decryption(struct padata_priv *padata)
{
struct decryption_ctx *ctx = container_of(padata, struct decryption_ctx, padata);
+#if IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && defined(CONFIG_ARM)
+ local_bh_enable();
+#endif
begin_decrypt_packet(ctx);
+#if IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && defined(CONFIG_ARM)
+ local_bh_disable();
+#endif
padata_do_serial(padata);
}