Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef ISCSI_TARGET_STAT_H
0003 #define ISCSI_TARGET_STAT_H
0004 
0005 #include <linux/types.h>
0006 #include <linux/spinlock.h>
0007 #include <linux/socket.h>
0008 
0009 /*
0010  * For struct iscsi_tiqn->tiqn_wwn default groups
0011  */
0012 extern const struct config_item_type iscsi_stat_instance_cit;
0013 extern const struct config_item_type iscsi_stat_sess_err_cit;
0014 extern const struct config_item_type iscsi_stat_tgt_attr_cit;
0015 extern const struct config_item_type iscsi_stat_login_cit;
0016 extern const struct config_item_type iscsi_stat_logout_cit;
0017 
0018 /*
0019  * For struct iscsi_session->se_sess default groups
0020  */
0021 extern const struct config_item_type iscsi_stat_sess_cit;
0022 
0023 /* iSCSI session error types */
0024 #define ISCSI_SESS_ERR_UNKNOWN      0
0025 #define ISCSI_SESS_ERR_DIGEST       1
0026 #define ISCSI_SESS_ERR_CXN_TIMEOUT  2
0027 #define ISCSI_SESS_ERR_PDU_FORMAT   3
0028 
0029 /* iSCSI session error stats */
0030 struct iscsi_sess_err_stats {
0031     spinlock_t  lock;
0032     u32     digest_errors;
0033     u32     cxn_timeout_errors;
0034     u32     pdu_format_errors;
0035     u32     last_sess_failure_type;
0036     char        last_sess_fail_rem_name[ISCSI_IQN_LEN];
0037 } ____cacheline_aligned;
0038 
0039 /* iSCSI login failure types (sub oids) */
0040 #define ISCSI_LOGIN_FAIL_OTHER      2
0041 #define ISCSI_LOGIN_FAIL_REDIRECT   3
0042 #define ISCSI_LOGIN_FAIL_AUTHORIZE  4
0043 #define ISCSI_LOGIN_FAIL_AUTHENTICATE   5
0044 #define ISCSI_LOGIN_FAIL_NEGOTIATE  6
0045 
0046 /* iSCSI login stats */
0047 struct iscsi_login_stats {
0048     spinlock_t  lock;
0049     u32     accepts;
0050     u32     other_fails;
0051     u32     redirects;
0052     u32     authorize_fails;
0053     u32     authenticate_fails;
0054     u32     negotiate_fails;    /* used for notifications */
0055     u64     last_fail_time;     /* time stamp (jiffies) */
0056     u32     last_fail_type;
0057     int     last_intr_fail_ip_family;
0058     struct sockaddr_storage last_intr_fail_sockaddr;
0059     char        last_intr_fail_name[ISCSI_IQN_LEN];
0060 } ____cacheline_aligned;
0061 
0062 /* iSCSI logout stats */
0063 struct iscsi_logout_stats {
0064     spinlock_t  lock;
0065     u32     normal_logouts;
0066     u32     abnormal_logouts;
0067 } ____cacheline_aligned;
0068 
0069 #endif   /*** ISCSI_TARGET_STAT_H ***/