summaryrefslogtreecommitdiffstats
path: root/crypto/crypto_user_stat.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-02-16 18:35:21 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2023-03-14 17:06:42 +0800
commit1085680bbb7a5235351937bea938c7051b443103 (patch)
treeb6046378f00649de08c898b838a3aa60281d8cd1 /crypto/crypto_user_stat.c
parente2950bf166ef71ed5588437b7ee94f65ceaa6cd0 (diff)
downloadlinux-1085680bbb7a5235351937bea938c7051b443103.tar.gz
linux-1085680bbb7a5235351937bea938c7051b443103.tar.bz2
linux-1085680bbb7a5235351937bea938c7051b443103.zip
crypto: skcipher - Count error stats differently
Move all stat code specific to skcipher into the skcipher code. While we're at it, change the stats so that bytes and counts are always incremented even in case of error. This allows the reference counting to be removed as we can now increment the counters prior to the operation. After the operation we simply increase the error count if necessary. This is safe as errors can only occur synchronously (or rather, the existing code already ignored asynchronous errors which are only visible to the callback function). Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/crypto_user_stat.c')
-rw-r--r--crypto/crypto_user_stat.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/crypto/crypto_user_stat.c b/crypto/crypto_user_stat.c
index 6ace8b70866f..b57e43278ee1 100644
--- a/crypto/crypto_user_stat.c
+++ b/crypto/crypto_user_stat.c
@@ -11,7 +11,6 @@
#include <linux/sched.h>
#include <net/netlink.h>
#include <net/sock.h>
-#include <crypto/internal/skcipher.h>
#include <crypto/internal/rng.h>
#include <crypto/internal/cryptouser.h>
@@ -34,12 +33,6 @@ 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->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_err_cnt = atomic64_read(&alg->stats.cipher.err_cnt);
-
return nla_put(skb, CRYPTOCFGA_STAT_CIPHER, sizeof(rcipher), &rcipher);
}
@@ -106,10 +99,6 @@ static int crypto_reportstat_one(struct crypto_alg *alg,
}
switch (alg->cra_flags & (CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_LARVAL)) {
- case CRYPTO_ALG_TYPE_SKCIPHER:
- if (crypto_report_cipher(skb, alg))
- goto nla_put_failure;
- break;
case CRYPTO_ALG_TYPE_CIPHER:
if (crypto_report_cipher(skb, alg))
goto nla_put_failure;