• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef ISCSI_TARGET_STAT_H
3 #define ISCSI_TARGET_STAT_H
4 
5 #include <linux/types.h>
6 #include <linux/spinlock.h>
7 #include <linux/socket.h>
8 
9 /*
10  * For struct iscsi_tiqn->tiqn_wwn default groups
11  */
12 extern const struct config_item_type iscsi_stat_instance_cit;
13 extern const struct config_item_type iscsi_stat_sess_err_cit;
14 extern const struct config_item_type iscsi_stat_tgt_attr_cit;
15 extern const struct config_item_type iscsi_stat_login_cit;
16 extern const struct config_item_type iscsi_stat_logout_cit;
17 
18 /*
19  * For struct iscsi_session->se_sess default groups
20  */
21 extern const struct config_item_type iscsi_stat_sess_cit;
22 
23 /* iSCSI session error types */
24 #define ISCSI_SESS_ERR_UNKNOWN		0
25 #define ISCSI_SESS_ERR_DIGEST		1
26 #define ISCSI_SESS_ERR_CXN_TIMEOUT	2
27 #define ISCSI_SESS_ERR_PDU_FORMAT	3
28 
29 /* iSCSI session error stats */
30 struct iscsi_sess_err_stats {
31 	spinlock_t	lock;
32 	u32		digest_errors;
33 	u32		cxn_timeout_errors;
34 	u32		pdu_format_errors;
35 	u32		last_sess_failure_type;
36 	char		last_sess_fail_rem_name[ISCSI_IQN_LEN];
37 } ____cacheline_aligned;
38 
39 /* iSCSI login failure types (sub oids) */
40 #define ISCSI_LOGIN_FAIL_OTHER		2
41 #define ISCSI_LOGIN_FAIL_REDIRECT	3
42 #define ISCSI_LOGIN_FAIL_AUTHORIZE	4
43 #define ISCSI_LOGIN_FAIL_AUTHENTICATE	5
44 #define ISCSI_LOGIN_FAIL_NEGOTIATE	6
45 
46 /* iSCSI login stats */
47 struct iscsi_login_stats {
48 	spinlock_t	lock;
49 	u32		accepts;
50 	u32		other_fails;
51 	u32		redirects;
52 	u32		authorize_fails;
53 	u32		authenticate_fails;
54 	u32		negotiate_fails;	/* used for notifications */
55 	u64		last_fail_time;		/* time stamp (jiffies) */
56 	u32		last_fail_type;
57 	int		last_intr_fail_ip_family;
58 	struct sockaddr_storage last_intr_fail_sockaddr;
59 	char		last_intr_fail_name[ISCSI_IQN_LEN];
60 } ____cacheline_aligned;
61 
62 /* iSCSI logout stats */
63 struct iscsi_logout_stats {
64 	spinlock_t	lock;
65 	u32		normal_logouts;
66 	u32		abnormal_logouts;
67 } ____cacheline_aligned;
68 
69 #endif   /*** ISCSI_TARGET_STAT_H ***/
70