/* * Maximum size of a CDB that can be stored in se_cmd without allocating * memory dynamically for the CDB.
*/ #define TCM_MAX_COMMAND_SIZE 32 /* * From include/scsi/scsi_cmnd.h:SCSI_SENSE_BUFFERSIZE, currently * defined 96, but the real limit is 252 (or 260 including the header)
*/ #define TRANSPORT_SENSE_BUFFER 96 /* Used by transport_send_check_condition_and_sense() */ #define SPC_SENSE_KEY_OFFSET 2 #define SPC_ADD_SENSE_LEN_OFFSET 7 #define SPC_DESC_TYPE_OFFSET 8 #define SPC_ADDITIONAL_DESC_LEN_OFFSET 9 #define SPC_VALIDITY_OFFSET 10 #define SPC_ASC_KEY_OFFSET 12 #define SPC_ASCQ_KEY_OFFSET 13 #define TRANSPORT_IQN_LEN 224 /* Used by target_core_store_alua_lu_gp() and target_core_alua_lu_gp_show_attr_members() */ #define LU_GROUP_NAME_BUF 256 /* Used by core_alua_store_tg_pt_gp_info() and target_core_alua_tg_pt_gp_show_attr_members() */ #define TG_PT_GROUP_NAME_BUF 256 /* Used to parse VPD into struct t10_vpd */ #define VPD_TMP_BUF_SIZE 254 /* Used by transport_generic_cmd_sequencer() */ #define READ_BLOCK_LEN 6 #define READ_CAP_LEN 8 #define READ_POSITION_LEN 20 #define INQUIRY_LEN 36 /* Used by transport_get_inquiry_vpd_serial() */ #define INQUIRY_VPD_SERIAL_LEN 254 /* Used by transport_get_inquiry_vpd_device_ident() */ #define INQUIRY_VPD_DEVICE_IDENTIFIER_LEN 254
/* Attempts before moving from SHORT to LONG */ #define PYX_TRANSPORT_WINDOW_CLOSED_THRESHOLD 3 #define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_SHORT 3 /* In milliseconds */ #define PYX_TRANSPORT_WINDOW_CLOSED_WAIT_LONG 10 /* In milliseconds */
#define PYX_TRANSPORT_STATUS_INTERVAL 5 /* In seconds */
/* struct se_dev_attrib sanity values */ /* Default max_unmap_lba_count */ #define DA_MAX_UNMAP_LBA_COUNT 0 /* Default max_unmap_block_desc_count */ #define DA_MAX_UNMAP_BLOCK_DESC_COUNT 0 /* Default unmap_granularity */ #define DA_UNMAP_GRANULARITY_DEFAULT 0 /* Default unmap_granularity_alignment */ #define DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT 0 /* Default unmap_zeroes_data */ #define DA_UNMAP_ZEROES_DATA_DEFAULT 0 /* Default max_write_same_len, disabled by default */ #define DA_MAX_WRITE_SAME_LEN 0 /* Use a model alias based on the configfs backend device name */ #define DA_EMULATE_MODEL_ALIAS 0 /* Emulation for WriteCache and SYNCHRONIZE_CACHE */ #define DA_EMULATE_WRITE_CACHE 0 /* Emulation for TASK_ABORTED status (TAS) by default */ #define DA_EMULATE_TAS 1 /* Emulation for Thin Provisioning UNMAP using block/blk-lib.c:blkdev_issue_discard() */ #define DA_EMULATE_TPU 0 /* * Emulation for Thin Provisioning WRITE_SAME w/ UNMAP=1 bit using * block/blk-lib.c:blkdev_issue_discard()
*/ #define DA_EMULATE_TPWS 0 /* Emulation for CompareAndWrite (AtomicTestandSet) by default */ #define DA_EMULATE_CAW 1 /* Emulation for 3rd Party Copy (ExtendedCopy) by default */ #define DA_EMULATE_3PC 1 /* No Emulation for PSCSI by default */ #define DA_EMULATE_ALUA 0 /* Emulate SCSI2 RESERVE/RELEASE and Persistent Reservations by default */ #define DA_EMULATE_PR 1 /* Emulation for REPORT SUPPORTED OPERATION CODES */ #define DA_EMULATE_RSOC 1 /* Enforce SCSI Initiator Port TransportID with 'ISID' for PR */ #define DA_ENFORCE_PR_ISIDS 1 /* Force SPC-3 PR Activate Persistence across Target Power Loss */ #define DA_FORCE_PR_APTPL 0 #define DA_STATUS_MAX_SECTORS_MIN 16 #define DA_STATUS_MAX_SECTORS_MAX 8192 /* By default don't report non-rotating (solid state) medium */ #define DA_IS_NONROT 0 /* Queue Algorithm Modifier default for restricted reordering in control mode page */ #define DA_EMULATE_REST_REORD 0
enum target_submit_type { /* Use the fabric driver's default submission type */
TARGET_FABRIC_DEFAULT_SUBMIT, /* Submit from the calling context */
TARGET_DIRECT_SUBMIT, /* Defer submission to the LIO workqueue */
TARGET_QUEUE_SUBMIT,
};
/* * Used by transport_send_check_condition_and_sense() * to signal which ASC/ASCQ sense payload should be built.
*/ typedefunsigned __bitwise sense_reason_t;
struct t10_alua { /* ALUA Target Port Group ID */
u16 alua_tg_pt_gps_counter;
u32 alua_tg_pt_gps_count; /* Referrals support */
spinlock_t lba_map_lock;
u32 lba_map_segment_size;
u32 lba_map_segment_multiplier; struct list_head lba_map_list;
spinlock_t tg_pt_gps_lock; struct se_device *t10_dev; /* Used for default ALUA Target Port Group */ struct t10_alua_tg_pt_gp *default_tg_pt_gp; /* Used for default ALUA Target Port Group ConfigFS group */ struct config_group alua_tg_pt_gps_group; struct list_head tg_pt_gps_list;
};
struct t10_wwn { /* * SCSI left aligned strings may not be null terminated. +1 to ensure a * null terminator is always present.
*/ char vendor[INQUIRY_VENDOR_LEN + 1]; char model[INQUIRY_MODEL_LEN + 1]; char revision[INQUIRY_REVISION_LEN + 1]; char unit_serial[INQUIRY_VPD_SERIAL_LEN];
u32 company_id;
spinlock_t t10_vpd_lock; struct se_device *t10_dev; struct config_group t10_wwn_group; struct list_head t10_vpd_list;
};
struct t10_pr_registration { /* Used for fabrics that contain WWN+ISID */ #define PR_REG_ISID_LEN 16 /* PR_REG_ISID_LEN + ',i,0x' */ #define PR_REG_ISID_ID_LEN (PR_REG_ISID_LEN + 5) char pr_reg_isid[PR_REG_ISID_LEN]; /* Used during APTPL metadata reading */ #define PR_APTPL_MAX_IPORT_LEN 256 unsignedchar pr_iport[PR_APTPL_MAX_IPORT_LEN]; /* Used during APTPL metadata reading */ #define PR_APTPL_MAX_TPORT_LEN 256 unsignedchar pr_tport[PR_APTPL_MAX_TPORT_LEN];
u16 pr_aptpl_rpti;
u16 pr_reg_tpgt; /* Reservation effects all target ports */ int pr_reg_all_tg_pt; /* Activate Persistence across Target Power Loss */ int pr_reg_aptpl; int pr_res_holder; int pr_res_type; int pr_res_scope; /* Used for fabric initiator WWPNs using a ISID */ bool isid_present_at_reg;
u64 pr_res_mapped_lun;
u64 pr_aptpl_target_lun;
u16 tg_pt_sep_rtpi;
u32 pr_res_generation;
u64 pr_reg_bin_isid;
u64 pr_res_key;
atomic_t pr_res_holders; struct se_node_acl *pr_reg_nacl; /* Used by ALL_TG_PT=1 registration with deve->pr_ref taken */ struct se_dev_entry *pr_reg_deve; struct list_head pr_reg_list; struct list_head pr_reg_abort_list; struct list_head pr_reg_aptpl_list; struct list_head pr_reg_atp_list; struct list_head pr_reg_atp_mem_list;
};
struct t10_reservation { /* Reservation effects all target ports */ int pr_all_tg_pt; /* Activate Persistence across Target Power Loss enabled
* for SCSI device */ int pr_aptpl_active; #define PR_APTPL_BUF_LEN 262144
u32 pr_generation;
spinlock_t registration_lock;
spinlock_t aptpl_reg_lock; /* * This will always be set by one individual I_T Nexus. * However with all_tg_pt=1, other I_T Nexus from the * same initiator can access PR reg/res info on a different * target port. * * There is also the 'All Registrants' case, where there is * a single *pr_res_holder of the reservation, but all * registrations are considered reservation holders.
*/ struct se_node_acl *pr_res_holder; struct list_head registration_list; struct list_head aptpl_reg_list;
};
struct se_tmr_req { /* Task Management function to be performed */
u8 function; /* Task Management response to send */
u8 response; int call_transport; /* Reference to ITT that Task Mgmt should be performed */
u64 ref_task_tag; void *fabric_tmr_ptr; struct se_cmd *task_cmd; struct se_device *tmr_dev; struct list_head tmr_list;
};
struct se_cmd { /* Used for fail with specific sense codes */
sense_reason_t sense_reason; /* SAM response code being sent to initiator */
u8 scsi_status;
u16 scsi_sense_length; unsigned unknown_data_length:1; bool state_active:1;
u64 tag; /* SAM command identifier aka task tag */ /* Delay for ALUA Active/NonOptimized state access in milliseconds */ int alua_nonop_delay; /* See include/linux/dma-mapping.h */ enum dma_data_direction data_direction; /* For SAM Task Attribute */ int sam_task_attr; /* Used for se_sess->sess_tag_pool */ unsignedint map_tag; int map_cpu; /* Transport protocol dependent state, see transport_state_table */ enum transport_state_table t_state; /* See se_cmd_flags_table */
u32 se_cmd_flags; /* Total size in bytes associated with command */
u32 data_length;
u32 residual_count;
u64 orig_fe_lun; /* Persistent Reservation key */
u64 pr_res_key; /* Used for sense data */ void *sense_buffer; struct list_head se_delayed_node; struct list_head se_qf_node; struct se_device *se_dev; struct se_lun *se_lun; /* Only used for internal passthrough and legacy TCM fabric modules */ struct se_session *se_sess; struct target_cmd_counter *cmd_cnt; struct se_tmr_req *se_tmr_req; struct llist_node se_cmd_list; struct completion *free_compl; struct completion *abrt_compl; conststruct target_core_fabric_ops *se_tfo;
sense_reason_t (*execute_cmd)(struct se_cmd *);
sense_reason_t (*transport_complete_callback)(struct se_cmd *, bool, int *); void *protocol_data;
/* Used for lun->lun_ref counting */ int lun_ref_active;
struct list_head state_list;
/* backend private data */ void *priv;
/* DIF related members */ enum target_prot_op prot_op; enum target_prot_type prot_type;
u8 prot_checks; bool prot_pto;
u32 prot_length;
u32 reftag_seed; struct scatterlist *t_prot_sg; unsignedint t_prot_nents;
sense_reason_t pi_err;
u64 sense_info; /* * CPU LIO will execute the cmd on. Defaults to the CPU the cmd is * initialized on. Drivers can override.
*/ int cpuid;
};
/* ALUA state */ int lun_tg_pt_secondary_stat; int lun_tg_pt_secondary_write_md;
atomic_t lun_tg_pt_secondary_offline; struct mutex lun_tg_pt_md_mutex;
/* ALUA target port group linkage */ struct list_head lun_tg_pt_gp_link; struct t10_alua_tg_pt_gp __rcu *lun_tg_pt_gp;
spinlock_t lun_tg_pt_gp_lock;
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.