iscsi_target_stat.h 1.9 KB

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