iscsi_target_stat.h 1.8 KB

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