blob: c27dd471656dc2da4745516d47253b5d06285cf3 [file] [log] [blame]
Nicholas Bellingere48354c2011-07-23 06:43:04 +00001#ifndef ISCSI_TARGET_STAT_H
2#define ISCSI_TARGET_STAT_H
3
Bart Van Assche8dcf07b2016-11-14 15:47:14 -08004#include <linux/types.h>
5#include <linux/spinlock.h>
6#include <linux/socket.h>
7
Nicholas Bellingere48354c2011-07-23 06:43:04 +00008/*
9 * For struct iscsi_tiqn->tiqn_wwn default groups
10 */
11extern struct config_item_type iscsi_stat_instance_cit;
12extern struct config_item_type iscsi_stat_sess_err_cit;
13extern struct config_item_type iscsi_stat_tgt_attr_cit;
14extern struct config_item_type iscsi_stat_login_cit;
15extern struct config_item_type iscsi_stat_logout_cit;
16
17/*
18 * For struct iscsi_session->se_sess default groups
19 */
20extern struct config_item_type iscsi_stat_sess_cit;
21
22/* iSCSI session error types */
23#define ISCSI_SESS_ERR_UNKNOWN 0
24#define ISCSI_SESS_ERR_DIGEST 1
25#define ISCSI_SESS_ERR_CXN_TIMEOUT 2
26#define ISCSI_SESS_ERR_PDU_FORMAT 3
27
28/* iSCSI session error stats */
29struct iscsi_sess_err_stats {
30 spinlock_t lock;
31 u32 digest_errors;
32 u32 cxn_timeout_errors;
33 u32 pdu_format_errors;
34 u32 last_sess_failure_type;
35 char last_sess_fail_rem_name[224];
36} ____cacheline_aligned;
37
38/* iSCSI login failure types (sub oids) */
39#define ISCSI_LOGIN_FAIL_OTHER 2
40#define ISCSI_LOGIN_FAIL_REDIRECT 3
41#define ISCSI_LOGIN_FAIL_AUTHORIZE 4
42#define ISCSI_LOGIN_FAIL_AUTHENTICATE 5
43#define ISCSI_LOGIN_FAIL_NEGOTIATE 6
44
45/* iSCSI login stats */
46struct iscsi_login_stats {
47 spinlock_t lock;
48 u32 accepts;
49 u32 other_fails;
50 u32 redirects;
51 u32 authorize_fails;
52 u32 authenticate_fails;
53 u32 negotiate_fails; /* used for notifications */
54 u64 last_fail_time; /* time stamp (jiffies) */
55 u32 last_fail_type;
56 int last_intr_fail_ip_family;
Andy Grover13a3cf02015-08-24 10:26:06 -070057 struct sockaddr_storage last_intr_fail_sockaddr;
Nicholas Bellingere48354c2011-07-23 06:43:04 +000058 char last_intr_fail_name[224];
59} ____cacheline_aligned;
60
61/* iSCSI logout stats */
62struct iscsi_logout_stats {
63 spinlock_t lock;
64 u32 normal_logouts;
65 u32 abnormal_logouts;
66} ____cacheline_aligned;
67
68#endif /*** ISCSI_TARGET_STAT_H ***/