summaryrefslogtreecommitdiffhomepage
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
commit72beb0e64a73f254dce72d509256d34842855c46 (patch)
tree358e9347280109069c138a6d67a4339ad9f235fe
parente7cd064b1b66206e0d3d2f42f6898961242439b0 (diff)
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. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-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);
}