aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/crypto.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-02-16 18:35:17 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2023-03-14 17:06:42 +0800
commit0a742389bcc00053d63b5271fefb00d3a338d512 (patch)
treeedac516a4c4495ca15362e1fe7074c68647389de /include/linux/crypto.h
parentcrypto: hash - Count error stats differently (diff)
downloadwireguard-linux-0a742389bcc00053d63b5271fefb00d3a338d512.tar.xz
wireguard-linux-0a742389bcc00053d63b5271fefb00d3a338d512.zip
crypto: acomp - Count error stats differently
Move all stat code specific to acomp into the acomp 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 'include/linux/crypto.h')
-rw-r--r--include/linux/crypto.h24
1 files changed, 0 insertions, 24 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index caf759e4201c..42bc55b642a0 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -293,22 +293,6 @@ struct crypto_istat_cipher {
};
/*
- * struct crypto_istat_compress - statistics for compress algorithm
- * @compress_cnt: number of compress requests
- * @compress_tlen: total data size handled by compress requests
- * @decompress_cnt: number of decompress requests
- * @decompress_tlen: total data size handled by decompress requests
- * @err_cnt: number of error for compress requests
- */
-struct crypto_istat_compress {
- atomic64_t compress_cnt;
- atomic64_t compress_tlen;
- atomic64_t decompress_cnt;
- atomic64_t decompress_tlen;
- atomic64_t err_cnt;
-};
-
-/*
* struct crypto_istat_kpp - statistics for KPP algorithm
* @setsecret_cnt: number of setsecrey operation
* @generate_public_key_cnt: number of generate_public_key operation
@@ -416,7 +400,6 @@ struct crypto_istat_rng {
*
* @stats: union of all possible crypto_istat_xxx structures
* @stats.cipher: statistics for cipher algorithm
- * @stats.compress: statistics for compress algorithm
* @stats.rng: statistics for rng algorithm
* @stats.kpp: statistics for KPP algorithm
*
@@ -455,7 +438,6 @@ struct crypto_alg {
#ifdef CONFIG_CRYPTO_STATS
union {
struct crypto_istat_cipher cipher;
- struct crypto_istat_compress compress;
struct crypto_istat_rng rng;
struct crypto_istat_kpp kpp;
} stats;
@@ -466,8 +448,6 @@ struct crypto_alg {
#ifdef CONFIG_CRYPTO_STATS
void crypto_stats_init(struct crypto_alg *alg);
void crypto_stats_get(struct crypto_alg *alg);
-void crypto_stats_compress(unsigned int slen, int ret, struct crypto_alg *alg);
-void crypto_stats_decompress(unsigned int slen, int ret, struct crypto_alg *alg);
void crypto_stats_kpp_set_secret(struct crypto_alg *alg, int ret);
void crypto_stats_kpp_generate_public_key(struct crypto_alg *alg, int ret);
void crypto_stats_kpp_compute_shared_secret(struct crypto_alg *alg, int ret);
@@ -480,10 +460,6 @@ static inline void crypto_stats_init(struct crypto_alg *alg)
{}
static inline void crypto_stats_get(struct crypto_alg *alg)
{}
-static inline void crypto_stats_compress(unsigned int slen, int ret, struct crypto_alg *alg)
-{}
-static inline void crypto_stats_decompress(unsigned int slen, int ret, struct crypto_alg *alg)
-{}
static inline void crypto_stats_kpp_set_secret(struct crypto_alg *alg, int ret)
{}
static inline void crypto_stats_kpp_generate_public_key(struct crypto_alg *alg, int ret)