1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef ISCSI_TARGET_STAT_H
3 #define ISCSI_TARGET_STAT_H
5 #include <linux/types.h>
6 #include <linux/spinlock.h>
7 #include <linux/socket.h>
10 * For struct iscsi_tiqn->tiqn_wwn default groups
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;
19 * For struct iscsi_session->se_sess default groups
21 extern const struct config_item_type iscsi_stat_sess_cit;
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
29 /* iSCSI session error stats */
30 struct iscsi_sess_err_stats {
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;
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
46 /* iSCSI login stats */
47 struct iscsi_login_stats {
53 u32 authenticate_fails;
54 u32 negotiate_fails; /* used for notifications */
55 u64 last_fail_time; /* time stamp (jiffies) */
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;
62 /* iSCSI logout stats */
63 struct iscsi_logout_stats {
67 } ____cacheline_aligned;
69 #endif /*** ISCSI_TARGET_STAT_H ***/