summaryrefslogtreecommitdiffstats
path: root/crypto/algapi.c
diff options
context:
space:
mode:
authorCorentin Labbe <clabbe@baylibre.com>2018-09-19 10:10:54 +0000
committerHerbert Xu <herbert@gondor.apana.org.au>2018-09-28 12:46:25 +0800
commitcac5818c25d0423bda73e2b6997404ed0a7ed9e3 (patch)
tree3a443fa0e9a8e96799e2802552cd1f6435213569 /crypto/algapi.c
parenta9cbfe4c784436368790f0c59674f99ba97ae21e (diff)
downloadlinux-cac5818c25d0423bda73e2b6997404ed0a7ed9e3.tar.gz
linux-cac5818c25d0423bda73e2b6997404ed0a7ed9e3.tar.bz2
linux-cac5818c25d0423bda73e2b6997404ed0a7ed9e3.zip
crypto: user - Implement a generic crypto statistics
This patch implement a generic way to get statistics about all crypto usages. Signed-off-by: Corentin Labbe <clabbe@baylibre.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/algapi.c')
-rw-r--r--crypto/algapi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c
index 38daa8677da9..2545c5f89c4c 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -258,6 +258,14 @@ static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg)
list_add(&alg->cra_list, &crypto_alg_list);
list_add(&larval->alg.cra_list, &crypto_alg_list);
+ atomic_set(&alg->encrypt_cnt, 0);
+ atomic_set(&alg->decrypt_cnt, 0);
+ atomic64_set(&alg->encrypt_tlen, 0);
+ atomic64_set(&alg->decrypt_tlen, 0);
+ atomic_set(&alg->verify_cnt, 0);
+ atomic_set(&alg->cipher_err_cnt, 0);
+ atomic_set(&alg->sign_cnt, 0);
+
out:
return larval;