#define ISCSI_ITT_MASK 0x1fff #define ISCSI_TOTAL_CMDS_MAX 4096 /* this must be a power of two greater than ISCSI_MGMT_CMDS_MAX */ #define ISCSI_TOTAL_CMDS_MIN 16 #define ISCSI_AGE_SHIFT 28 #define ISCSI_AGE_MASK 0xf
#define ISCSI_ADDRESS_BUF_LEN 64
enum { /* this is the maximum possible storage for AHSs */
ISCSI_MAX_AHS_SIZE = sizeof(struct iscsi_ecdb_ahdr) + sizeof(struct iscsi_rlength_ahdr),
ISCSI_DIGEST_SIZE = sizeof(__u32),
};
enum {
ISCSI_TASK_FREE,
ISCSI_TASK_COMPLETED,
ISCSI_TASK_PENDING,
ISCSI_TASK_RUNNING,
ISCSI_TASK_ABRT_TMF, /* aborted due to TMF */
ISCSI_TASK_ABRT_SESS_RECOV, /* aborted due to session recovery */
ISCSI_TASK_REQUEUE_SCSIQ, /* qcmd requeueing to scsi-ml */
};
struct iscsi_r2t_info {
__be32 ttt; /* copied from R2T */
__be32 exp_statsn; /* copied from R2T */
uint32_t data_length; /* copied from R2T */
uint32_t data_offset; /* copied from R2T */ int data_count; /* DATA-Out payload progress */ int datasn; /* LLDs should set/update these values */ int sent; /* R2T sequence progress */
};
struct iscsi_task { /* * Because LLDs allocate their hdr differently, this is a pointer * and length to that storage. It must be setup at session * creation time.
*/ struct iscsi_hdr *hdr; unsignedshort hdr_max; unsignedshort hdr_len; /* accumulated size of hdr used */ /* copied values in case we need to send tmfs */
itt_t hdr_itt;
__be32 cmdsn; struct scsi_lun lun;
/* state set/tested under session->lock */ int state;
refcount_t refcount; struct list_head running; /* running cmd list */ void *dd_data; /* driver/transport data */
};
/* control data */ int id; /* CID */ int c_stage; /* connection state */ /* * Preallocated buffer for pdus that have data but do not * originate from scsi-ml. We never have two pdus using the * buffer at the same time. It is only allocated to * the default max recv size because the pdus we support * should always fit in this buffer
*/ char *data; struct iscsi_task *login_task; /* mtask used for login/text */ struct iscsi_task *task; /* xmit task in progress */
/* negotiated params */ unsigned max_recv_dlength; /* initiator_max_recv_dsl*/ unsigned max_xmit_dlength; /* target_max_recv_dsl */ int hdrdgst_en; int datadgst_en; int ifmarker_en; int ofmarker_en; /* values userspace uses to id a conn */ int persistent_port; char *persistent_address;
struct iscsi_session { struct iscsi_cls_session *cls_session; /* * Syncs up the scsi eh thread with the iscsi eh thread when sending * task management functions. This must be taken before the session * and recv lock.
*/ struct mutex eh_mutex; /* abort */
wait_queue_head_t ehwait; /* used in eh_abort() */ struct iscsi_tm tmhdr; struct timer_list tmf_timer; int tmf_state; /* see TMF_INITIAL, etc.*/ struct iscsi_task *running_aborted_task;
/* This tracks the reqs queued into the initiator */
uint32_t queued_cmdsn;
/* configuration */ int abort_timeout; int lu_reset_timeout; int tgt_reset_timeout; int initial_r2t_en; unsignedshort max_r2t; int imm_data_en; unsigned first_burst; unsigned max_burst; int time2wait; int time2retain; int pdu_inorder_en; int dataseq_inorder_en; int erl; int fast_abort; int tpgt; char *username; char *username_in; char *password; char *password_in; char *targetname; char *targetalias; char *ifacename; char *initiatorname; char *boot_root; char *boot_nic; char *boot_target; char *portal_type; char *discovery_parent_type;
uint16_t discovery_parent_idx;
uint16_t def_taskmgmt_tmo;
uint16_t tsid;
uint8_t auto_snd_tgt_disable;
uint8_t discovery_sess;
uint8_t chap_auth_en;
uint8_t discovery_logout_en;
uint8_t bidi_chap_en;
uint8_t discovery_auth_optional;
uint8_t isid[ISID_SIZE];
/* control data */ struct iscsi_transport *tt; struct Scsi_Host *host; struct iscsi_conn *leadconn; /* leading connection */ /* Between the forward and the backward locks exists a strict locking * hierarchy. The mutual exclusion zone protected by the forward lock * can enclose the mutual exclusion zone protected by the backward lock * but not vice versa.
*/
spinlock_t frwd_lock; /* protects session state, * * cmdsn, queued_cmdsn * * session resources: * * - cmdpool kfifo_out , *
* - mgmtpool, queues */
spinlock_t back_lock; /* protects cmdsn_exp * * cmdsn_max, *
* cmdpool kfifo_in */ int state; /* session state */ int age; /* counts session re-opens */
int scsi_cmds_max; /* max scsi commands */ int cmds_max; /* size of cmds array */ struct iscsi_task **cmds; /* Original Cmds arr */ struct iscsi_pool cmdpool; /* PDU's pool */ void *dd_data; /* LLD private data */
};
enum {
ISCSI_HOST_SETUP,
ISCSI_HOST_REMOVED,
};
struct iscsi_host { char *initiatorname; /* hw address or netdev iscsi connection is bound to */ char *hwaddress; char *netdev;
wait_queue_head_t session_removal_wq; /* protects sessions and state */
spinlock_t lock; int num_sessions; int state;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.