Thomas Gleixner | c942fdd | 2019-05-27 08:55:06 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 2 | /******************************************************************************* |
| 3 | * Modern ConfigFS group context specific iSCSI statistics based on original |
| 4 | * iscsi_target_mib.c code |
| 5 | * |
Nicholas Bellinger | 4c76251 | 2013-09-05 15:29:12 -0700 | [diff] [blame] | 6 | * Copyright (c) 2011-2013 Datera, Inc. |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 7 | * |
| 8 | * Author: Nicholas A. Bellinger <nab@linux-iscsi.org> |
| 9 | * |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 10 | ******************************************************************************/ |
| 11 | |
| 12 | #include <linux/configfs.h> |
Paul Gortmaker | c53181a | 2011-08-30 18:16:43 -0400 | [diff] [blame] | 13 | #include <linux/export.h> |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 14 | #include <scsi/iscsi_proto.h> |
| 15 | #include <target/target_core_base.h> |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 16 | |
Sagi Grimberg | 67f091f | 2015-01-07 14:57:31 +0200 | [diff] [blame] | 17 | #include <target/iscsi/iscsi_target_core.h> |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 18 | #include "iscsi_target_parameters.h" |
| 19 | #include "iscsi_target_device.h" |
| 20 | #include "iscsi_target_tpg.h" |
| 21 | #include "iscsi_target_util.h" |
Sagi Grimberg | 67f091f | 2015-01-07 14:57:31 +0200 | [diff] [blame] | 22 | #include <target/iscsi/iscsi_target_stat.h> |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 23 | |
| 24 | #ifndef INITIAL_JIFFIES |
| 25 | #define INITIAL_JIFFIES ((unsigned long)(unsigned int) (-300*HZ)) |
| 26 | #endif |
| 27 | |
| 28 | /* Instance Attributes Table */ |
| 29 | #define ISCSI_INST_NUM_NODES 1 |
| 30 | #define ISCSI_INST_DESCR "Storage Engine Target" |
| 31 | #define ISCSI_INST_LAST_FAILURE_TYPE 0 |
| 32 | #define ISCSI_DISCONTINUITY_TIME 0 |
| 33 | |
| 34 | #define ISCSI_NODE_INDEX 1 |
| 35 | |
| 36 | #define ISPRINT(a) ((a >= ' ') && (a <= '~')) |
| 37 | |
| 38 | /**************************************************************************** |
| 39 | * iSCSI MIB Tables |
| 40 | ****************************************************************************/ |
| 41 | /* |
| 42 | * Instance Attributes Table |
| 43 | */ |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 44 | static struct iscsi_tiqn *iscsi_instance_tiqn(struct config_item *item) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 45 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 46 | struct iscsi_wwn_stat_grps *igrps = container_of(to_config_group(item), |
| 47 | struct iscsi_wwn_stat_grps, iscsi_instance_group); |
| 48 | return container_of(igrps, struct iscsi_tiqn, tiqn_stat_grps); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 49 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 50 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 51 | static ssize_t iscsi_stat_instance_inst_show(struct config_item *item, |
| 52 | char *page) |
| 53 | { |
| 54 | return snprintf(page, PAGE_SIZE, "%u\n", |
| 55 | iscsi_instance_tiqn(item)->tiqn_index); |
| 56 | } |
| 57 | |
| 58 | static ssize_t iscsi_stat_instance_min_ver_show(struct config_item *item, |
| 59 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 60 | { |
| 61 | return snprintf(page, PAGE_SIZE, "%u\n", ISCSI_DRAFT20_VERSION); |
| 62 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 63 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 64 | static ssize_t iscsi_stat_instance_max_ver_show(struct config_item *item, |
| 65 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 66 | { |
| 67 | return snprintf(page, PAGE_SIZE, "%u\n", ISCSI_DRAFT20_VERSION); |
| 68 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 69 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 70 | static ssize_t iscsi_stat_instance_portals_show(struct config_item *item, |
| 71 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 72 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 73 | return snprintf(page, PAGE_SIZE, "%u\n", |
| 74 | iscsi_instance_tiqn(item)->tiqn_num_tpg_nps); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 75 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 76 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 77 | static ssize_t iscsi_stat_instance_nodes_show(struct config_item *item, |
| 78 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 79 | { |
| 80 | return snprintf(page, PAGE_SIZE, "%u\n", ISCSI_INST_NUM_NODES); |
| 81 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 82 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 83 | static ssize_t iscsi_stat_instance_sessions_show(struct config_item *item, |
| 84 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 85 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 86 | return snprintf(page, PAGE_SIZE, "%u\n", |
| 87 | iscsi_instance_tiqn(item)->tiqn_nsessions); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 88 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 89 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 90 | static ssize_t iscsi_stat_instance_fail_sess_show(struct config_item *item, |
| 91 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 92 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 93 | struct iscsi_tiqn *tiqn = iscsi_instance_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 94 | struct iscsi_sess_err_stats *sess_err = &tiqn->sess_err_stats; |
| 95 | u32 sess_err_count; |
| 96 | |
| 97 | spin_lock_bh(&sess_err->lock); |
| 98 | sess_err_count = (sess_err->digest_errors + |
| 99 | sess_err->cxn_timeout_errors + |
| 100 | sess_err->pdu_format_errors); |
| 101 | spin_unlock_bh(&sess_err->lock); |
| 102 | |
| 103 | return snprintf(page, PAGE_SIZE, "%u\n", sess_err_count); |
| 104 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 105 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 106 | static ssize_t iscsi_stat_instance_fail_type_show(struct config_item *item, |
| 107 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 108 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 109 | struct iscsi_tiqn *tiqn = iscsi_instance_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 110 | struct iscsi_sess_err_stats *sess_err = &tiqn->sess_err_stats; |
| 111 | |
| 112 | return snprintf(page, PAGE_SIZE, "%u\n", |
| 113 | sess_err->last_sess_failure_type); |
| 114 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 115 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 116 | static ssize_t iscsi_stat_instance_fail_rem_name_show(struct config_item *item, |
| 117 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 118 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 119 | struct iscsi_tiqn *tiqn = iscsi_instance_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 120 | struct iscsi_sess_err_stats *sess_err = &tiqn->sess_err_stats; |
| 121 | |
| 122 | return snprintf(page, PAGE_SIZE, "%s\n", |
| 123 | sess_err->last_sess_fail_rem_name[0] ? |
| 124 | sess_err->last_sess_fail_rem_name : NONE); |
| 125 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 126 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 127 | static ssize_t iscsi_stat_instance_disc_time_show(struct config_item *item, |
| 128 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 129 | { |
| 130 | return snprintf(page, PAGE_SIZE, "%u\n", ISCSI_DISCONTINUITY_TIME); |
| 131 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 132 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 133 | static ssize_t iscsi_stat_instance_description_show(struct config_item *item, |
| 134 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 135 | { |
| 136 | return snprintf(page, PAGE_SIZE, "%s\n", ISCSI_INST_DESCR); |
| 137 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 138 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 139 | static ssize_t iscsi_stat_instance_vendor_show(struct config_item *item, |
| 140 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 141 | { |
Nicholas Bellinger | 4c76251 | 2013-09-05 15:29:12 -0700 | [diff] [blame] | 142 | return snprintf(page, PAGE_SIZE, "Datera, Inc. iSCSI-Target\n"); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 143 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 144 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 145 | static ssize_t iscsi_stat_instance_version_show(struct config_item *item, |
| 146 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 147 | { |
| 148 | return snprintf(page, PAGE_SIZE, "%s\n", ISCSIT_VERSION); |
| 149 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 150 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 151 | CONFIGFS_ATTR_RO(iscsi_stat_instance_, inst); |
| 152 | CONFIGFS_ATTR_RO(iscsi_stat_instance_, min_ver); |
| 153 | CONFIGFS_ATTR_RO(iscsi_stat_instance_, max_ver); |
| 154 | CONFIGFS_ATTR_RO(iscsi_stat_instance_, portals); |
| 155 | CONFIGFS_ATTR_RO(iscsi_stat_instance_, nodes); |
| 156 | CONFIGFS_ATTR_RO(iscsi_stat_instance_, sessions); |
| 157 | CONFIGFS_ATTR_RO(iscsi_stat_instance_, fail_sess); |
| 158 | CONFIGFS_ATTR_RO(iscsi_stat_instance_, fail_type); |
| 159 | CONFIGFS_ATTR_RO(iscsi_stat_instance_, fail_rem_name); |
| 160 | CONFIGFS_ATTR_RO(iscsi_stat_instance_, disc_time); |
| 161 | CONFIGFS_ATTR_RO(iscsi_stat_instance_, description); |
| 162 | CONFIGFS_ATTR_RO(iscsi_stat_instance_, vendor); |
| 163 | CONFIGFS_ATTR_RO(iscsi_stat_instance_, version); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 164 | |
| 165 | static struct configfs_attribute *iscsi_stat_instance_attrs[] = { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 166 | &iscsi_stat_instance_attr_inst, |
| 167 | &iscsi_stat_instance_attr_min_ver, |
| 168 | &iscsi_stat_instance_attr_max_ver, |
| 169 | &iscsi_stat_instance_attr_portals, |
| 170 | &iscsi_stat_instance_attr_nodes, |
| 171 | &iscsi_stat_instance_attr_sessions, |
| 172 | &iscsi_stat_instance_attr_fail_sess, |
| 173 | &iscsi_stat_instance_attr_fail_type, |
| 174 | &iscsi_stat_instance_attr_fail_rem_name, |
| 175 | &iscsi_stat_instance_attr_disc_time, |
| 176 | &iscsi_stat_instance_attr_description, |
| 177 | &iscsi_stat_instance_attr_vendor, |
| 178 | &iscsi_stat_instance_attr_version, |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 179 | NULL, |
| 180 | }; |
| 181 | |
Bhumika Goyal | ece550b | 2017-10-16 17:18:42 +0200 | [diff] [blame] | 182 | const struct config_item_type iscsi_stat_instance_cit = { |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 183 | .ct_attrs = iscsi_stat_instance_attrs, |
| 184 | .ct_owner = THIS_MODULE, |
| 185 | }; |
| 186 | |
| 187 | /* |
| 188 | * Instance Session Failure Stats Table |
| 189 | */ |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 190 | static struct iscsi_tiqn *iscsi_sess_err_tiqn(struct config_item *item) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 191 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 192 | struct iscsi_wwn_stat_grps *igrps = container_of(to_config_group(item), |
| 193 | struct iscsi_wwn_stat_grps, iscsi_sess_err_group); |
| 194 | return container_of(igrps, struct iscsi_tiqn, tiqn_stat_grps); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 195 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 196 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 197 | static ssize_t iscsi_stat_sess_err_inst_show(struct config_item *item, |
| 198 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 199 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 200 | return snprintf(page, PAGE_SIZE, "%u\n", |
| 201 | iscsi_sess_err_tiqn(item)->tiqn_index); |
| 202 | } |
| 203 | |
| 204 | static ssize_t iscsi_stat_sess_err_digest_errors_show(struct config_item *item, |
| 205 | char *page) |
| 206 | { |
| 207 | struct iscsi_tiqn *tiqn = iscsi_sess_err_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 208 | struct iscsi_sess_err_stats *sess_err = &tiqn->sess_err_stats; |
| 209 | |
| 210 | return snprintf(page, PAGE_SIZE, "%u\n", sess_err->digest_errors); |
| 211 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 212 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 213 | static ssize_t iscsi_stat_sess_err_cxn_errors_show(struct config_item *item, |
| 214 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 215 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 216 | struct iscsi_tiqn *tiqn = iscsi_sess_err_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 217 | struct iscsi_sess_err_stats *sess_err = &tiqn->sess_err_stats; |
| 218 | |
| 219 | return snprintf(page, PAGE_SIZE, "%u\n", sess_err->cxn_timeout_errors); |
| 220 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 221 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 222 | static ssize_t iscsi_stat_sess_err_format_errors_show(struct config_item *item, |
| 223 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 224 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 225 | struct iscsi_tiqn *tiqn = iscsi_sess_err_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 226 | struct iscsi_sess_err_stats *sess_err = &tiqn->sess_err_stats; |
| 227 | |
| 228 | return snprintf(page, PAGE_SIZE, "%u\n", sess_err->pdu_format_errors); |
| 229 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 230 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 231 | CONFIGFS_ATTR_RO(iscsi_stat_sess_err_, inst); |
| 232 | CONFIGFS_ATTR_RO(iscsi_stat_sess_err_, digest_errors); |
| 233 | CONFIGFS_ATTR_RO(iscsi_stat_sess_err_, cxn_errors); |
| 234 | CONFIGFS_ATTR_RO(iscsi_stat_sess_err_, format_errors); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 235 | |
| 236 | static struct configfs_attribute *iscsi_stat_sess_err_attrs[] = { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 237 | &iscsi_stat_sess_err_attr_inst, |
| 238 | &iscsi_stat_sess_err_attr_digest_errors, |
| 239 | &iscsi_stat_sess_err_attr_cxn_errors, |
| 240 | &iscsi_stat_sess_err_attr_format_errors, |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 241 | NULL, |
| 242 | }; |
| 243 | |
Bhumika Goyal | ece550b | 2017-10-16 17:18:42 +0200 | [diff] [blame] | 244 | const struct config_item_type iscsi_stat_sess_err_cit = { |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 245 | .ct_attrs = iscsi_stat_sess_err_attrs, |
| 246 | .ct_owner = THIS_MODULE, |
| 247 | }; |
| 248 | |
| 249 | /* |
| 250 | * Target Attributes Table |
| 251 | */ |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 252 | static struct iscsi_tiqn *iscsi_tgt_attr_tiqn(struct config_item *item) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 253 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 254 | struct iscsi_wwn_stat_grps *igrps = container_of(to_config_group(item), |
| 255 | struct iscsi_wwn_stat_grps, iscsi_tgt_attr_group); |
| 256 | return container_of(igrps, struct iscsi_tiqn, tiqn_stat_grps); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 257 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 258 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 259 | static ssize_t iscsi_stat_tgt_attr_inst_show(struct config_item *item, |
| 260 | char *page) |
| 261 | { |
| 262 | return snprintf(page, PAGE_SIZE, "%u\n", |
| 263 | iscsi_tgt_attr_tiqn(item)->tiqn_index); |
| 264 | } |
| 265 | |
| 266 | static ssize_t iscsi_stat_tgt_attr_indx_show(struct config_item *item, |
| 267 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 268 | { |
| 269 | return snprintf(page, PAGE_SIZE, "%u\n", ISCSI_NODE_INDEX); |
| 270 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 271 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 272 | static ssize_t iscsi_stat_tgt_attr_login_fails_show(struct config_item *item, |
| 273 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 274 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 275 | struct iscsi_tiqn *tiqn = iscsi_tgt_attr_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 276 | struct iscsi_login_stats *lstat = &tiqn->login_stats; |
| 277 | u32 fail_count; |
| 278 | |
| 279 | spin_lock(&lstat->lock); |
| 280 | fail_count = (lstat->redirects + lstat->authorize_fails + |
| 281 | lstat->authenticate_fails + lstat->negotiate_fails + |
| 282 | lstat->other_fails); |
| 283 | spin_unlock(&lstat->lock); |
| 284 | |
| 285 | return snprintf(page, PAGE_SIZE, "%u\n", fail_count); |
| 286 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 287 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 288 | static ssize_t iscsi_stat_tgt_attr_last_fail_time_show(struct config_item *item, |
| 289 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 290 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 291 | struct iscsi_tiqn *tiqn = iscsi_tgt_attr_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 292 | struct iscsi_login_stats *lstat = &tiqn->login_stats; |
| 293 | u32 last_fail_time; |
| 294 | |
| 295 | spin_lock(&lstat->lock); |
| 296 | last_fail_time = lstat->last_fail_time ? |
| 297 | (u32)(((u32)lstat->last_fail_time - |
| 298 | INITIAL_JIFFIES) * 100 / HZ) : 0; |
| 299 | spin_unlock(&lstat->lock); |
| 300 | |
| 301 | return snprintf(page, PAGE_SIZE, "%u\n", last_fail_time); |
| 302 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 303 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 304 | static ssize_t iscsi_stat_tgt_attr_last_fail_type_show(struct config_item *item, |
| 305 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 306 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 307 | struct iscsi_tiqn *tiqn = iscsi_tgt_attr_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 308 | struct iscsi_login_stats *lstat = &tiqn->login_stats; |
| 309 | u32 last_fail_type; |
| 310 | |
| 311 | spin_lock(&lstat->lock); |
| 312 | last_fail_type = lstat->last_fail_type; |
| 313 | spin_unlock(&lstat->lock); |
| 314 | |
| 315 | return snprintf(page, PAGE_SIZE, "%u\n", last_fail_type); |
| 316 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 317 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 318 | static ssize_t iscsi_stat_tgt_attr_fail_intr_name_show(struct config_item *item, |
| 319 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 320 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 321 | struct iscsi_tiqn *tiqn = iscsi_tgt_attr_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 322 | struct iscsi_login_stats *lstat = &tiqn->login_stats; |
David Disseldorp | df71155 | 2018-10-12 12:01:16 +0200 | [diff] [blame] | 323 | unsigned char buf[ISCSI_IQN_LEN]; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 324 | |
| 325 | spin_lock(&lstat->lock); |
David Disseldorp | df71155 | 2018-10-12 12:01:16 +0200 | [diff] [blame] | 326 | snprintf(buf, ISCSI_IQN_LEN, "%s", lstat->last_intr_fail_name[0] ? |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 327 | lstat->last_intr_fail_name : NONE); |
| 328 | spin_unlock(&lstat->lock); |
| 329 | |
| 330 | return snprintf(page, PAGE_SIZE, "%s\n", buf); |
| 331 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 332 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 333 | static ssize_t iscsi_stat_tgt_attr_fail_intr_addr_type_show(struct config_item *item, |
| 334 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 335 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 336 | struct iscsi_tiqn *tiqn = iscsi_tgt_attr_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 337 | struct iscsi_login_stats *lstat = &tiqn->login_stats; |
Dan Carpenter | 07ea81b | 2013-01-31 11:17:54 +0300 | [diff] [blame] | 338 | int ret; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 339 | |
| 340 | spin_lock(&lstat->lock); |
Dan Carpenter | 07ea81b | 2013-01-31 11:17:54 +0300 | [diff] [blame] | 341 | if (lstat->last_intr_fail_ip_family == AF_INET6) |
| 342 | ret = snprintf(page, PAGE_SIZE, "ipv6\n"); |
| 343 | else |
| 344 | ret = snprintf(page, PAGE_SIZE, "ipv4\n"); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 345 | spin_unlock(&lstat->lock); |
| 346 | |
Dan Carpenter | 07ea81b | 2013-01-31 11:17:54 +0300 | [diff] [blame] | 347 | return ret; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 348 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 349 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 350 | static ssize_t iscsi_stat_tgt_attr_fail_intr_addr_show(struct config_item *item, |
| 351 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 352 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 353 | struct iscsi_tiqn *tiqn = iscsi_tgt_attr_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 354 | struct iscsi_login_stats *lstat = &tiqn->login_stats; |
Dan Carpenter | 0e48e7a | 2013-01-31 11:19:09 +0300 | [diff] [blame] | 355 | int ret; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 356 | |
| 357 | spin_lock(&lstat->lock); |
Andy Grover | dc58f76 | 2015-08-24 10:26:05 -0700 | [diff] [blame] | 358 | ret = snprintf(page, PAGE_SIZE, "%pISc\n", &lstat->last_intr_fail_sockaddr); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 359 | spin_unlock(&lstat->lock); |
| 360 | |
Dan Carpenter | 0e48e7a | 2013-01-31 11:19:09 +0300 | [diff] [blame] | 361 | return ret; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 362 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 363 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 364 | CONFIGFS_ATTR_RO(iscsi_stat_tgt_attr_, inst); |
| 365 | CONFIGFS_ATTR_RO(iscsi_stat_tgt_attr_, indx); |
| 366 | CONFIGFS_ATTR_RO(iscsi_stat_tgt_attr_, login_fails); |
| 367 | CONFIGFS_ATTR_RO(iscsi_stat_tgt_attr_, last_fail_time); |
| 368 | CONFIGFS_ATTR_RO(iscsi_stat_tgt_attr_, last_fail_type); |
| 369 | CONFIGFS_ATTR_RO(iscsi_stat_tgt_attr_, fail_intr_name); |
| 370 | CONFIGFS_ATTR_RO(iscsi_stat_tgt_attr_, fail_intr_addr_type); |
| 371 | CONFIGFS_ATTR_RO(iscsi_stat_tgt_attr_, fail_intr_addr); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 372 | |
| 373 | static struct configfs_attribute *iscsi_stat_tgt_attr_attrs[] = { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 374 | &iscsi_stat_tgt_attr_attr_inst, |
| 375 | &iscsi_stat_tgt_attr_attr_indx, |
| 376 | &iscsi_stat_tgt_attr_attr_login_fails, |
| 377 | &iscsi_stat_tgt_attr_attr_last_fail_time, |
| 378 | &iscsi_stat_tgt_attr_attr_last_fail_type, |
| 379 | &iscsi_stat_tgt_attr_attr_fail_intr_name, |
| 380 | &iscsi_stat_tgt_attr_attr_fail_intr_addr_type, |
| 381 | &iscsi_stat_tgt_attr_attr_fail_intr_addr, |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 382 | NULL, |
| 383 | }; |
| 384 | |
Bhumika Goyal | ece550b | 2017-10-16 17:18:42 +0200 | [diff] [blame] | 385 | const struct config_item_type iscsi_stat_tgt_attr_cit = { |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 386 | .ct_attrs = iscsi_stat_tgt_attr_attrs, |
| 387 | .ct_owner = THIS_MODULE, |
| 388 | }; |
| 389 | |
| 390 | /* |
| 391 | * Target Login Stats Table |
| 392 | */ |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 393 | static struct iscsi_tiqn *iscsi_login_stat_tiqn(struct config_item *item) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 394 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 395 | struct iscsi_wwn_stat_grps *igrps = container_of(to_config_group(item), |
| 396 | struct iscsi_wwn_stat_grps, iscsi_login_stats_group); |
| 397 | return container_of(igrps, struct iscsi_tiqn, tiqn_stat_grps); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 398 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 399 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 400 | static ssize_t iscsi_stat_login_inst_show(struct config_item *item, char *page) |
| 401 | { |
| 402 | return snprintf(page, PAGE_SIZE, "%u\n", |
| 403 | iscsi_login_stat_tiqn(item)->tiqn_index); |
| 404 | } |
| 405 | |
| 406 | static ssize_t iscsi_stat_login_indx_show(struct config_item *item, |
| 407 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 408 | { |
| 409 | return snprintf(page, PAGE_SIZE, "%u\n", ISCSI_NODE_INDEX); |
| 410 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 411 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 412 | static ssize_t iscsi_stat_login_accepts_show(struct config_item *item, |
| 413 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 414 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 415 | struct iscsi_tiqn *tiqn = iscsi_login_stat_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 416 | struct iscsi_login_stats *lstat = &tiqn->login_stats; |
| 417 | ssize_t ret; |
| 418 | |
| 419 | spin_lock(&lstat->lock); |
| 420 | ret = snprintf(page, PAGE_SIZE, "%u\n", lstat->accepts); |
| 421 | spin_unlock(&lstat->lock); |
| 422 | |
| 423 | return ret; |
| 424 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 425 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 426 | static ssize_t iscsi_stat_login_other_fails_show(struct config_item *item, |
| 427 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 428 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 429 | struct iscsi_tiqn *tiqn = iscsi_login_stat_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 430 | struct iscsi_login_stats *lstat = &tiqn->login_stats; |
| 431 | ssize_t ret; |
| 432 | |
| 433 | spin_lock(&lstat->lock); |
| 434 | ret = snprintf(page, PAGE_SIZE, "%u\n", lstat->other_fails); |
| 435 | spin_unlock(&lstat->lock); |
| 436 | |
| 437 | return ret; |
| 438 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 439 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 440 | static ssize_t iscsi_stat_login_redirects_show(struct config_item *item, |
| 441 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 442 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 443 | struct iscsi_tiqn *tiqn = iscsi_login_stat_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 444 | struct iscsi_login_stats *lstat = &tiqn->login_stats; |
| 445 | ssize_t ret; |
| 446 | |
| 447 | spin_lock(&lstat->lock); |
| 448 | ret = snprintf(page, PAGE_SIZE, "%u\n", lstat->redirects); |
| 449 | spin_unlock(&lstat->lock); |
| 450 | |
| 451 | return ret; |
| 452 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 453 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 454 | static ssize_t iscsi_stat_login_authorize_fails_show(struct config_item *item, |
| 455 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 456 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 457 | struct iscsi_tiqn *tiqn = iscsi_login_stat_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 458 | struct iscsi_login_stats *lstat = &tiqn->login_stats; |
| 459 | ssize_t ret; |
| 460 | |
| 461 | spin_lock(&lstat->lock); |
| 462 | ret = snprintf(page, PAGE_SIZE, "%u\n", lstat->authorize_fails); |
| 463 | spin_unlock(&lstat->lock); |
| 464 | |
| 465 | return ret; |
| 466 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 467 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 468 | static ssize_t iscsi_stat_login_authenticate_fails_show( |
| 469 | struct config_item *item, char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 470 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 471 | struct iscsi_tiqn *tiqn = iscsi_login_stat_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 472 | struct iscsi_login_stats *lstat = &tiqn->login_stats; |
| 473 | ssize_t ret; |
| 474 | |
| 475 | spin_lock(&lstat->lock); |
| 476 | ret = snprintf(page, PAGE_SIZE, "%u\n", lstat->authenticate_fails); |
| 477 | spin_unlock(&lstat->lock); |
| 478 | |
| 479 | return ret; |
| 480 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 481 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 482 | static ssize_t iscsi_stat_login_negotiate_fails_show(struct config_item *item, |
| 483 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 484 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 485 | struct iscsi_tiqn *tiqn = iscsi_login_stat_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 486 | struct iscsi_login_stats *lstat = &tiqn->login_stats; |
| 487 | ssize_t ret; |
| 488 | |
| 489 | spin_lock(&lstat->lock); |
| 490 | ret = snprintf(page, PAGE_SIZE, "%u\n", lstat->negotiate_fails); |
| 491 | spin_unlock(&lstat->lock); |
| 492 | |
| 493 | return ret; |
| 494 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 495 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 496 | CONFIGFS_ATTR_RO(iscsi_stat_login_, inst); |
| 497 | CONFIGFS_ATTR_RO(iscsi_stat_login_, indx); |
| 498 | CONFIGFS_ATTR_RO(iscsi_stat_login_, accepts); |
| 499 | CONFIGFS_ATTR_RO(iscsi_stat_login_, other_fails); |
| 500 | CONFIGFS_ATTR_RO(iscsi_stat_login_, redirects); |
| 501 | CONFIGFS_ATTR_RO(iscsi_stat_login_, authorize_fails); |
| 502 | CONFIGFS_ATTR_RO(iscsi_stat_login_, authenticate_fails); |
| 503 | CONFIGFS_ATTR_RO(iscsi_stat_login_, negotiate_fails); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 504 | |
| 505 | static struct configfs_attribute *iscsi_stat_login_stats_attrs[] = { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 506 | &iscsi_stat_login_attr_inst, |
| 507 | &iscsi_stat_login_attr_indx, |
| 508 | &iscsi_stat_login_attr_accepts, |
| 509 | &iscsi_stat_login_attr_other_fails, |
| 510 | &iscsi_stat_login_attr_redirects, |
| 511 | &iscsi_stat_login_attr_authorize_fails, |
| 512 | &iscsi_stat_login_attr_authenticate_fails, |
| 513 | &iscsi_stat_login_attr_negotiate_fails, |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 514 | NULL, |
| 515 | }; |
| 516 | |
Bhumika Goyal | ece550b | 2017-10-16 17:18:42 +0200 | [diff] [blame] | 517 | const struct config_item_type iscsi_stat_login_cit = { |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 518 | .ct_attrs = iscsi_stat_login_stats_attrs, |
| 519 | .ct_owner = THIS_MODULE, |
| 520 | }; |
| 521 | |
| 522 | /* |
| 523 | * Target Logout Stats Table |
| 524 | */ |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 525 | static struct iscsi_tiqn *iscsi_logout_stat_tiqn(struct config_item *item) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 526 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 527 | struct iscsi_wwn_stat_grps *igrps = container_of(to_config_group(item), |
| 528 | struct iscsi_wwn_stat_grps, iscsi_logout_stats_group); |
| 529 | return container_of(igrps, struct iscsi_tiqn, tiqn_stat_grps); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 530 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 531 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 532 | static ssize_t iscsi_stat_logout_inst_show(struct config_item *item, char *page) |
| 533 | { |
| 534 | return snprintf(page, PAGE_SIZE, "%u\n", |
| 535 | iscsi_logout_stat_tiqn(item)->tiqn_index); |
| 536 | } |
| 537 | |
| 538 | static ssize_t iscsi_stat_logout_indx_show(struct config_item *item, char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 539 | { |
| 540 | return snprintf(page, PAGE_SIZE, "%u\n", ISCSI_NODE_INDEX); |
| 541 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 542 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 543 | static ssize_t iscsi_stat_logout_normal_logouts_show(struct config_item *item, |
| 544 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 545 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 546 | struct iscsi_tiqn *tiqn = iscsi_logout_stat_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 547 | struct iscsi_logout_stats *lstats = &tiqn->logout_stats; |
| 548 | |
| 549 | return snprintf(page, PAGE_SIZE, "%u\n", lstats->normal_logouts); |
| 550 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 551 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 552 | static ssize_t iscsi_stat_logout_abnormal_logouts_show(struct config_item *item, |
| 553 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 554 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 555 | struct iscsi_tiqn *tiqn = iscsi_logout_stat_tiqn(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 556 | struct iscsi_logout_stats *lstats = &tiqn->logout_stats; |
| 557 | |
| 558 | return snprintf(page, PAGE_SIZE, "%u\n", lstats->abnormal_logouts); |
| 559 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 560 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 561 | CONFIGFS_ATTR_RO(iscsi_stat_logout_, inst); |
| 562 | CONFIGFS_ATTR_RO(iscsi_stat_logout_, indx); |
| 563 | CONFIGFS_ATTR_RO(iscsi_stat_logout_, normal_logouts); |
| 564 | CONFIGFS_ATTR_RO(iscsi_stat_logout_, abnormal_logouts); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 565 | |
| 566 | static struct configfs_attribute *iscsi_stat_logout_stats_attrs[] = { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 567 | &iscsi_stat_logout_attr_inst, |
| 568 | &iscsi_stat_logout_attr_indx, |
| 569 | &iscsi_stat_logout_attr_normal_logouts, |
| 570 | &iscsi_stat_logout_attr_abnormal_logouts, |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 571 | NULL, |
| 572 | }; |
| 573 | |
Bhumika Goyal | ece550b | 2017-10-16 17:18:42 +0200 | [diff] [blame] | 574 | const struct config_item_type iscsi_stat_logout_cit = { |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 575 | .ct_attrs = iscsi_stat_logout_stats_attrs, |
| 576 | .ct_owner = THIS_MODULE, |
| 577 | }; |
| 578 | |
| 579 | /* |
| 580 | * Session Stats Table |
| 581 | */ |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 582 | static struct iscsi_node_acl *iscsi_stat_nacl(struct config_item *item) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 583 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 584 | struct iscsi_node_stat_grps *igrps = container_of(to_config_group(item), |
| 585 | struct iscsi_node_stat_grps, iscsi_sess_stats_group); |
| 586 | return container_of(igrps, struct iscsi_node_acl, node_stat_grps); |
| 587 | } |
| 588 | |
| 589 | static ssize_t iscsi_stat_sess_inst_show(struct config_item *item, char *page) |
| 590 | { |
| 591 | struct iscsi_node_acl *acl = iscsi_stat_nacl(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 592 | struct se_wwn *wwn = acl->se_node_acl.se_tpg->se_tpg_wwn; |
| 593 | struct iscsi_tiqn *tiqn = container_of(wwn, |
| 594 | struct iscsi_tiqn, tiqn_wwn); |
| 595 | |
| 596 | return snprintf(page, PAGE_SIZE, "%u\n", tiqn->tiqn_index); |
| 597 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 598 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 599 | static ssize_t iscsi_stat_sess_node_show(struct config_item *item, char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 600 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 601 | struct iscsi_node_acl *acl = iscsi_stat_nacl(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 602 | struct se_node_acl *se_nacl = &acl->se_node_acl; |
| 603 | struct iscsi_session *sess; |
| 604 | struct se_session *se_sess; |
| 605 | ssize_t ret = 0; |
| 606 | |
| 607 | spin_lock_bh(&se_nacl->nacl_sess_lock); |
| 608 | se_sess = se_nacl->nacl_sess; |
| 609 | if (se_sess) { |
Jörn Engel | 8359cf4 | 2011-11-24 02:05:51 +0100 | [diff] [blame] | 610 | sess = se_sess->fabric_sess_ptr; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 611 | if (sess) |
| 612 | ret = snprintf(page, PAGE_SIZE, "%u\n", |
| 613 | sess->sess_ops->SessionType ? 0 : ISCSI_NODE_INDEX); |
| 614 | } |
| 615 | spin_unlock_bh(&se_nacl->nacl_sess_lock); |
| 616 | |
| 617 | return ret; |
| 618 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 619 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 620 | static ssize_t iscsi_stat_sess_indx_show(struct config_item *item, char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 621 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 622 | struct iscsi_node_acl *acl = iscsi_stat_nacl(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 623 | struct se_node_acl *se_nacl = &acl->se_node_acl; |
| 624 | struct iscsi_session *sess; |
| 625 | struct se_session *se_sess; |
| 626 | ssize_t ret = 0; |
| 627 | |
| 628 | spin_lock_bh(&se_nacl->nacl_sess_lock); |
| 629 | se_sess = se_nacl->nacl_sess; |
| 630 | if (se_sess) { |
Jörn Engel | 8359cf4 | 2011-11-24 02:05:51 +0100 | [diff] [blame] | 631 | sess = se_sess->fabric_sess_ptr; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 632 | if (sess) |
| 633 | ret = snprintf(page, PAGE_SIZE, "%u\n", |
| 634 | sess->session_index); |
| 635 | } |
| 636 | spin_unlock_bh(&se_nacl->nacl_sess_lock); |
| 637 | |
| 638 | return ret; |
| 639 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 640 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 641 | static ssize_t iscsi_stat_sess_cmd_pdus_show(struct config_item *item, |
| 642 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 643 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 644 | struct iscsi_node_acl *acl = iscsi_stat_nacl(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 645 | struct se_node_acl *se_nacl = &acl->se_node_acl; |
| 646 | struct iscsi_session *sess; |
| 647 | struct se_session *se_sess; |
| 648 | ssize_t ret = 0; |
| 649 | |
| 650 | spin_lock_bh(&se_nacl->nacl_sess_lock); |
| 651 | se_sess = se_nacl->nacl_sess; |
| 652 | if (se_sess) { |
Jörn Engel | 8359cf4 | 2011-11-24 02:05:51 +0100 | [diff] [blame] | 653 | sess = se_sess->fabric_sess_ptr; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 654 | if (sess) |
Nicholas Bellinger | 04f3b31 | 2013-11-13 18:54:45 -0800 | [diff] [blame] | 655 | ret = snprintf(page, PAGE_SIZE, "%lu\n", |
| 656 | atomic_long_read(&sess->cmd_pdus)); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 657 | } |
| 658 | spin_unlock_bh(&se_nacl->nacl_sess_lock); |
| 659 | |
| 660 | return ret; |
| 661 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 662 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 663 | static ssize_t iscsi_stat_sess_rsp_pdus_show(struct config_item *item, |
| 664 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 665 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 666 | struct iscsi_node_acl *acl = iscsi_stat_nacl(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 667 | struct se_node_acl *se_nacl = &acl->se_node_acl; |
| 668 | struct iscsi_session *sess; |
| 669 | struct se_session *se_sess; |
| 670 | ssize_t ret = 0; |
| 671 | |
| 672 | spin_lock_bh(&se_nacl->nacl_sess_lock); |
| 673 | se_sess = se_nacl->nacl_sess; |
| 674 | if (se_sess) { |
Jörn Engel | 8359cf4 | 2011-11-24 02:05:51 +0100 | [diff] [blame] | 675 | sess = se_sess->fabric_sess_ptr; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 676 | if (sess) |
Nicholas Bellinger | 04f3b31 | 2013-11-13 18:54:45 -0800 | [diff] [blame] | 677 | ret = snprintf(page, PAGE_SIZE, "%lu\n", |
| 678 | atomic_long_read(&sess->rsp_pdus)); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 679 | } |
| 680 | spin_unlock_bh(&se_nacl->nacl_sess_lock); |
| 681 | |
| 682 | return ret; |
| 683 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 684 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 685 | static ssize_t iscsi_stat_sess_txdata_octs_show(struct config_item *item, |
| 686 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 687 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 688 | struct iscsi_node_acl *acl = iscsi_stat_nacl(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 689 | struct se_node_acl *se_nacl = &acl->se_node_acl; |
| 690 | struct iscsi_session *sess; |
| 691 | struct se_session *se_sess; |
| 692 | ssize_t ret = 0; |
| 693 | |
| 694 | spin_lock_bh(&se_nacl->nacl_sess_lock); |
| 695 | se_sess = se_nacl->nacl_sess; |
| 696 | if (se_sess) { |
Jörn Engel | 8359cf4 | 2011-11-24 02:05:51 +0100 | [diff] [blame] | 697 | sess = se_sess->fabric_sess_ptr; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 698 | if (sess) |
Nicholas Bellinger | 04f3b31 | 2013-11-13 18:54:45 -0800 | [diff] [blame] | 699 | ret = snprintf(page, PAGE_SIZE, "%lu\n", |
| 700 | atomic_long_read(&sess->tx_data_octets)); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 701 | } |
| 702 | spin_unlock_bh(&se_nacl->nacl_sess_lock); |
| 703 | |
| 704 | return ret; |
| 705 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 706 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 707 | static ssize_t iscsi_stat_sess_rxdata_octs_show(struct config_item *item, |
| 708 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 709 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 710 | struct iscsi_node_acl *acl = iscsi_stat_nacl(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 711 | struct se_node_acl *se_nacl = &acl->se_node_acl; |
| 712 | struct iscsi_session *sess; |
| 713 | struct se_session *se_sess; |
| 714 | ssize_t ret = 0; |
| 715 | |
| 716 | spin_lock_bh(&se_nacl->nacl_sess_lock); |
| 717 | se_sess = se_nacl->nacl_sess; |
| 718 | if (se_sess) { |
Jörn Engel | 8359cf4 | 2011-11-24 02:05:51 +0100 | [diff] [blame] | 719 | sess = se_sess->fabric_sess_ptr; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 720 | if (sess) |
Nicholas Bellinger | 04f3b31 | 2013-11-13 18:54:45 -0800 | [diff] [blame] | 721 | ret = snprintf(page, PAGE_SIZE, "%lu\n", |
| 722 | atomic_long_read(&sess->rx_data_octets)); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 723 | } |
| 724 | spin_unlock_bh(&se_nacl->nacl_sess_lock); |
| 725 | |
| 726 | return ret; |
| 727 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 728 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 729 | static ssize_t iscsi_stat_sess_conn_digest_errors_show(struct config_item *item, |
| 730 | char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 731 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 732 | struct iscsi_node_acl *acl = iscsi_stat_nacl(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 733 | struct se_node_acl *se_nacl = &acl->se_node_acl; |
| 734 | struct iscsi_session *sess; |
| 735 | struct se_session *se_sess; |
| 736 | ssize_t ret = 0; |
| 737 | |
| 738 | spin_lock_bh(&se_nacl->nacl_sess_lock); |
| 739 | se_sess = se_nacl->nacl_sess; |
| 740 | if (se_sess) { |
Jörn Engel | 8359cf4 | 2011-11-24 02:05:51 +0100 | [diff] [blame] | 741 | sess = se_sess->fabric_sess_ptr; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 742 | if (sess) |
Nicholas Bellinger | 04f3b31 | 2013-11-13 18:54:45 -0800 | [diff] [blame] | 743 | ret = snprintf(page, PAGE_SIZE, "%lu\n", |
| 744 | atomic_long_read(&sess->conn_digest_errors)); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 745 | } |
| 746 | spin_unlock_bh(&se_nacl->nacl_sess_lock); |
| 747 | |
| 748 | return ret; |
| 749 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 750 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 751 | static ssize_t iscsi_stat_sess_conn_timeout_errors_show( |
| 752 | struct config_item *item, char *page) |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 753 | { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 754 | struct iscsi_node_acl *acl = iscsi_stat_nacl(item); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 755 | struct se_node_acl *se_nacl = &acl->se_node_acl; |
| 756 | struct iscsi_session *sess; |
| 757 | struct se_session *se_sess; |
| 758 | ssize_t ret = 0; |
| 759 | |
| 760 | spin_lock_bh(&se_nacl->nacl_sess_lock); |
| 761 | se_sess = se_nacl->nacl_sess; |
| 762 | if (se_sess) { |
Jörn Engel | 8359cf4 | 2011-11-24 02:05:51 +0100 | [diff] [blame] | 763 | sess = se_sess->fabric_sess_ptr; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 764 | if (sess) |
Nicholas Bellinger | 04f3b31 | 2013-11-13 18:54:45 -0800 | [diff] [blame] | 765 | ret = snprintf(page, PAGE_SIZE, "%lu\n", |
| 766 | atomic_long_read(&sess->conn_timeout_errors)); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 767 | } |
| 768 | spin_unlock_bh(&se_nacl->nacl_sess_lock); |
| 769 | |
| 770 | return ret; |
| 771 | } |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 772 | |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 773 | CONFIGFS_ATTR_RO(iscsi_stat_sess_, inst); |
| 774 | CONFIGFS_ATTR_RO(iscsi_stat_sess_, node); |
| 775 | CONFIGFS_ATTR_RO(iscsi_stat_sess_, indx); |
| 776 | CONFIGFS_ATTR_RO(iscsi_stat_sess_, cmd_pdus); |
| 777 | CONFIGFS_ATTR_RO(iscsi_stat_sess_, rsp_pdus); |
| 778 | CONFIGFS_ATTR_RO(iscsi_stat_sess_, txdata_octs); |
| 779 | CONFIGFS_ATTR_RO(iscsi_stat_sess_, rxdata_octs); |
| 780 | CONFIGFS_ATTR_RO(iscsi_stat_sess_, conn_digest_errors); |
| 781 | CONFIGFS_ATTR_RO(iscsi_stat_sess_, conn_timeout_errors); |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 782 | |
| 783 | static struct configfs_attribute *iscsi_stat_sess_stats_attrs[] = { |
Christoph Hellwig | 2eafd72 | 2015-10-03 15:32:55 +0200 | [diff] [blame] | 784 | &iscsi_stat_sess_attr_inst, |
| 785 | &iscsi_stat_sess_attr_node, |
| 786 | &iscsi_stat_sess_attr_indx, |
| 787 | &iscsi_stat_sess_attr_cmd_pdus, |
| 788 | &iscsi_stat_sess_attr_rsp_pdus, |
| 789 | &iscsi_stat_sess_attr_txdata_octs, |
| 790 | &iscsi_stat_sess_attr_rxdata_octs, |
| 791 | &iscsi_stat_sess_attr_conn_digest_errors, |
| 792 | &iscsi_stat_sess_attr_conn_timeout_errors, |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 793 | NULL, |
| 794 | }; |
| 795 | |
Bhumika Goyal | ece550b | 2017-10-16 17:18:42 +0200 | [diff] [blame] | 796 | const struct config_item_type iscsi_stat_sess_cit = { |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 797 | .ct_attrs = iscsi_stat_sess_stats_attrs, |
| 798 | .ct_owner = THIS_MODULE, |
| 799 | }; |