diff options
Diffstat (limited to 'crypto/algapi.c')
-rw-r--r-- | crypto/algapi.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/crypto/algapi.c b/crypto/algapi.c index a8cb5aed0069..c0d4f9ef6b0f 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c | |||
@@ -1083,7 +1083,7 @@ void crypto_stats_ablkcipher_encrypt(unsigned int nbytes, int ret, | |||
1083 | struct crypto_alg *alg) | 1083 | struct crypto_alg *alg) |
1084 | { | 1084 | { |
1085 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { | 1085 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { |
1086 | atomic64_inc(&alg->stats.cipher.cipher_err_cnt); | 1086 | atomic64_inc(&alg->stats.cipher.err_cnt); |
1087 | } else { | 1087 | } else { |
1088 | atomic64_inc(&alg->stats.cipher.encrypt_cnt); | 1088 | atomic64_inc(&alg->stats.cipher.encrypt_cnt); |
1089 | atomic64_add(nbytes, &alg->stats.cipher.encrypt_tlen); | 1089 | atomic64_add(nbytes, &alg->stats.cipher.encrypt_tlen); |
@@ -1096,7 +1096,7 @@ void crypto_stats_ablkcipher_decrypt(unsigned int nbytes, int ret, | |||
1096 | struct crypto_alg *alg) | 1096 | struct crypto_alg *alg) |
1097 | { | 1097 | { |
1098 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { | 1098 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { |
1099 | atomic64_inc(&alg->stats.cipher.cipher_err_cnt); | 1099 | atomic64_inc(&alg->stats.cipher.err_cnt); |
1100 | } else { | 1100 | } else { |
1101 | atomic64_inc(&alg->stats.cipher.decrypt_cnt); | 1101 | atomic64_inc(&alg->stats.cipher.decrypt_cnt); |
1102 | atomic64_add(nbytes, &alg->stats.cipher.decrypt_tlen); | 1102 | atomic64_add(nbytes, &alg->stats.cipher.decrypt_tlen); |
@@ -1109,7 +1109,7 @@ void crypto_stats_aead_encrypt(unsigned int cryptlen, struct crypto_alg *alg, | |||
1109 | int ret) | 1109 | int ret) |
1110 | { | 1110 | { |
1111 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { | 1111 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { |
1112 | atomic64_inc(&alg->stats.aead.aead_err_cnt); | 1112 | atomic64_inc(&alg->stats.aead.err_cnt); |
1113 | } else { | 1113 | } else { |
1114 | atomic64_inc(&alg->stats.aead.encrypt_cnt); | 1114 | atomic64_inc(&alg->stats.aead.encrypt_cnt); |
1115 | atomic64_add(cryptlen, &alg->stats.aead.encrypt_tlen); | 1115 | atomic64_add(cryptlen, &alg->stats.aead.encrypt_tlen); |
@@ -1122,7 +1122,7 @@ void crypto_stats_aead_decrypt(unsigned int cryptlen, struct crypto_alg *alg, | |||
1122 | int ret) | 1122 | int ret) |
1123 | { | 1123 | { |
1124 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { | 1124 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { |
1125 | atomic64_inc(&alg->stats.aead.aead_err_cnt); | 1125 | atomic64_inc(&alg->stats.aead.err_cnt); |
1126 | } else { | 1126 | } else { |
1127 | atomic64_inc(&alg->stats.aead.decrypt_cnt); | 1127 | atomic64_inc(&alg->stats.aead.decrypt_cnt); |
1128 | atomic64_add(cryptlen, &alg->stats.aead.decrypt_tlen); | 1128 | atomic64_add(cryptlen, &alg->stats.aead.decrypt_tlen); |
@@ -1135,7 +1135,7 @@ void crypto_stats_akcipher_encrypt(unsigned int src_len, int ret, | |||
1135 | struct crypto_alg *alg) | 1135 | struct crypto_alg *alg) |
1136 | { | 1136 | { |
1137 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { | 1137 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { |
1138 | atomic64_inc(&alg->stats.akcipher.akcipher_err_cnt); | 1138 | atomic64_inc(&alg->stats.akcipher.err_cnt); |
1139 | } else { | 1139 | } else { |
1140 | atomic64_inc(&alg->stats.akcipher.encrypt_cnt); | 1140 | atomic64_inc(&alg->stats.akcipher.encrypt_cnt); |
1141 | atomic64_add(src_len, &alg->stats.akcipher.encrypt_tlen); | 1141 | atomic64_add(src_len, &alg->stats.akcipher.encrypt_tlen); |
@@ -1148,7 +1148,7 @@ void crypto_stats_akcipher_decrypt(unsigned int src_len, int ret, | |||
1148 | struct crypto_alg *alg) | 1148 | struct crypto_alg *alg) |
1149 | { | 1149 | { |
1150 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { | 1150 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { |
1151 | atomic64_inc(&alg->stats.akcipher.akcipher_err_cnt); | 1151 | atomic64_inc(&alg->stats.akcipher.err_cnt); |
1152 | } else { | 1152 | } else { |
1153 | atomic64_inc(&alg->stats.akcipher.decrypt_cnt); | 1153 | atomic64_inc(&alg->stats.akcipher.decrypt_cnt); |
1154 | atomic64_add(src_len, &alg->stats.akcipher.decrypt_tlen); | 1154 | atomic64_add(src_len, &alg->stats.akcipher.decrypt_tlen); |
@@ -1160,7 +1160,7 @@ EXPORT_SYMBOL_GPL(crypto_stats_akcipher_decrypt); | |||
1160 | void crypto_stats_akcipher_sign(int ret, struct crypto_alg *alg) | 1160 | void crypto_stats_akcipher_sign(int ret, struct crypto_alg *alg) |
1161 | { | 1161 | { |
1162 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) | 1162 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) |
1163 | atomic64_inc(&alg->stats.akcipher.akcipher_err_cnt); | 1163 | atomic64_inc(&alg->stats.akcipher.err_cnt); |
1164 | else | 1164 | else |
1165 | atomic64_inc(&alg->stats.akcipher.sign_cnt); | 1165 | atomic64_inc(&alg->stats.akcipher.sign_cnt); |
1166 | crypto_alg_put(alg); | 1166 | crypto_alg_put(alg); |
@@ -1170,7 +1170,7 @@ EXPORT_SYMBOL_GPL(crypto_stats_akcipher_sign); | |||
1170 | void crypto_stats_akcipher_verify(int ret, struct crypto_alg *alg) | 1170 | void crypto_stats_akcipher_verify(int ret, struct crypto_alg *alg) |
1171 | { | 1171 | { |
1172 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) | 1172 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) |
1173 | atomic64_inc(&alg->stats.akcipher.akcipher_err_cnt); | 1173 | atomic64_inc(&alg->stats.akcipher.err_cnt); |
1174 | else | 1174 | else |
1175 | atomic64_inc(&alg->stats.akcipher.verify_cnt); | 1175 | atomic64_inc(&alg->stats.akcipher.verify_cnt); |
1176 | crypto_alg_put(alg); | 1176 | crypto_alg_put(alg); |
@@ -1180,7 +1180,7 @@ EXPORT_SYMBOL_GPL(crypto_stats_akcipher_verify); | |||
1180 | void crypto_stats_compress(unsigned int slen, int ret, struct crypto_alg *alg) | 1180 | void crypto_stats_compress(unsigned int slen, int ret, struct crypto_alg *alg) |
1181 | { | 1181 | { |
1182 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { | 1182 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { |
1183 | atomic64_inc(&alg->stats.compress.compress_err_cnt); | 1183 | atomic64_inc(&alg->stats.compress.err_cnt); |
1184 | } else { | 1184 | } else { |
1185 | atomic64_inc(&alg->stats.compress.compress_cnt); | 1185 | atomic64_inc(&alg->stats.compress.compress_cnt); |
1186 | atomic64_add(slen, &alg->stats.compress.compress_tlen); | 1186 | atomic64_add(slen, &alg->stats.compress.compress_tlen); |
@@ -1192,7 +1192,7 @@ EXPORT_SYMBOL_GPL(crypto_stats_compress); | |||
1192 | void crypto_stats_decompress(unsigned int slen, int ret, struct crypto_alg *alg) | 1192 | void crypto_stats_decompress(unsigned int slen, int ret, struct crypto_alg *alg) |
1193 | { | 1193 | { |
1194 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { | 1194 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { |
1195 | atomic64_inc(&alg->stats.compress.compress_err_cnt); | 1195 | atomic64_inc(&alg->stats.compress.err_cnt); |
1196 | } else { | 1196 | } else { |
1197 | atomic64_inc(&alg->stats.compress.decompress_cnt); | 1197 | atomic64_inc(&alg->stats.compress.decompress_cnt); |
1198 | atomic64_add(slen, &alg->stats.compress.decompress_tlen); | 1198 | atomic64_add(slen, &alg->stats.compress.decompress_tlen); |
@@ -1205,7 +1205,7 @@ void crypto_stats_ahash_update(unsigned int nbytes, int ret, | |||
1205 | struct crypto_alg *alg) | 1205 | struct crypto_alg *alg) |
1206 | { | 1206 | { |
1207 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) | 1207 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) |
1208 | atomic64_inc(&alg->stats.hash.hash_err_cnt); | 1208 | atomic64_inc(&alg->stats.hash.err_cnt); |
1209 | else | 1209 | else |
1210 | atomic64_add(nbytes, &alg->stats.hash.hash_tlen); | 1210 | atomic64_add(nbytes, &alg->stats.hash.hash_tlen); |
1211 | crypto_alg_put(alg); | 1211 | crypto_alg_put(alg); |
@@ -1216,7 +1216,7 @@ void crypto_stats_ahash_final(unsigned int nbytes, int ret, | |||
1216 | struct crypto_alg *alg) | 1216 | struct crypto_alg *alg) |
1217 | { | 1217 | { |
1218 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { | 1218 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { |
1219 | atomic64_inc(&alg->stats.hash.hash_err_cnt); | 1219 | atomic64_inc(&alg->stats.hash.err_cnt); |
1220 | } else { | 1220 | } else { |
1221 | atomic64_inc(&alg->stats.hash.hash_cnt); | 1221 | atomic64_inc(&alg->stats.hash.hash_cnt); |
1222 | atomic64_add(nbytes, &alg->stats.hash.hash_tlen); | 1222 | atomic64_add(nbytes, &alg->stats.hash.hash_tlen); |
@@ -1228,7 +1228,7 @@ EXPORT_SYMBOL_GPL(crypto_stats_ahash_final); | |||
1228 | void crypto_stats_kpp_set_secret(struct crypto_alg *alg, int ret) | 1228 | void crypto_stats_kpp_set_secret(struct crypto_alg *alg, int ret) |
1229 | { | 1229 | { |
1230 | if (ret) | 1230 | if (ret) |
1231 | atomic64_inc(&alg->stats.kpp.kpp_err_cnt); | 1231 | atomic64_inc(&alg->stats.kpp.err_cnt); |
1232 | else | 1232 | else |
1233 | atomic64_inc(&alg->stats.kpp.setsecret_cnt); | 1233 | atomic64_inc(&alg->stats.kpp.setsecret_cnt); |
1234 | crypto_alg_put(alg); | 1234 | crypto_alg_put(alg); |
@@ -1238,7 +1238,7 @@ EXPORT_SYMBOL_GPL(crypto_stats_kpp_set_secret); | |||
1238 | void crypto_stats_kpp_generate_public_key(struct crypto_alg *alg, int ret) | 1238 | void crypto_stats_kpp_generate_public_key(struct crypto_alg *alg, int ret) |
1239 | { | 1239 | { |
1240 | if (ret) | 1240 | if (ret) |
1241 | atomic64_inc(&alg->stats.kpp.kpp_err_cnt); | 1241 | atomic64_inc(&alg->stats.kpp.err_cnt); |
1242 | else | 1242 | else |
1243 | atomic64_inc(&alg->stats.kpp.generate_public_key_cnt); | 1243 | atomic64_inc(&alg->stats.kpp.generate_public_key_cnt); |
1244 | crypto_alg_put(alg); | 1244 | crypto_alg_put(alg); |
@@ -1248,7 +1248,7 @@ EXPORT_SYMBOL_GPL(crypto_stats_kpp_generate_public_key); | |||
1248 | void crypto_stats_kpp_compute_shared_secret(struct crypto_alg *alg, int ret) | 1248 | void crypto_stats_kpp_compute_shared_secret(struct crypto_alg *alg, int ret) |
1249 | { | 1249 | { |
1250 | if (ret) | 1250 | if (ret) |
1251 | atomic64_inc(&alg->stats.kpp.kpp_err_cnt); | 1251 | atomic64_inc(&alg->stats.kpp.err_cnt); |
1252 | else | 1252 | else |
1253 | atomic64_inc(&alg->stats.kpp.compute_shared_secret_cnt); | 1253 | atomic64_inc(&alg->stats.kpp.compute_shared_secret_cnt); |
1254 | crypto_alg_put(alg); | 1254 | crypto_alg_put(alg); |
@@ -1258,7 +1258,7 @@ EXPORT_SYMBOL_GPL(crypto_stats_kpp_compute_shared_secret); | |||
1258 | void crypto_stats_rng_seed(struct crypto_alg *alg, int ret) | 1258 | void crypto_stats_rng_seed(struct crypto_alg *alg, int ret) |
1259 | { | 1259 | { |
1260 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) | 1260 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) |
1261 | atomic64_inc(&alg->stats.rng.rng_err_cnt); | 1261 | atomic64_inc(&alg->stats.rng.err_cnt); |
1262 | else | 1262 | else |
1263 | atomic64_inc(&alg->stats.rng.seed_cnt); | 1263 | atomic64_inc(&alg->stats.rng.seed_cnt); |
1264 | crypto_alg_put(alg); | 1264 | crypto_alg_put(alg); |
@@ -1269,7 +1269,7 @@ void crypto_stats_rng_generate(struct crypto_alg *alg, unsigned int dlen, | |||
1269 | int ret) | 1269 | int ret) |
1270 | { | 1270 | { |
1271 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { | 1271 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { |
1272 | atomic64_inc(&alg->stats.rng.rng_err_cnt); | 1272 | atomic64_inc(&alg->stats.rng.err_cnt); |
1273 | } else { | 1273 | } else { |
1274 | atomic64_inc(&alg->stats.rng.generate_cnt); | 1274 | atomic64_inc(&alg->stats.rng.generate_cnt); |
1275 | atomic64_add(dlen, &alg->stats.rng.generate_tlen); | 1275 | atomic64_add(dlen, &alg->stats.rng.generate_tlen); |
@@ -1282,7 +1282,7 @@ void crypto_stats_skcipher_encrypt(unsigned int cryptlen, int ret, | |||
1282 | struct crypto_alg *alg) | 1282 | struct crypto_alg *alg) |
1283 | { | 1283 | { |
1284 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { | 1284 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { |
1285 | atomic64_inc(&alg->stats.cipher.cipher_err_cnt); | 1285 | atomic64_inc(&alg->stats.cipher.err_cnt); |
1286 | } else { | 1286 | } else { |
1287 | atomic64_inc(&alg->stats.cipher.encrypt_cnt); | 1287 | atomic64_inc(&alg->stats.cipher.encrypt_cnt); |
1288 | atomic64_add(cryptlen, &alg->stats.cipher.encrypt_tlen); | 1288 | atomic64_add(cryptlen, &alg->stats.cipher.encrypt_tlen); |
@@ -1295,7 +1295,7 @@ void crypto_stats_skcipher_decrypt(unsigned int cryptlen, int ret, | |||
1295 | struct crypto_alg *alg) | 1295 | struct crypto_alg *alg) |
1296 | { | 1296 | { |
1297 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { | 1297 | if (ret && ret != -EINPROGRESS && ret != -EBUSY) { |
1298 | atomic64_inc(&alg->stats.cipher.cipher_err_cnt); | 1298 | atomic64_inc(&alg->stats.cipher.err_cnt); |
1299 | } else { | 1299 | } else { |
1300 | atomic64_inc(&alg->stats.cipher.decrypt_cnt); | 1300 | atomic64_inc(&alg->stats.cipher.decrypt_cnt); |
1301 | atomic64_add(cryptlen, &alg->stats.cipher.decrypt_tlen); | 1301 | atomic64_add(cryptlen, &alg->stats.cipher.decrypt_tlen); |