summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorCorentin Labbe <clabbe@baylibre.com>2018-11-29 14:42:24 +0000
committerHerbert Xu <herbert@gondor.apana.org.au>2018-12-07 14:15:00 +0800
commit17c18f9e33282a170458cb5ea20759bfcb0da7d8 (patch)
tree13e2b9bc7500fa81695018e29616f1efa4a3243b /crypto
parent5fff81729f09f3d7d9be0ace50be112bd34f0bb9 (diff)
crypto: user - Split stats in multiple structures
Like for userspace, this patch splits stats into multiple structures, one for each algorithm class. Signed-off-by: Corentin Labbe <clabbe@baylibre.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/algapi.c108
-rw-r--r--crypto/crypto_user_stat.c82
2 files changed, 92 insertions, 98 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c
index 4c1e6079d271..a8cb5aed0069 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -259,13 +259,7 @@ static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg)
list_add(&larval->alg.cra_list, &crypto_alg_list);
#ifdef CONFIG_CRYPTO_STATS
- atomic64_set(&alg->encrypt_cnt, 0);
- atomic64_set(&alg->decrypt_cnt, 0);
- atomic64_set(&alg->encrypt_tlen, 0);
- atomic64_set(&alg->decrypt_tlen, 0);
- atomic64_set(&alg->verify_cnt, 0);
- atomic64_set(&alg->cipher_err_cnt, 0);
- atomic64_set(&alg->sign_cnt, 0);
+ memset(&alg->stats, 0, sizeof(alg->stats));
#endif
out:
@@ -1089,10 +1083,10 @@ void crypto_stats_ablkcipher_encrypt(unsigned int nbytes, int ret,
struct crypto_alg *alg)
{
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic64_inc(&alg->cipher_err_cnt);
+ atomic64_inc(&alg->stats.cipher.cipher_err_cnt);
} else {
- atomic64_inc(&alg->encrypt_cnt);
- atomic64_add(nbytes, &alg->encrypt_tlen);
+ atomic64_inc(&alg->stats.cipher.encrypt_cnt);
+ atomic64_add(nbytes, &alg->stats.cipher.encrypt_tlen);
}
crypto_alg_put(alg);
}
@@ -1102,10 +1096,10 @@ void crypto_stats_ablkcipher_decrypt(unsigned int nbytes, int ret,
struct crypto_alg *alg)
{
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic64_inc(&alg->cipher_err_cnt);
+ atomic64_inc(&alg->stats.cipher.cipher_err_cnt);
} else {
- atomic64_inc(&alg->decrypt_cnt);
- atomic64_add(nbytes, &alg->decrypt_tlen);
+ atomic64_inc(&alg->stats.cipher.decrypt_cnt);
+ atomic64_add(nbytes, &alg->stats.cipher.decrypt_tlen);
}
crypto_alg_put(alg);
}
@@ -1115,10 +1109,10 @@ void crypto_stats_aead_encrypt(unsigned int cryptlen, struct crypto_alg *alg,
int ret)
{
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic64_inc(&alg->aead_err_cnt);
+ atomic64_inc(&alg->stats.aead.aead_err_cnt);
} else {
- atomic64_inc(&alg->encrypt_cnt);
- atomic64_add(cryptlen, &alg->encrypt_tlen);
+ atomic64_inc(&alg->stats.aead.encrypt_cnt);
+ atomic64_add(cryptlen, &alg->stats.aead.encrypt_tlen);
}
crypto_alg_put(alg);
}
@@ -1128,10 +1122,10 @@ void crypto_stats_aead_decrypt(unsigned int cryptlen, struct crypto_alg *alg,
int ret)
{
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic64_inc(&alg->aead_err_cnt);
+ atomic64_inc(&alg->stats.aead.aead_err_cnt);
} else {
- atomic64_inc(&alg->decrypt_cnt);
- atomic64_add(cryptlen, &alg->decrypt_tlen);
+ atomic64_inc(&alg->stats.aead.decrypt_cnt);
+ atomic64_add(cryptlen, &alg->stats.aead.decrypt_tlen);
}
crypto_alg_put(alg);
}
@@ -1141,10 +1135,10 @@ void crypto_stats_akcipher_encrypt(unsigned int src_len, int ret,
struct crypto_alg *alg)
{
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic64_inc(&alg->akcipher_err_cnt);
+ atomic64_inc(&alg->stats.akcipher.akcipher_err_cnt);
} else {
- atomic64_inc(&alg->encrypt_cnt);
- atomic64_add(src_len, &alg->encrypt_tlen);
+ atomic64_inc(&alg->stats.akcipher.encrypt_cnt);
+ atomic64_add(src_len, &alg->stats.akcipher.encrypt_tlen);
}
crypto_alg_put(alg);
}
@@ -1154,10 +1148,10 @@ void crypto_stats_akcipher_decrypt(unsigned int src_len, int ret,
struct crypto_alg *alg)
{
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic64_inc(&alg->akcipher_err_cnt);
+ atomic64_inc(&alg->stats.akcipher.akcipher_err_cnt);
} else {
- atomic64_inc(&alg->decrypt_cnt);
- atomic64_add(src_len, &alg->decrypt_tlen);
+ atomic64_inc(&alg->stats.akcipher.decrypt_cnt);
+ atomic64_add(src_len, &alg->stats.akcipher.decrypt_tlen);
}
crypto_alg_put(alg);
}
@@ -1166,9 +1160,9 @@ EXPORT_SYMBOL_GPL(crypto_stats_akcipher_decrypt);
void crypto_stats_akcipher_sign(int ret, struct crypto_alg *alg)
{
if (ret && ret != -EINPROGRESS && ret != -EBUSY)
- atomic64_inc(&alg->akcipher_err_cnt);
+ atomic64_inc(&alg->stats.akcipher.akcipher_err_cnt);
else
- atomic64_inc(&alg->sign_cnt);
+ atomic64_inc(&alg->stats.akcipher.sign_cnt);
crypto_alg_put(alg);
}
EXPORT_SYMBOL_GPL(crypto_stats_akcipher_sign);
@@ -1176,9 +1170,9 @@ EXPORT_SYMBOL_GPL(crypto_stats_akcipher_sign);
void crypto_stats_akcipher_verify(int ret, struct crypto_alg *alg)
{
if (ret && ret != -EINPROGRESS && ret != -EBUSY)
- atomic64_inc(&alg->akcipher_err_cnt);
+ atomic64_inc(&alg->stats.akcipher.akcipher_err_cnt);
else
- atomic64_inc(&alg->verify_cnt);
+ atomic64_inc(&alg->stats.akcipher.verify_cnt);
crypto_alg_put(alg);
}
EXPORT_SYMBOL_GPL(crypto_stats_akcipher_verify);
@@ -1186,10 +1180,10 @@ EXPORT_SYMBOL_GPL(crypto_stats_akcipher_verify);
void crypto_stats_compress(unsigned int slen, int ret, struct crypto_alg *alg)
{
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic64_inc(&alg->compress_err_cnt);
+ atomic64_inc(&alg->stats.compress.compress_err_cnt);
} else {
- atomic64_inc(&alg->compress_cnt);
- atomic64_add(slen, &alg->compress_tlen);
+ atomic64_inc(&alg->stats.compress.compress_cnt);
+ atomic64_add(slen, &alg->stats.compress.compress_tlen);
}
crypto_alg_put(alg);
}
@@ -1198,10 +1192,10 @@ EXPORT_SYMBOL_GPL(crypto_stats_compress);
void crypto_stats_decompress(unsigned int slen, int ret, struct crypto_alg *alg)
{
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic64_inc(&alg->compress_err_cnt);
+ atomic64_inc(&alg->stats.compress.compress_err_cnt);
} else {
- atomic64_inc(&alg->decompress_cnt);
- atomic64_add(slen, &alg->decompress_tlen);
+ atomic64_inc(&alg->stats.compress.decompress_cnt);
+ atomic64_add(slen, &alg->stats.compress.decompress_tlen);
}
crypto_alg_put(alg);
}
@@ -1211,9 +1205,9 @@ void crypto_stats_ahash_update(unsigned int nbytes, int ret,
struct crypto_alg *alg)
{
if (ret && ret != -EINPROGRESS && ret != -EBUSY)
- atomic64_inc(&alg->hash_err_cnt);
+ atomic64_inc(&alg->stats.hash.hash_err_cnt);
else
- atomic64_add(nbytes, &alg->hash_tlen);
+ atomic64_add(nbytes, &alg->stats.hash.hash_tlen);
crypto_alg_put(alg);
}
EXPORT_SYMBOL_GPL(crypto_stats_ahash_update);
@@ -1222,10 +1216,10 @@ void crypto_stats_ahash_final(unsigned int nbytes, int ret,
struct crypto_alg *alg)
{
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic64_inc(&alg->hash_err_cnt);
+ atomic64_inc(&alg->stats.hash.hash_err_cnt);
} else {
- atomic64_inc(&alg->hash_cnt);
- atomic64_add(nbytes, &alg->hash_tlen);
+ atomic64_inc(&alg->stats.hash.hash_cnt);
+ atomic64_add(nbytes, &alg->stats.hash.hash_tlen);
}
crypto_alg_put(alg);
}
@@ -1234,9 +1228,9 @@ EXPORT_SYMBOL_GPL(crypto_stats_ahash_final);
void crypto_stats_kpp_set_secret(struct crypto_alg *alg, int ret)
{
if (ret)
- atomic64_inc(&alg->kpp_err_cnt);
+ atomic64_inc(&alg->stats.kpp.kpp_err_cnt);
else
- atomic64_inc(&alg->setsecret_cnt);
+ atomic64_inc(&alg->stats.kpp.setsecret_cnt);
crypto_alg_put(alg);
}
EXPORT_SYMBOL_GPL(crypto_stats_kpp_set_secret);
@@ -1244,9 +1238,9 @@ EXPORT_SYMBOL_GPL(crypto_stats_kpp_set_secret);
void crypto_stats_kpp_generate_public_key(struct crypto_alg *alg, int ret)
{
if (ret)
- atomic64_inc(&alg->kpp_err_cnt);
+ atomic64_inc(&alg->stats.kpp.kpp_err_cnt);
else
- atomic64_inc(&alg->generate_public_key_cnt);
+ atomic64_inc(&alg->stats.kpp.generate_public_key_cnt);
crypto_alg_put(alg);
}
EXPORT_SYMBOL_GPL(crypto_stats_kpp_generate_public_key);
@@ -1254,9 +1248,9 @@ EXPORT_SYMBOL_GPL(crypto_stats_kpp_generate_public_key);
void crypto_stats_kpp_compute_shared_secret(struct crypto_alg *alg, int ret)
{
if (ret)
- atomic64_inc(&alg->kpp_err_cnt);
+ atomic64_inc(&alg->stats.kpp.kpp_err_cnt);
else
- atomic64_inc(&alg->compute_shared_secret_cnt);
+ atomic64_inc(&alg->stats.kpp.compute_shared_secret_cnt);
crypto_alg_put(alg);
}
EXPORT_SYMBOL_GPL(crypto_stats_kpp_compute_shared_secret);
@@ -1264,9 +1258,9 @@ EXPORT_SYMBOL_GPL(crypto_stats_kpp_compute_shared_secret);
void crypto_stats_rng_seed(struct crypto_alg *alg, int ret)
{
if (ret && ret != -EINPROGRESS && ret != -EBUSY)
- atomic64_inc(&alg->rng_err_cnt);
+ atomic64_inc(&alg->stats.rng.rng_err_cnt);
else
- atomic64_inc(&alg->seed_cnt);
+ atomic64_inc(&alg->stats.rng.seed_cnt);
crypto_alg_put(alg);
}
EXPORT_SYMBOL_GPL(crypto_stats_rng_seed);
@@ -1275,10 +1269,10 @@ void crypto_stats_rng_generate(struct crypto_alg *alg, unsigned int dlen,
int ret)
{
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic64_inc(&alg->rng_err_cnt);
+ atomic64_inc(&alg->stats.rng.rng_err_cnt);
} else {
- atomic64_inc(&alg->generate_cnt);
- atomic64_add(dlen, &alg->generate_tlen);
+ atomic64_inc(&alg->stats.rng.generate_cnt);
+ atomic64_add(dlen, &alg->stats.rng.generate_tlen);
}
crypto_alg_put(alg);
}
@@ -1288,10 +1282,10 @@ void crypto_stats_skcipher_encrypt(unsigned int cryptlen, int ret,
struct crypto_alg *alg)
{
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic64_inc(&alg->cipher_err_cnt);
+ atomic64_inc(&alg->stats.cipher.cipher_err_cnt);
} else {
- atomic64_inc(&alg->encrypt_cnt);
- atomic64_add(cryptlen, &alg->encrypt_tlen);
+ atomic64_inc(&alg->stats.cipher.encrypt_cnt);
+ atomic64_add(cryptlen, &alg->stats.cipher.encrypt_tlen);
}
crypto_alg_put(alg);
}
@@ -1301,10 +1295,10 @@ void crypto_stats_skcipher_decrypt(unsigned int cryptlen, int ret,
struct crypto_alg *alg)
{
if (ret && ret != -EINPROGRESS && ret != -EBUSY) {
- atomic64_inc(&alg->cipher_err_cnt);
+ atomic64_inc(&alg->stats.cipher.cipher_err_cnt);
} else {
- atomic64_inc(&alg->decrypt_cnt);
- atomic64_add(cryptlen, &alg->decrypt_tlen);
+ atomic64_inc(&alg->stats.cipher.decrypt_cnt);
+ atomic64_add(cryptlen, &alg->stats.cipher.decrypt_tlen);
}
crypto_alg_put(alg);
}
diff --git a/crypto/crypto_user_stat.c b/crypto/crypto_user_stat.c
index 7b668c659122..113bf1691560 100644
--- a/crypto/crypto_user_stat.c
+++ b/crypto/crypto_user_stat.c
@@ -39,11 +39,11 @@ static int crypto_report_aead(struct sk_buff *skb, struct crypto_alg *alg)
strscpy(raead.type, "aead", sizeof(raead.type));
- raead.stat_encrypt_cnt = atomic64_read(&alg->encrypt_cnt);
- raead.stat_encrypt_tlen = atomic64_read(&alg->encrypt_tlen);
- raead.stat_decrypt_cnt = atomic64_read(&alg->decrypt_cnt);
- raead.stat_decrypt_tlen = atomic64_read(&alg->decrypt_tlen);
- raead.stat_aead_err_cnt = atomic64_read(&alg->aead_err_cnt);
+ raead.stat_encrypt_cnt = atomic64_read(&alg->stats.aead.encrypt_cnt);
+ raead.stat_encrypt_tlen = atomic64_read(&alg->stats.aead.encrypt_tlen);
+ raead.stat_decrypt_cnt = atomic64_read(&alg->stats.aead.decrypt_cnt);
+ raead.stat_decrypt_tlen = atomic64_read(&alg->stats.aead.decrypt_tlen);
+ raead.stat_aead_err_cnt = atomic64_read(&alg->stats.aead.aead_err_cnt);
return nla_put(skb, CRYPTOCFGA_STAT_AEAD, sizeof(raead), &raead);
}
@@ -56,11 +56,11 @@ static int crypto_report_cipher(struct sk_buff *skb, struct crypto_alg *alg)
strscpy(rcipher.type, "cipher", sizeof(rcipher.type));
- rcipher.stat_encrypt_cnt = atomic64_read(&alg->encrypt_cnt);
- rcipher.stat_encrypt_tlen = atomic64_read(&alg->encrypt_tlen);
- rcipher.stat_decrypt_cnt = atomic64_read(&alg->decrypt_cnt);
- rcipher.stat_decrypt_tlen = atomic64_read(&alg->decrypt_tlen);
- rcipher.stat_cipher_err_cnt = atomic64_read(&alg->cipher_err_cnt);
+ rcipher.stat_encrypt_cnt = atomic64_read(&alg->stats.cipher.encrypt_cnt);
+ rcipher.stat_encrypt_tlen = atomic64_read(&alg->stats.cipher.encrypt_tlen);
+ rcipher.stat_decrypt_cnt = atomic64_read(&alg->stats.cipher.decrypt_cnt);
+ rcipher.stat_decrypt_tlen = atomic64_read(&alg->stats.cipher.decrypt_tlen);
+ rcipher.stat_cipher_err_cnt = atomic64_read(&alg->stats.cipher.cipher_err_cnt);
return nla_put(skb, CRYPTOCFGA_STAT_CIPHER, sizeof(rcipher), &rcipher);
}
@@ -72,11 +72,11 @@ static int crypto_report_comp(struct sk_buff *skb, struct crypto_alg *alg)
memset(&rcomp, 0, sizeof(rcomp));
strscpy(rcomp.type, "compression", sizeof(rcomp.type));
- rcomp.stat_compress_cnt = atomic64_read(&alg->compress_cnt);
- rcomp.stat_compress_tlen = atomic64_read(&alg->compress_tlen);
- rcomp.stat_decompress_cnt = atomic64_read(&alg->decompress_cnt);
- rcomp.stat_decompress_tlen = atomic64_read(&alg->decompress_tlen);
- rcomp.stat_compress_err_cnt = atomic64_read(&alg->compress_err_cnt);
+ rcomp.stat_compress_cnt = atomic64_read(&alg->stats.compress.compress_cnt);
+ rcomp.stat_compress_tlen = atomic64_read(&alg->stats.compress.compress_tlen);
+ rcomp.stat_decompress_cnt = atomic64_read(&alg->stats.compress.decompress_cnt);
+ rcomp.stat_decompress_tlen = atomic64_read(&alg->stats.compress.decompress_tlen);
+ rcomp.stat_compress_err_cnt = atomic64_read(&alg->stats.compress.compress_err_cnt);
return nla_put(skb, CRYPTOCFGA_STAT_COMPRESS, sizeof(rcomp), &rcomp);
}
@@ -88,11 +88,11 @@ static int crypto_report_acomp(struct sk_buff *skb, struct crypto_alg *alg)
memset(&racomp, 0, sizeof(racomp));
strscpy(racomp.type, "acomp", sizeof(racomp.type));
- racomp.stat_compress_cnt = atomic64_read(&alg->compress_cnt);
- racomp.stat_compress_tlen = atomic64_read(&alg->compress_tlen);
- racomp.stat_decompress_cnt = atomic64_read(&alg->decompress_cnt);
- racomp.stat_decompress_tlen = atomic64_read(&alg->decompress_tlen);
- racomp.stat_compress_err_cnt = atomic64_read(&alg->compress_err_cnt);
+ racomp.stat_compress_cnt = atomic64_read(&alg->stats.compress.compress_cnt);
+ racomp.stat_compress_tlen = atomic64_read(&alg->stats.compress.compress_tlen);
+ racomp.stat_decompress_cnt = atomic64_read(&alg->stats.compress.decompress_cnt);
+ racomp.stat_decompress_tlen = atomic64_read(&alg->stats.compress.decompress_tlen);
+ racomp.stat_compress_err_cnt = atomic64_read(&alg->stats.compress.compress_err_cnt);
return nla_put(skb, CRYPTOCFGA_STAT_ACOMP, sizeof(racomp), &racomp);
}
@@ -104,13 +104,13 @@ static int crypto_report_akcipher(struct sk_buff *skb, struct crypto_alg *alg)
memset(&rakcipher, 0, sizeof(rakcipher));
strscpy(rakcipher.type, "akcipher", sizeof(rakcipher.type));
- rakcipher.stat_encrypt_cnt = atomic64_read(&alg->encrypt_cnt);
- rakcipher.stat_encrypt_tlen = atomic64_read(&alg->encrypt_tlen);
- rakcipher.stat_decrypt_cnt = atomic64_read(&alg->decrypt_cnt);
- rakcipher.stat_decrypt_tlen = atomic64_read(&alg->decrypt_tlen);
- rakcipher.stat_sign_cnt = atomic64_read(&alg->sign_cnt);
- rakcipher.stat_verify_cnt = atomic64_read(&alg->verify_cnt);
- rakcipher.stat_akcipher_err_cnt = atomic64_read(&alg->akcipher_err_cnt);
+ rakcipher.stat_encrypt_cnt = atomic64_read(&alg->stats.akcipher.encrypt_cnt);
+ rakcipher.stat_encrypt_tlen = atomic64_read(&alg->stats.akcipher.encrypt_tlen);
+ rakcipher.stat_decrypt_cnt = atomic64_read(&alg->stats.akcipher.decrypt_cnt);
+ rakcipher.stat_decrypt_tlen = atomic64_read(&alg->stats.akcipher.decrypt_tlen);
+ rakcipher.stat_sign_cnt = atomic64_read(&alg->stats.akcipher.sign_cnt);
+ rakcipher.stat_verify_cnt = atomic64_read(&alg->stats.akcipher.verify_cnt);
+ rakcipher.stat_akcipher_err_cnt = atomic64_read(&alg->stats.akcipher.akcipher_err_cnt);
return nla_put(skb, CRYPTOCFGA_STAT_AKCIPHER,
sizeof(rakcipher), &rakcipher);
@@ -124,10 +124,10 @@ static int crypto_report_kpp(struct sk_buff *skb, struct crypto_alg *alg)
strscpy(rkpp.type, "kpp", sizeof(rkpp.type));
- rkpp.stat_setsecret_cnt = atomic64_read(&alg->setsecret_cnt);
- rkpp.stat_generate_public_key_cnt = atomic64_read(&alg->generate_public_key_cnt);
- rkpp.stat_compute_shared_secret_cnt = atomic64_read(&alg->compute_shared_secret_cnt);
- rkpp.stat_kpp_err_cnt = atomic64_read(&alg->kpp_err_cnt);
+ rkpp.stat_setsecret_cnt = atomic64_read(&alg->stats.kpp.setsecret_cnt);
+ rkpp.stat_generate_public_key_cnt = atomic64_read(&alg->stats.kpp.generate_public_key_cnt);
+ rkpp.stat_compute_shared_secret_cnt = atomic64_read(&alg->stats.kpp.compute_shared_secret_cnt);
+ rkpp.stat_kpp_err_cnt = atomic64_read(&alg->stats.kpp.kpp_err_cnt);
return nla_put(skb, CRYPTOCFGA_STAT_KPP, sizeof(rkpp), &rkpp);
}
@@ -140,9 +140,9 @@ static int crypto_report_ahash(struct sk_buff *skb, struct crypto_alg *alg)
strscpy(rhash.type, "ahash", sizeof(rhash.type));
- rhash.stat_hash_cnt = atomic64_read(&alg->hash_cnt);
- rhash.stat_hash_tlen = atomic64_read(&alg->hash_tlen);
- rhash.stat_hash_err_cnt = atomic64_read(&alg->hash_err_cnt);
+ rhash.stat_hash_cnt = atomic64_read(&alg->stats.hash.hash_cnt);
+ rhash.stat_hash_tlen = atomic64_read(&alg->stats.hash.hash_tlen);
+ rhash.stat_hash_err_cnt = atomic64_read(&alg->stats.hash.hash_err_cnt);
return nla_put(skb, CRYPTOCFGA_STAT_HASH, sizeof(rhash), &rhash);
}
@@ -155,9 +155,9 @@ static int crypto_report_shash(struct sk_buff *skb, struct crypto_alg *alg)
strscpy(rhash.type, "shash", sizeof(rhash.type));
- rhash.stat_hash_cnt = atomic64_read(&alg->hash_cnt);
- rhash.stat_hash_tlen = atomic64_read(&alg->hash_tlen);
- rhash.stat_hash_err_cnt = atomic64_read(&alg->hash_err_cnt);
+ rhash.stat_hash_cnt = atomic64_read(&alg->stats.hash.hash_cnt);
+ rhash.stat_hash_tlen = atomic64_read(&alg->stats.hash.hash_tlen);
+ rhash.stat_hash_err_cnt = atomic64_read(&alg->stats.hash.hash_err_cnt);
return nla_put(skb, CRYPTOCFGA_STAT_HASH, sizeof(rhash), &rhash);
}
@@ -170,10 +170,10 @@ static int crypto_report_rng(struct sk_buff *skb, struct crypto_alg *alg)
strscpy(rrng.type, "rng", sizeof(rrng.type));
- rrng.stat_generate_cnt = atomic64_read(&alg->generate_cnt);
- rrng.stat_generate_tlen = atomic64_read(&alg->generate_tlen);
- rrng.stat_seed_cnt = atomic64_read(&alg->seed_cnt);
- rrng.stat_rng_err_cnt = atomic64_read(&alg->rng_err_cnt);
+ rrng.stat_generate_cnt = atomic64_read(&alg->stats.rng.generate_cnt);
+ rrng.stat_generate_tlen = atomic64_read(&alg->stats.rng.generate_tlen);
+ rrng.stat_seed_cnt = atomic64_read(&alg->stats.rng.seed_cnt);
+ rrng.stat_rng_err_cnt = atomic64_read(&alg->stats.rng.rng_err_cnt);
return nla_put(skb, CRYPTOCFGA_STAT_RNG, sizeof(rrng), &rrng);
}