From 8a2d511d765c09ceebb872cda448e67e93b2ef38 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 30 May 2017 18:20:58 +0200 Subject: 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. --- src/data.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/data.c') 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); } -- cgit v1.2.3-59-g8ed1b