xref: /linux/drivers/crypto/intel/iaa/iaa_crypto_stats.h (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright(c) 2021 Intel Corporation. All rights rsvd. */
3 
4 #ifndef __CRYPTO_DEV_IAA_CRYPTO_STATS_H__
5 #define __CRYPTO_DEV_IAA_CRYPTO_STATS_H__
6 
7 #if defined(CONFIG_CRYPTO_DEV_IAA_CRYPTO_STATS)
8 int	iaa_crypto_debugfs_init(void);
9 void	iaa_crypto_debugfs_cleanup(void);
10 
11 void	update_total_comp_calls(void);
12 void	update_total_comp_bytes_out(int n);
13 void	update_total_decomp_calls(void);
14 void	update_total_sw_decomp_calls(void);
15 void	update_total_decomp_bytes_in(int n);
16 void	update_completion_einval_errs(void);
17 void	update_completion_timeout_errs(void);
18 void	update_completion_comp_buf_overflow_errs(void);
19 
20 void	update_wq_comp_calls(struct idxd_wq *idxd_wq);
21 void	update_wq_comp_bytes(struct idxd_wq *idxd_wq, int n);
22 void	update_wq_decomp_calls(struct idxd_wq *idxd_wq);
23 void	update_wq_decomp_bytes(struct idxd_wq *idxd_wq, int n);
24 
25 #else
26 static inline int	iaa_crypto_debugfs_init(void) { return 0; }
27 static inline void	iaa_crypto_debugfs_cleanup(void) {}
28 
29 static inline void	update_total_comp_calls(void) {}
30 static inline void	update_total_comp_bytes_out(int n) {}
31 static inline void	update_total_decomp_calls(void) {}
32 static inline void	update_total_sw_decomp_calls(void) {}
33 static inline void	update_total_decomp_bytes_in(int n) {}
34 static inline void	update_completion_einval_errs(void) {}
35 static inline void	update_completion_timeout_errs(void) {}
36 static inline void	update_completion_comp_buf_overflow_errs(void) {}
37 
38 static inline void	update_wq_comp_calls(struct idxd_wq *idxd_wq) {}
39 static inline void	update_wq_comp_bytes(struct idxd_wq *idxd_wq, int n) {}
40 static inline void	update_wq_decomp_calls(struct idxd_wq *idxd_wq) {}
41 static inline void	update_wq_decomp_bytes(struct idxd_wq *idxd_wq, int n) {}
42 
43 #endif // CONFIG_CRYPTO_DEV_IAA_CRYPTO_STATS
44 
45 #endif
46