aboutsummaryrefslogtreecommitdiff
path: root/include/crypto/cryptd.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2016-06-21 16:55:13 +0800
committerMister Oyster <oysterized@gmail.com>2017-12-14 13:50:58 +0100
commit491447aaa084df16062f9ffc730c8b8c8510ca8b (patch)
tree3606c56b478e71caac298518a1a8e4a2b89cbc0e /include/crypto/cryptd.h
parent2d5e3c9f473699ac70806800018e1fbc996121ad (diff)
crypto: cryptd - Add helpers to check whether a tfm is queued
This patch adds helpers to check whether a given tfm is currently queued. This is meant to be used by ablk_helper and similar entities to ensure that no reordering is introduced because of requests queued in cryptd with respect to requests being processed in softirq context. The per-cpu queue length limit is also increased to 1000 in line with network limits. Change-Id: I59aa3397d701a80dcff257d26635c83038839d93 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/cryptd.h')
-rw-r--r--include/crypto/cryptd.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/crypto/cryptd.h b/include/crypto/cryptd.h
index ba98918bb..5bc0e6796 100644
--- a/include/crypto/cryptd.h
+++ b/include/crypto/cryptd.h
@@ -30,6 +30,7 @@ static inline struct cryptd_ablkcipher *__cryptd_ablkcipher_cast(
struct cryptd_ablkcipher *cryptd_alloc_ablkcipher(const char *alg_name,
u32 type, u32 mask);
struct crypto_blkcipher *cryptd_ablkcipher_child(struct cryptd_ablkcipher *tfm);
+bool cryptd_ablkcipher_queued(struct cryptd_ablkcipher *tfm);
void cryptd_free_ablkcipher(struct cryptd_ablkcipher *tfm);
struct cryptd_ahash {
@@ -47,6 +48,8 @@ struct cryptd_ahash *cryptd_alloc_ahash(const char *alg_name,
u32 type, u32 mask);
struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm);
struct shash_desc *cryptd_shash_desc(struct ahash_request *req);
+/* Must be called without moving CPUs. */
+bool cryptd_ahash_queued(struct cryptd_ahash *tfm);
void cryptd_free_ahash(struct cryptd_ahash *tfm);
struct cryptd_aead {
@@ -63,6 +66,8 @@ struct cryptd_aead *cryptd_alloc_aead(const char *alg_name,
u32 type, u32 mask);
struct crypto_aead *cryptd_aead_child(struct cryptd_aead *tfm);
+/* Must be called without moving CPUs. */
+bool cryptd_aead_queued(struct cryptd_aead *tfm);
void cryptd_free_aead(struct cryptd_aead *tfm);