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