Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 1 | #ifndef ISCSI_TARGET_CORE_H |
| 2 | #define ISCSI_TARGET_CORE_H |
| 3 | |
| 4 | #include <linux/in.h> |
| 5 | #include <linux/configfs.h> |
| 6 | #include <net/sock.h> |
| 7 | #include <net/tcp.h> |
| 8 | #include <scsi/scsi_cmnd.h> |
| 9 | #include <scsi/iscsi_proto.h> |
| 10 | #include <target/target_core_base.h> |
| 11 | |
Nicholas Bellinger | 9765b1f | 2012-03-10 14:50:19 -0800 | [diff] [blame] | 12 | #define ISCSIT_VERSION "v4.1.0-rc2" |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 13 | #define ISCSI_MAX_DATASN_MISSING_COUNT 16 |
| 14 | #define ISCSI_TX_THREAD_TCP_TIMEOUT 2 |
| 15 | #define ISCSI_RX_THREAD_TCP_TIMEOUT 2 |
| 16 | #define SECONDS_FOR_ASYNC_LOGOUT 10 |
| 17 | #define SECONDS_FOR_ASYNC_TEXT 10 |
| 18 | #define SECONDS_FOR_LOGOUT_COMP 15 |
| 19 | #define WHITE_SPACE " \t\v\f\n\r" |
| 20 | |
| 21 | /* struct iscsi_node_attrib sanity values */ |
| 22 | #define NA_DATAOUT_TIMEOUT 3 |
| 23 | #define NA_DATAOUT_TIMEOUT_MAX 60 |
| 24 | #define NA_DATAOUT_TIMEOUT_MIX 2 |
| 25 | #define NA_DATAOUT_TIMEOUT_RETRIES 5 |
| 26 | #define NA_DATAOUT_TIMEOUT_RETRIES_MAX 15 |
| 27 | #define NA_DATAOUT_TIMEOUT_RETRIES_MIN 1 |
Nicholas Bellinger | cf0eb28 | 2012-10-03 15:42:48 -0700 | [diff] [blame] | 28 | #define NA_NOPIN_TIMEOUT 15 |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 29 | #define NA_NOPIN_TIMEOUT_MAX 60 |
| 30 | #define NA_NOPIN_TIMEOUT_MIN 3 |
Nicholas Bellinger | cf0eb28 | 2012-10-03 15:42:48 -0700 | [diff] [blame] | 31 | #define NA_NOPIN_RESPONSE_TIMEOUT 30 |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 32 | #define NA_NOPIN_RESPONSE_TIMEOUT_MAX 60 |
| 33 | #define NA_NOPIN_RESPONSE_TIMEOUT_MIN 3 |
| 34 | #define NA_RANDOM_DATAIN_PDU_OFFSETS 0 |
| 35 | #define NA_RANDOM_DATAIN_SEQ_OFFSETS 0 |
| 36 | #define NA_RANDOM_R2T_OFFSETS 0 |
| 37 | #define NA_DEFAULT_ERL 0 |
| 38 | #define NA_DEFAULT_ERL_MAX 2 |
| 39 | #define NA_DEFAULT_ERL_MIN 0 |
| 40 | |
| 41 | /* struct iscsi_tpg_attrib sanity values */ |
| 42 | #define TA_AUTHENTICATION 1 |
| 43 | #define TA_LOGIN_TIMEOUT 15 |
| 44 | #define TA_LOGIN_TIMEOUT_MAX 30 |
| 45 | #define TA_LOGIN_TIMEOUT_MIN 5 |
| 46 | #define TA_NETIF_TIMEOUT 2 |
| 47 | #define TA_NETIF_TIMEOUT_MAX 15 |
| 48 | #define TA_NETIF_TIMEOUT_MIN 2 |
| 49 | #define TA_GENERATE_NODE_ACLS 0 |
| 50 | #define TA_DEFAULT_CMDSN_DEPTH 16 |
| 51 | #define TA_DEFAULT_CMDSN_DEPTH_MAX 512 |
| 52 | #define TA_DEFAULT_CMDSN_DEPTH_MIN 1 |
| 53 | #define TA_CACHE_DYNAMIC_ACLS 0 |
| 54 | /* Enabled by default in demo mode (generic_node_acls=1) */ |
| 55 | #define TA_DEMO_MODE_WRITE_PROTECT 1 |
| 56 | /* Disabled by default in production mode w/ explict ACLs */ |
| 57 | #define TA_PROD_MODE_WRITE_PROTECT 0 |
| 58 | #define TA_CACHE_CORE_NPS 0 |
| 59 | |
Christoph Hellwig | c0427f1 | 2011-10-12 11:06:56 -0400 | [diff] [blame] | 60 | |
| 61 | #define ISCSI_IOV_DATA_BUFFER 5 |
| 62 | |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 63 | enum tpg_np_network_transport_table { |
| 64 | ISCSI_TCP = 0, |
| 65 | ISCSI_SCTP_TCP = 1, |
| 66 | ISCSI_SCTP_UDP = 2, |
| 67 | ISCSI_IWARP_TCP = 3, |
| 68 | ISCSI_IWARP_SCTP = 4, |
| 69 | ISCSI_INFINIBAND = 5, |
| 70 | }; |
| 71 | |
| 72 | /* RFC-3720 7.1.4 Standard Connection State Diagram for a Target */ |
| 73 | enum target_conn_state_table { |
| 74 | TARG_CONN_STATE_FREE = 0x1, |
| 75 | TARG_CONN_STATE_XPT_UP = 0x3, |
| 76 | TARG_CONN_STATE_IN_LOGIN = 0x4, |
| 77 | TARG_CONN_STATE_LOGGED_IN = 0x5, |
| 78 | TARG_CONN_STATE_IN_LOGOUT = 0x6, |
| 79 | TARG_CONN_STATE_LOGOUT_REQUESTED = 0x7, |
| 80 | TARG_CONN_STATE_CLEANUP_WAIT = 0x8, |
| 81 | }; |
| 82 | |
| 83 | /* RFC-3720 7.3.2 Session State Diagram for a Target */ |
| 84 | enum target_sess_state_table { |
| 85 | TARG_SESS_STATE_FREE = 0x1, |
| 86 | TARG_SESS_STATE_ACTIVE = 0x2, |
| 87 | TARG_SESS_STATE_LOGGED_IN = 0x3, |
| 88 | TARG_SESS_STATE_FAILED = 0x4, |
| 89 | TARG_SESS_STATE_IN_CONTINUE = 0x5, |
| 90 | }; |
| 91 | |
| 92 | /* struct iscsi_data_count->type */ |
| 93 | enum data_count_type { |
| 94 | ISCSI_RX_DATA = 1, |
| 95 | ISCSI_TX_DATA = 2, |
| 96 | }; |
| 97 | |
| 98 | /* struct iscsi_datain_req->dr_complete */ |
| 99 | enum datain_req_comp_table { |
| 100 | DATAIN_COMPLETE_NORMAL = 1, |
| 101 | DATAIN_COMPLETE_WITHIN_COMMAND_RECOVERY = 2, |
| 102 | DATAIN_COMPLETE_CONNECTION_RECOVERY = 3, |
| 103 | }; |
| 104 | |
| 105 | /* struct iscsi_datain_req->recovery */ |
| 106 | enum datain_req_rec_table { |
| 107 | DATAIN_WITHIN_COMMAND_RECOVERY = 1, |
| 108 | DATAIN_CONNECTION_RECOVERY = 2, |
| 109 | }; |
| 110 | |
| 111 | /* struct iscsi_portal_group->state */ |
| 112 | enum tpg_state_table { |
| 113 | TPG_STATE_FREE = 0, |
| 114 | TPG_STATE_ACTIVE = 1, |
| 115 | TPG_STATE_INACTIVE = 2, |
| 116 | TPG_STATE_COLD_RESET = 3, |
| 117 | }; |
| 118 | |
| 119 | /* struct iscsi_tiqn->tiqn_state */ |
| 120 | enum tiqn_state_table { |
| 121 | TIQN_STATE_ACTIVE = 1, |
| 122 | TIQN_STATE_SHUTDOWN = 2, |
| 123 | }; |
| 124 | |
| 125 | /* struct iscsi_cmd->cmd_flags */ |
| 126 | enum cmd_flags_table { |
| 127 | ICF_GOT_LAST_DATAOUT = 0x00000001, |
| 128 | ICF_GOT_DATACK_SNACK = 0x00000002, |
| 129 | ICF_NON_IMMEDIATE_UNSOLICITED_DATA = 0x00000004, |
| 130 | ICF_SENT_LAST_R2T = 0x00000008, |
| 131 | ICF_WITHIN_COMMAND_RECOVERY = 0x00000010, |
| 132 | ICF_CONTIG_MEMORY = 0x00000020, |
| 133 | ICF_ATTACHED_TO_RQUEUE = 0x00000040, |
| 134 | ICF_OOO_CMDSN = 0x00000080, |
| 135 | ICF_REJECT_FAIL_CONN = 0x00000100, |
| 136 | }; |
| 137 | |
| 138 | /* struct iscsi_cmd->i_state */ |
| 139 | enum cmd_i_state_table { |
| 140 | ISTATE_NO_STATE = 0, |
| 141 | ISTATE_NEW_CMD = 1, |
| 142 | ISTATE_DEFERRED_CMD = 2, |
| 143 | ISTATE_UNSOLICITED_DATA = 3, |
| 144 | ISTATE_RECEIVE_DATAOUT = 4, |
| 145 | ISTATE_RECEIVE_DATAOUT_RECOVERY = 5, |
| 146 | ISTATE_RECEIVED_LAST_DATAOUT = 6, |
| 147 | ISTATE_WITHIN_DATAOUT_RECOVERY = 7, |
| 148 | ISTATE_IN_CONNECTION_RECOVERY = 8, |
| 149 | ISTATE_RECEIVED_TASKMGT = 9, |
| 150 | ISTATE_SEND_ASYNCMSG = 10, |
| 151 | ISTATE_SENT_ASYNCMSG = 11, |
| 152 | ISTATE_SEND_DATAIN = 12, |
| 153 | ISTATE_SEND_LAST_DATAIN = 13, |
| 154 | ISTATE_SENT_LAST_DATAIN = 14, |
| 155 | ISTATE_SEND_LOGOUTRSP = 15, |
| 156 | ISTATE_SENT_LOGOUTRSP = 16, |
| 157 | ISTATE_SEND_NOPIN = 17, |
| 158 | ISTATE_SENT_NOPIN = 18, |
| 159 | ISTATE_SEND_REJECT = 19, |
| 160 | ISTATE_SENT_REJECT = 20, |
| 161 | ISTATE_SEND_R2T = 21, |
| 162 | ISTATE_SENT_R2T = 22, |
| 163 | ISTATE_SEND_R2T_RECOVERY = 23, |
| 164 | ISTATE_SENT_R2T_RECOVERY = 24, |
| 165 | ISTATE_SEND_LAST_R2T = 25, |
| 166 | ISTATE_SENT_LAST_R2T = 26, |
| 167 | ISTATE_SEND_LAST_R2T_RECOVERY = 27, |
| 168 | ISTATE_SENT_LAST_R2T_RECOVERY = 28, |
| 169 | ISTATE_SEND_STATUS = 29, |
| 170 | ISTATE_SEND_STATUS_BROKEN_PC = 30, |
| 171 | ISTATE_SENT_STATUS = 31, |
| 172 | ISTATE_SEND_STATUS_RECOVERY = 32, |
| 173 | ISTATE_SENT_STATUS_RECOVERY = 33, |
| 174 | ISTATE_SEND_TASKMGTRSP = 34, |
| 175 | ISTATE_SENT_TASKMGTRSP = 35, |
| 176 | ISTATE_SEND_TEXTRSP = 36, |
| 177 | ISTATE_SENT_TEXTRSP = 37, |
| 178 | ISTATE_SEND_NOPIN_WANT_RESPONSE = 38, |
| 179 | ISTATE_SENT_NOPIN_WANT_RESPONSE = 39, |
| 180 | ISTATE_SEND_NOPIN_NO_RESPONSE = 40, |
| 181 | ISTATE_REMOVE = 41, |
| 182 | ISTATE_FREE = 42, |
| 183 | }; |
| 184 | |
| 185 | /* Used for iscsi_recover_cmdsn() return values */ |
| 186 | enum recover_cmdsn_ret_table { |
| 187 | CMDSN_ERROR_CANNOT_RECOVER = -1, |
| 188 | CMDSN_NORMAL_OPERATION = 0, |
| 189 | CMDSN_LOWER_THAN_EXP = 1, |
| 190 | CMDSN_HIGHER_THAN_EXP = 2, |
| 191 | }; |
| 192 | |
| 193 | /* Used for iscsi_handle_immediate_data() return values */ |
| 194 | enum immedate_data_ret_table { |
| 195 | IMMEDIATE_DATA_CANNOT_RECOVER = -1, |
| 196 | IMMEDIATE_DATA_NORMAL_OPERATION = 0, |
| 197 | IMMEDIATE_DATA_ERL1_CRC_FAILURE = 1, |
| 198 | }; |
| 199 | |
| 200 | /* Used for iscsi_decide_dataout_action() return values */ |
| 201 | enum dataout_action_ret_table { |
| 202 | DATAOUT_CANNOT_RECOVER = -1, |
| 203 | DATAOUT_NORMAL = 0, |
| 204 | DATAOUT_SEND_R2T = 1, |
| 205 | DATAOUT_SEND_TO_TRANSPORT = 2, |
| 206 | DATAOUT_WITHIN_COMMAND_RECOVERY = 3, |
| 207 | }; |
| 208 | |
| 209 | /* Used for struct iscsi_node_auth->naf_flags */ |
| 210 | enum naf_flags_table { |
| 211 | NAF_USERID_SET = 0x01, |
| 212 | NAF_PASSWORD_SET = 0x02, |
| 213 | NAF_USERID_IN_SET = 0x04, |
| 214 | NAF_PASSWORD_IN_SET = 0x08, |
| 215 | }; |
| 216 | |
| 217 | /* Used by various struct timer_list to manage iSCSI specific state */ |
| 218 | enum iscsi_timer_flags_table { |
| 219 | ISCSI_TF_RUNNING = 0x01, |
| 220 | ISCSI_TF_STOP = 0x02, |
| 221 | ISCSI_TF_EXPIRED = 0x04, |
| 222 | }; |
| 223 | |
| 224 | /* Used for struct iscsi_np->np_flags */ |
| 225 | enum np_flags_table { |
| 226 | NPF_IP_NETWORK = 0x00, |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 227 | }; |
| 228 | |
| 229 | /* Used for struct iscsi_np->np_thread_state */ |
| 230 | enum np_thread_state_table { |
| 231 | ISCSI_NP_THREAD_ACTIVE = 1, |
| 232 | ISCSI_NP_THREAD_INACTIVE = 2, |
| 233 | ISCSI_NP_THREAD_RESET = 3, |
| 234 | ISCSI_NP_THREAD_SHUTDOWN = 4, |
| 235 | ISCSI_NP_THREAD_EXIT = 5, |
| 236 | }; |
| 237 | |
| 238 | struct iscsi_conn_ops { |
| 239 | u8 HeaderDigest; /* [0,1] == [None,CRC32C] */ |
| 240 | u8 DataDigest; /* [0,1] == [None,CRC32C] */ |
| 241 | u32 MaxRecvDataSegmentLength; /* [512..2**24-1] */ |
Nicholas Bellinger | e004cb2 | 2012-09-29 21:47:16 -0700 | [diff] [blame] | 242 | u32 MaxXmitDataSegmentLength; /* [512..2**24-1] */ |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 243 | u8 OFMarker; /* [0,1] == [No,Yes] */ |
| 244 | u8 IFMarker; /* [0,1] == [No,Yes] */ |
| 245 | u32 OFMarkInt; /* [1..65535] */ |
| 246 | u32 IFMarkInt; /* [1..65535] */ |
| 247 | }; |
| 248 | |
| 249 | struct iscsi_sess_ops { |
| 250 | char InitiatorName[224]; |
| 251 | char InitiatorAlias[256]; |
| 252 | char TargetName[224]; |
| 253 | char TargetAlias[256]; |
| 254 | char TargetAddress[256]; |
| 255 | u16 TargetPortalGroupTag; /* [0..65535] */ |
| 256 | u16 MaxConnections; /* [1..65535] */ |
| 257 | u8 InitialR2T; /* [0,1] == [No,Yes] */ |
| 258 | u8 ImmediateData; /* [0,1] == [No,Yes] */ |
| 259 | u32 MaxBurstLength; /* [512..2**24-1] */ |
| 260 | u32 FirstBurstLength; /* [512..2**24-1] */ |
| 261 | u16 DefaultTime2Wait; /* [0..3600] */ |
| 262 | u16 DefaultTime2Retain; /* [0..3600] */ |
| 263 | u16 MaxOutstandingR2T; /* [1..65535] */ |
| 264 | u8 DataPDUInOrder; /* [0,1] == [No,Yes] */ |
| 265 | u8 DataSequenceInOrder; /* [0,1] == [No,Yes] */ |
| 266 | u8 ErrorRecoveryLevel; /* [0..2] */ |
| 267 | u8 SessionType; /* [0,1] == [Normal,Discovery]*/ |
| 268 | }; |
| 269 | |
| 270 | struct iscsi_queue_req { |
| 271 | int state; |
| 272 | struct iscsi_cmd *cmd; |
| 273 | struct list_head qr_list; |
| 274 | }; |
| 275 | |
| 276 | struct iscsi_data_count { |
| 277 | int data_length; |
| 278 | int sync_and_steering; |
| 279 | enum data_count_type type; |
| 280 | u32 iov_count; |
| 281 | u32 ss_iov_count; |
| 282 | u32 ss_marker_count; |
| 283 | struct kvec *iov; |
| 284 | }; |
| 285 | |
| 286 | struct iscsi_param_list { |
| 287 | struct list_head param_list; |
| 288 | struct list_head extra_response_list; |
| 289 | }; |
| 290 | |
| 291 | struct iscsi_datain_req { |
| 292 | enum datain_req_comp_table dr_complete; |
| 293 | int generate_recovery_values; |
| 294 | enum datain_req_rec_table recovery; |
| 295 | u32 begrun; |
| 296 | u32 runlength; |
| 297 | u32 data_length; |
| 298 | u32 data_offset; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 299 | u32 data_sn; |
| 300 | u32 next_burst_len; |
| 301 | u32 read_data_done; |
| 302 | u32 seq_send_order; |
Andy Grover | 8b1e124 | 2012-04-03 15:51:12 -0700 | [diff] [blame] | 303 | struct list_head cmd_datain_node; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 304 | } ____cacheline_aligned; |
| 305 | |
| 306 | struct iscsi_ooo_cmdsn { |
| 307 | u16 cid; |
| 308 | u32 batch_count; |
| 309 | u32 cmdsn; |
| 310 | u32 exp_cmdsn; |
| 311 | struct iscsi_cmd *cmd; |
| 312 | struct list_head ooo_list; |
| 313 | } ____cacheline_aligned; |
| 314 | |
| 315 | struct iscsi_datain { |
| 316 | u8 flags; |
| 317 | u32 data_sn; |
| 318 | u32 length; |
| 319 | u32 offset; |
| 320 | } ____cacheline_aligned; |
| 321 | |
| 322 | struct iscsi_r2t { |
| 323 | int seq_complete; |
| 324 | int recovery_r2t; |
| 325 | int sent_r2t; |
| 326 | u32 r2t_sn; |
| 327 | u32 offset; |
| 328 | u32 targ_xfer_tag; |
| 329 | u32 xfer_len; |
| 330 | struct list_head r2t_list; |
| 331 | } ____cacheline_aligned; |
| 332 | |
| 333 | struct iscsi_cmd { |
| 334 | enum iscsi_timer_flags_table dataout_timer_flags; |
| 335 | /* DataOUT timeout retries */ |
| 336 | u8 dataout_timeout_retries; |
| 337 | /* Within command recovery count */ |
| 338 | u8 error_recovery_count; |
| 339 | /* iSCSI dependent state for out or order CmdSNs */ |
| 340 | enum cmd_i_state_table deferred_i_state; |
| 341 | /* iSCSI dependent state */ |
| 342 | enum cmd_i_state_table i_state; |
| 343 | /* Command is an immediate command (ISCSI_OP_IMMEDIATE set) */ |
| 344 | u8 immediate_cmd; |
| 345 | /* Immediate data present */ |
| 346 | u8 immediate_data; |
| 347 | /* iSCSI Opcode */ |
| 348 | u8 iscsi_opcode; |
| 349 | /* iSCSI Response Code */ |
| 350 | u8 iscsi_response; |
| 351 | /* Logout reason when iscsi_opcode == ISCSI_INIT_LOGOUT_CMND */ |
| 352 | u8 logout_reason; |
| 353 | /* Logout response code when iscsi_opcode == ISCSI_INIT_LOGOUT_CMND */ |
| 354 | u8 logout_response; |
| 355 | /* MaxCmdSN has been incremented */ |
| 356 | u8 maxcmdsn_inc; |
| 357 | /* Immediate Unsolicited Dataout */ |
| 358 | u8 unsolicited_data; |
| 359 | /* CID contained in logout PDU when opcode == ISCSI_INIT_LOGOUT_CMND */ |
| 360 | u16 logout_cid; |
| 361 | /* Command flags */ |
| 362 | enum cmd_flags_table cmd_flags; |
| 363 | /* Initiator Task Tag assigned from Initiator */ |
Christoph Hellwig | 66c7db6 | 2012-09-26 08:00:39 -0400 | [diff] [blame] | 364 | itt_t init_task_tag; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 365 | /* Target Transfer Tag assigned from Target */ |
| 366 | u32 targ_xfer_tag; |
| 367 | /* CmdSN assigned from Initiator */ |
| 368 | u32 cmd_sn; |
| 369 | /* ExpStatSN assigned from Initiator */ |
| 370 | u32 exp_stat_sn; |
| 371 | /* StatSN assigned to this ITT */ |
| 372 | u32 stat_sn; |
| 373 | /* DataSN Counter */ |
| 374 | u32 data_sn; |
| 375 | /* R2TSN Counter */ |
| 376 | u32 r2t_sn; |
| 377 | /* Last DataSN acknowledged via DataAck SNACK */ |
| 378 | u32 acked_data_sn; |
| 379 | /* Used for echoing NOPOUT ping data */ |
| 380 | u32 buf_ptr_size; |
| 381 | /* Used to store DataDigest */ |
| 382 | u32 data_crc; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 383 | /* Counter for MaxOutstandingR2T */ |
| 384 | u32 outstanding_r2ts; |
| 385 | /* Next R2T Offset when DataSequenceInOrder=Yes */ |
| 386 | u32 r2t_offset; |
| 387 | /* Iovec current and orig count for iscsi_cmd->iov_data */ |
| 388 | u32 iov_data_count; |
| 389 | u32 orig_iov_data_count; |
| 390 | /* Number of miscellaneous iovecs used for IP stack calls */ |
| 391 | u32 iov_misc_count; |
| 392 | /* Number of struct iscsi_pdu in struct iscsi_cmd->pdu_list */ |
| 393 | u32 pdu_count; |
| 394 | /* Next struct iscsi_pdu to send in struct iscsi_cmd->pdu_list */ |
| 395 | u32 pdu_send_order; |
| 396 | /* Current struct iscsi_pdu in struct iscsi_cmd->pdu_list */ |
| 397 | u32 pdu_start; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 398 | /* Next struct iscsi_seq to send in struct iscsi_cmd->seq_list */ |
| 399 | u32 seq_send_order; |
| 400 | /* Number of struct iscsi_seq in struct iscsi_cmd->seq_list */ |
| 401 | u32 seq_count; |
| 402 | /* Current struct iscsi_seq in struct iscsi_cmd->seq_list */ |
| 403 | u32 seq_no; |
| 404 | /* Lowest offset in current DataOUT sequence */ |
| 405 | u32 seq_start_offset; |
| 406 | /* Highest offset in current DataOUT sequence */ |
| 407 | u32 seq_end_offset; |
| 408 | /* Total size in bytes received so far of READ data */ |
| 409 | u32 read_data_done; |
| 410 | /* Total size in bytes received so far of WRITE data */ |
| 411 | u32 write_data_done; |
| 412 | /* Counter for FirstBurstLength key */ |
| 413 | u32 first_burst_len; |
| 414 | /* Counter for MaxBurstLength key */ |
| 415 | u32 next_burst_len; |
| 416 | /* Transfer size used for IP stack calls */ |
| 417 | u32 tx_size; |
| 418 | /* Buffer used for various purposes */ |
| 419 | void *buf_ptr; |
| 420 | /* See include/linux/dma-mapping.h */ |
| 421 | enum dma_data_direction data_direction; |
| 422 | /* iSCSI PDU Header + CRC */ |
| 423 | unsigned char pdu[ISCSI_HDR_LEN + ISCSI_CRC_LEN]; |
| 424 | /* Number of times struct iscsi_cmd is present in immediate queue */ |
| 425 | atomic_t immed_queue_count; |
| 426 | atomic_t response_queue_count; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 427 | spinlock_t datain_lock; |
| 428 | spinlock_t dataout_timeout_lock; |
| 429 | /* spinlock for protecting struct iscsi_cmd->i_state */ |
| 430 | spinlock_t istate_lock; |
| 431 | /* spinlock for adding within command recovery entries */ |
| 432 | spinlock_t error_lock; |
| 433 | /* spinlock for adding R2Ts */ |
| 434 | spinlock_t r2t_lock; |
| 435 | /* DataIN List */ |
| 436 | struct list_head datain_list; |
| 437 | /* R2T List */ |
| 438 | struct list_head cmd_r2t_list; |
| 439 | struct completion reject_comp; |
| 440 | /* Timer for DataOUT */ |
| 441 | struct timer_list dataout_timer; |
| 442 | /* Iovecs for SCSI data payload RX/TX w/ kernel level sockets */ |
| 443 | struct kvec *iov_data; |
| 444 | /* Iovecs for miscellaneous purposes */ |
| 445 | #define ISCSI_MISC_IOVECS 5 |
| 446 | struct kvec iov_misc[ISCSI_MISC_IOVECS]; |
| 447 | /* Array of struct iscsi_pdu used for DataPDUInOrder=No */ |
| 448 | struct iscsi_pdu *pdu_list; |
| 449 | /* Current struct iscsi_pdu used for DataPDUInOrder=No */ |
| 450 | struct iscsi_pdu *pdu_ptr; |
| 451 | /* Array of struct iscsi_seq used for DataSequenceInOrder=No */ |
| 452 | struct iscsi_seq *seq_list; |
| 453 | /* Current struct iscsi_seq used for DataSequenceInOrder=No */ |
| 454 | struct iscsi_seq *seq_ptr; |
| 455 | /* TMR Request when iscsi_opcode == ISCSI_OP_SCSI_TMFUNC */ |
| 456 | struct iscsi_tmr_req *tmr_req; |
| 457 | /* Connection this command is alligient to */ |
| 458 | struct iscsi_conn *conn; |
| 459 | /* Pointer to connection recovery entry */ |
| 460 | struct iscsi_conn_recovery *cr; |
| 461 | /* Session the command is part of, used for connection recovery */ |
| 462 | struct iscsi_session *sess; |
| 463 | /* list_head for connection list */ |
Andy Grover | 2fbb471 | 2012-04-03 15:51:01 -0700 | [diff] [blame] | 464 | struct list_head i_conn_node; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 465 | /* The TCM I/O descriptor that is accessed via container_of() */ |
| 466 | struct se_cmd se_cmd; |
| 467 | /* Sense buffer that will be mapped into outgoing status */ |
| 468 | #define ISCSI_SENSE_BUFFER_LEN (TRANSPORT_SENSE_BUFFER + 2) |
| 469 | unsigned char sense_buffer[ISCSI_SENSE_BUFFER_LEN]; |
| 470 | |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 471 | u32 padding; |
| 472 | u8 pad_bytes[4]; |
| 473 | |
| 474 | struct scatterlist *first_data_sg; |
| 475 | u32 first_data_sg_off; |
| 476 | u32 kmapped_nents; |
Christoph Hellwig | de103c9 | 2012-11-06 12:24:09 -0800 | [diff] [blame] | 477 | sense_reason_t sense_reason; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 478 | } ____cacheline_aligned; |
| 479 | |
| 480 | struct iscsi_tmr_req { |
| 481 | bool task_reassign:1; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 482 | u32 exp_data_sn; |
Christoph Hellwig | 9f3eb93 | 2012-05-20 14:35:02 -0400 | [diff] [blame] | 483 | struct iscsi_cmd *ref_cmd; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 484 | struct iscsi_conn_recovery *conn_recovery; |
| 485 | struct se_tmr_req *se_tmr_req; |
| 486 | }; |
| 487 | |
| 488 | struct iscsi_conn { |
Roland Dreier | d5627ac | 2012-10-31 09:16:46 -0700 | [diff] [blame] | 489 | wait_queue_head_t queues_wq; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 490 | /* Authentication Successful for this connection */ |
| 491 | u8 auth_complete; |
| 492 | /* State connection is currently in */ |
| 493 | u8 conn_state; |
| 494 | u8 conn_logout_reason; |
| 495 | u8 network_transport; |
| 496 | enum iscsi_timer_flags_table nopin_timer_flags; |
| 497 | enum iscsi_timer_flags_table nopin_response_timer_flags; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 498 | /* Used to know what thread encountered a transport failure */ |
| 499 | u8 which_thread; |
| 500 | /* connection id assigned by the Initiator */ |
| 501 | u16 cid; |
| 502 | /* Remote TCP Port */ |
| 503 | u16 login_port; |
Nicholas Bellinger | 2f9bc89 | 2012-01-16 23:33:48 -0800 | [diff] [blame] | 504 | u16 local_port; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 505 | int net_size; |
| 506 | u32 auth_id; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 507 | u32 conn_flags; |
| 508 | /* Used for iscsi_tx_login_rsp() */ |
Christoph Hellwig | 66c7db6 | 2012-09-26 08:00:39 -0400 | [diff] [blame] | 509 | itt_t login_itt; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 510 | u32 exp_statsn; |
| 511 | /* Per connection status sequence number */ |
| 512 | u32 stat_sn; |
| 513 | /* IFMarkInt's Current Value */ |
| 514 | u32 if_marker; |
| 515 | /* OFMarkInt's Current Value */ |
| 516 | u32 of_marker; |
| 517 | /* Used for calculating OFMarker offset to next PDU */ |
| 518 | u32 of_marker_offset; |
| 519 | /* Complete Bad PDU for sending reject */ |
| 520 | unsigned char bad_hdr[ISCSI_HDR_LEN]; |
| 521 | #define IPV6_ADDRESS_SPACE 48 |
| 522 | unsigned char login_ip[IPV6_ADDRESS_SPACE]; |
Nicholas Bellinger | 2f9bc89 | 2012-01-16 23:33:48 -0800 | [diff] [blame] | 523 | unsigned char local_ip[IPV6_ADDRESS_SPACE]; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 524 | int conn_usage_count; |
| 525 | int conn_waiting_on_uc; |
| 526 | atomic_t check_immediate_queue; |
| 527 | atomic_t conn_logout_remove; |
| 528 | atomic_t connection_exit; |
| 529 | atomic_t connection_recovery; |
| 530 | atomic_t connection_reinstatement; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 531 | atomic_t connection_wait_rcfr; |
| 532 | atomic_t sleep_on_conn_wait_comp; |
| 533 | atomic_t transport_failed; |
| 534 | struct completion conn_post_wait_comp; |
| 535 | struct completion conn_wait_comp; |
| 536 | struct completion conn_wait_rcfr_comp; |
| 537 | struct completion conn_waiting_on_uc_comp; |
| 538 | struct completion conn_logout_comp; |
| 539 | struct completion tx_half_close_comp; |
| 540 | struct completion rx_half_close_comp; |
| 541 | /* socket used by this connection */ |
| 542 | struct socket *sock; |
| 543 | struct timer_list nopin_timer; |
| 544 | struct timer_list nopin_response_timer; |
| 545 | struct timer_list transport_timer; |
| 546 | /* Spinlock used for add/deleting cmd's from conn_cmd_list */ |
| 547 | spinlock_t cmd_lock; |
| 548 | spinlock_t conn_usage_lock; |
| 549 | spinlock_t immed_queue_lock; |
| 550 | spinlock_t nopin_timer_lock; |
| 551 | spinlock_t response_queue_lock; |
| 552 | spinlock_t state_lock; |
| 553 | /* libcrypto RX and TX contexts for crc32c */ |
| 554 | struct hash_desc conn_rx_hash; |
| 555 | struct hash_desc conn_tx_hash; |
| 556 | /* Used for scheduling TX and RX connection kthreads */ |
| 557 | cpumask_var_t conn_cpumask; |
Dan Carpenter | f8d48ae | 2012-01-15 14:30:24 +0300 | [diff] [blame] | 558 | unsigned int conn_rx_reset_cpumask:1; |
| 559 | unsigned int conn_tx_reset_cpumask:1; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 560 | /* list_head of struct iscsi_cmd for this connection */ |
| 561 | struct list_head conn_cmd_list; |
| 562 | struct list_head immed_queue_list; |
| 563 | struct list_head response_queue_list; |
| 564 | struct iscsi_conn_ops *conn_ops; |
| 565 | struct iscsi_param_list *param_list; |
| 566 | /* Used for per connection auth state machine */ |
| 567 | void *auth_protocol; |
| 568 | struct iscsi_login_thread_s *login_thread; |
| 569 | struct iscsi_portal_group *tpg; |
| 570 | /* Pointer to parent session */ |
| 571 | struct iscsi_session *sess; |
| 572 | /* Pointer to thread_set in use for this conn's threads */ |
| 573 | struct iscsi_thread_set *thread_set; |
| 574 | /* list_head for session connection list */ |
| 575 | struct list_head conn_list; |
| 576 | } ____cacheline_aligned; |
| 577 | |
| 578 | struct iscsi_conn_recovery { |
| 579 | u16 cid; |
| 580 | u32 cmd_count; |
| 581 | u32 maxrecvdatasegmentlength; |
Nicholas Bellinger | 1c417f3 | 2012-09-29 22:14:51 -0700 | [diff] [blame] | 582 | u32 maxxmitdatasegmentlength; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 583 | int ready_for_reallegiance; |
| 584 | struct list_head conn_recovery_cmd_list; |
| 585 | spinlock_t conn_recovery_cmd_lock; |
| 586 | struct timer_list time2retain_timer; |
| 587 | struct iscsi_session *sess; |
| 588 | struct list_head cr_list; |
| 589 | } ____cacheline_aligned; |
| 590 | |
| 591 | struct iscsi_session { |
| 592 | u8 initiator_vendor; |
| 593 | u8 isid[6]; |
| 594 | enum iscsi_timer_flags_table time2retain_timer_flags; |
| 595 | u8 version_active; |
| 596 | u16 cid_called; |
| 597 | u16 conn_recovery_count; |
| 598 | u16 tsih; |
| 599 | /* state session is currently in */ |
| 600 | u32 session_state; |
| 601 | /* session wide counter: initiator assigned task tag */ |
Christoph Hellwig | 66c7db6 | 2012-09-26 08:00:39 -0400 | [diff] [blame] | 602 | itt_t init_task_tag; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 603 | /* session wide counter: target assigned task tag */ |
| 604 | u32 targ_xfer_tag; |
| 605 | u32 cmdsn_window; |
| 606 | |
| 607 | /* protects cmdsn values */ |
| 608 | struct mutex cmdsn_mutex; |
| 609 | /* session wide counter: expected command sequence number */ |
| 610 | u32 exp_cmd_sn; |
| 611 | /* session wide counter: maximum allowed command sequence number */ |
| 612 | u32 max_cmd_sn; |
| 613 | struct list_head sess_ooo_cmdsn_list; |
| 614 | |
| 615 | /* LIO specific session ID */ |
| 616 | u32 sid; |
| 617 | char auth_type[8]; |
| 618 | /* unique within the target */ |
| 619 | int session_index; |
| 620 | /* Used for session reference counting */ |
| 621 | int session_usage_count; |
| 622 | int session_waiting_on_uc; |
| 623 | u32 cmd_pdus; |
| 624 | u32 rsp_pdus; |
| 625 | u64 tx_data_octets; |
| 626 | u64 rx_data_octets; |
| 627 | u32 conn_digest_errors; |
| 628 | u32 conn_timeout_errors; |
| 629 | u64 creation_time; |
| 630 | spinlock_t session_stats_lock; |
| 631 | /* Number of active connections */ |
| 632 | atomic_t nconn; |
| 633 | atomic_t session_continuation; |
| 634 | atomic_t session_fall_back_to_erl0; |
| 635 | atomic_t session_logout; |
| 636 | atomic_t session_reinstatement; |
| 637 | atomic_t session_stop_active; |
| 638 | atomic_t sleep_on_sess_wait_comp; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 639 | /* connection list */ |
| 640 | struct list_head sess_conn_list; |
| 641 | struct list_head cr_active_list; |
| 642 | struct list_head cr_inactive_list; |
| 643 | spinlock_t conn_lock; |
| 644 | spinlock_t cr_a_lock; |
| 645 | spinlock_t cr_i_lock; |
| 646 | spinlock_t session_usage_lock; |
| 647 | spinlock_t ttt_lock; |
| 648 | struct completion async_msg_comp; |
| 649 | struct completion reinstatement_comp; |
| 650 | struct completion session_wait_comp; |
| 651 | struct completion session_waiting_on_uc_comp; |
| 652 | struct timer_list time2retain_timer; |
| 653 | struct iscsi_sess_ops *sess_ops; |
| 654 | struct se_session *se_sess; |
| 655 | struct iscsi_portal_group *tpg; |
| 656 | } ____cacheline_aligned; |
| 657 | |
| 658 | struct iscsi_login { |
| 659 | u8 auth_complete; |
| 660 | u8 checked_for_existing; |
| 661 | u8 current_stage; |
| 662 | u8 leading_connection; |
| 663 | u8 first_request; |
| 664 | u8 version_min; |
| 665 | u8 version_max; |
| 666 | char isid[6]; |
| 667 | u32 cmd_sn; |
Christoph Hellwig | 66c7db6 | 2012-09-26 08:00:39 -0400 | [diff] [blame] | 668 | itt_t init_task_tag; |
Nicholas Bellinger | e48354c | 2011-07-23 06:43:04 +0000 | [diff] [blame] | 669 | u32 initial_exp_statsn; |
| 670 | u32 rsp_length; |
| 671 | u16 cid; |
| 672 | u16 tsih; |
| 673 | char *req; |
| 674 | char *rsp; |
| 675 | char *req_buf; |
| 676 | char *rsp_buf; |
| 677 | } ____cacheline_aligned; |
| 678 | |
| 679 | struct iscsi_node_attrib { |
| 680 | u32 dataout_timeout; |
| 681 | u32 dataout_timeout_retries; |
| 682 | u32 default_erl; |
| 683 | u32 nopin_timeout; |
| 684 | u32 nopin_response_timeout; |
| 685 | u32 random_datain_pdu_offsets; |
| 686 | u32 random_datain_seq_offsets; |
| 687 | u32 random_r2t_offsets; |
| 688 | u32 tmr_cold_reset; |
| 689 | u32 tmr_warm_reset; |
| 690 | struct iscsi_node_acl *nacl; |
| 691 | }; |
| 692 | |
| 693 | struct se_dev_entry_s; |
| 694 | |
| 695 | struct iscsi_node_auth { |
| 696 | enum naf_flags_table naf_flags; |
| 697 | int authenticate_target; |
| 698 | /* Used for iscsit_global->discovery_auth, |
| 699 | * set to zero (auth disabled) by default */ |
| 700 | int enforce_discovery_auth; |
| 701 | #define MAX_USER_LEN 256 |
| 702 | #define MAX_PASS_LEN 256 |
| 703 | char userid[MAX_USER_LEN]; |
| 704 | char password[MAX_PASS_LEN]; |
| 705 | char userid_mutual[MAX_USER_LEN]; |
| 706 | char password_mutual[MAX_PASS_LEN]; |
| 707 | }; |
| 708 | |
| 709 | #include "iscsi_target_stat.h" |
| 710 | |
| 711 | struct iscsi_node_stat_grps { |
| 712 | struct config_group iscsi_sess_stats_group; |
| 713 | struct config_group iscsi_conn_stats_group; |
| 714 | }; |
| 715 | |
| 716 | struct iscsi_node_acl { |
| 717 | struct iscsi_node_attrib node_attrib; |
| 718 | struct iscsi_node_auth node_auth; |
| 719 | struct iscsi_node_stat_grps node_stat_grps; |
| 720 | struct se_node_acl se_node_acl; |
| 721 | }; |
| 722 | |
| 723 | #define NODE_STAT_GRPS(nacl) (&(nacl)->node_stat_grps) |
| 724 | |
| 725 | #define ISCSI_NODE_ATTRIB(t) (&(t)->node_attrib) |
| 726 | #define ISCSI_NODE_AUTH(t) (&(t)->node_auth) |
| 727 | |
| 728 | struct iscsi_tpg_attrib { |
| 729 | u32 authentication; |
| 730 | u32 login_timeout; |
| 731 | u32 netif_timeout; |
| 732 | u32 generate_node_acls; |
| 733 | u32 cache_dynamic_acls; |
| 734 | u32 default_cmdsn_depth; |
| 735 | u32 demo_mode_write_protect; |
| 736 | u32 prod_mode_write_protect; |
| 737 | struct iscsi_portal_group *tpg; |
| 738 | }; |
| 739 | |
| 740 | struct iscsi_np { |
| 741 | int np_network_transport; |
| 742 | int np_ip_proto; |
| 743 | int np_sock_type; |
| 744 | enum np_thread_state_table np_thread_state; |
| 745 | enum iscsi_timer_flags_table np_login_timer_flags; |
| 746 | u32 np_exports; |
| 747 | enum np_flags_table np_flags; |
| 748 | unsigned char np_ip[IPV6_ADDRESS_SPACE]; |
| 749 | u16 np_port; |
| 750 | spinlock_t np_thread_lock; |
| 751 | struct completion np_restart_comp; |
| 752 | struct socket *np_socket; |
| 753 | struct __kernel_sockaddr_storage np_sockaddr; |
| 754 | struct task_struct *np_thread; |
| 755 | struct timer_list np_login_timer; |
| 756 | struct iscsi_portal_group *np_login_tpg; |
| 757 | struct list_head np_list; |
| 758 | } ____cacheline_aligned; |
| 759 | |
| 760 | struct iscsi_tpg_np { |
| 761 | struct iscsi_np *tpg_np; |
| 762 | struct iscsi_portal_group *tpg; |
| 763 | struct iscsi_tpg_np *tpg_np_parent; |
| 764 | struct list_head tpg_np_list; |
| 765 | struct list_head tpg_np_child_list; |
| 766 | struct list_head tpg_np_parent_list; |
| 767 | struct se_tpg_np se_tpg_np; |
| 768 | spinlock_t tpg_np_parent_lock; |
| 769 | }; |
| 770 | |
| 771 | struct iscsi_portal_group { |
| 772 | unsigned char tpg_chap_id; |
| 773 | /* TPG State */ |
| 774 | enum tpg_state_table tpg_state; |
| 775 | /* Target Portal Group Tag */ |
| 776 | u16 tpgt; |
| 777 | /* Id assigned to target sessions */ |
| 778 | u16 ntsih; |
| 779 | /* Number of active sessions */ |
| 780 | u32 nsessions; |
| 781 | /* Number of Network Portals available for this TPG */ |
| 782 | u32 num_tpg_nps; |
| 783 | /* Per TPG LIO specific session ID. */ |
| 784 | u32 sid; |
| 785 | /* Spinlock for adding/removing Network Portals */ |
| 786 | spinlock_t tpg_np_lock; |
| 787 | spinlock_t tpg_state_lock; |
| 788 | struct se_portal_group tpg_se_tpg; |
| 789 | struct mutex tpg_access_lock; |
| 790 | struct mutex np_login_lock; |
| 791 | struct iscsi_tpg_attrib tpg_attrib; |
| 792 | /* Pointer to default list of iSCSI parameters for TPG */ |
| 793 | struct iscsi_param_list *param_list; |
| 794 | struct iscsi_tiqn *tpg_tiqn; |
| 795 | struct list_head tpg_gnp_list; |
| 796 | struct list_head tpg_list; |
| 797 | } ____cacheline_aligned; |
| 798 | |
| 799 | #define ISCSI_TPG_C(c) ((struct iscsi_portal_group *)(c)->tpg) |
| 800 | #define ISCSI_TPG_LUN(c, l) ((iscsi_tpg_list_t *)(c)->tpg->tpg_lun_list_t[l]) |
| 801 | #define ISCSI_TPG_S(s) ((struct iscsi_portal_group *)(s)->tpg) |
| 802 | #define ISCSI_TPG_ATTRIB(t) (&(t)->tpg_attrib) |
| 803 | #define SE_TPG(tpg) (&(tpg)->tpg_se_tpg) |
| 804 | |
| 805 | struct iscsi_wwn_stat_grps { |
| 806 | struct config_group iscsi_stat_group; |
| 807 | struct config_group iscsi_instance_group; |
| 808 | struct config_group iscsi_sess_err_group; |
| 809 | struct config_group iscsi_tgt_attr_group; |
| 810 | struct config_group iscsi_login_stats_group; |
| 811 | struct config_group iscsi_logout_stats_group; |
| 812 | }; |
| 813 | |
| 814 | struct iscsi_tiqn { |
| 815 | #define ISCSI_IQN_LEN 224 |
| 816 | unsigned char tiqn[ISCSI_IQN_LEN]; |
| 817 | enum tiqn_state_table tiqn_state; |
| 818 | int tiqn_access_count; |
| 819 | u32 tiqn_active_tpgs; |
| 820 | u32 tiqn_ntpgs; |
| 821 | u32 tiqn_num_tpg_nps; |
| 822 | u32 tiqn_nsessions; |
| 823 | struct list_head tiqn_list; |
| 824 | struct list_head tiqn_tpg_list; |
| 825 | spinlock_t tiqn_state_lock; |
| 826 | spinlock_t tiqn_tpg_lock; |
| 827 | struct se_wwn tiqn_wwn; |
| 828 | struct iscsi_wwn_stat_grps tiqn_stat_grps; |
| 829 | int tiqn_index; |
| 830 | struct iscsi_sess_err_stats sess_err_stats; |
| 831 | struct iscsi_login_stats login_stats; |
| 832 | struct iscsi_logout_stats logout_stats; |
| 833 | } ____cacheline_aligned; |
| 834 | |
| 835 | #define WWN_STAT_GRPS(tiqn) (&(tiqn)->tiqn_stat_grps) |
| 836 | |
| 837 | struct iscsit_global { |
| 838 | /* In core shutdown */ |
| 839 | u32 in_shutdown; |
| 840 | u32 active_ts; |
| 841 | /* Unique identifier used for the authentication daemon */ |
| 842 | u32 auth_id; |
| 843 | u32 inactive_ts; |
| 844 | /* Thread Set bitmap count */ |
| 845 | int ts_bitmap_count; |
| 846 | /* Thread Set bitmap pointer */ |
| 847 | unsigned long *ts_bitmap; |
| 848 | /* Used for iSCSI discovery session authentication */ |
| 849 | struct iscsi_node_acl discovery_acl; |
| 850 | struct iscsi_portal_group *discovery_tpg; |
| 851 | }; |
| 852 | |
| 853 | #endif /* ISCSI_TARGET_CORE_H */ |