diff options
Diffstat (limited to 'include/target')
-rw-r--r-- | include/target/target_core_base.h | 105 | ||||
-rw-r--r-- | include/target/target_core_fabric_ops.h | 5 | ||||
-rw-r--r-- | include/target/target_core_transport.h | 3 |
3 files changed, 49 insertions, 64 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 94c838d..71c96ce 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -403,64 +403,10 @@ struct se_queue_obj { wait_queue_head_t thread_wq; } ____cacheline_aligned; -/* - * Used one per struct se_cmd to hold all extra struct se_task - * metadata. This structure is setup and allocated in - * drivers/target/target_core_transport.c:__transport_alloc_se_cmd() - */ -struct se_transport_task { - unsigned char *t_task_cdb; - unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE]; - unsigned long long t_task_lba; - int t_tasks_failed; - int t_tasks_fua; - bool t_tasks_bidi; - u32 t_task_cdbs; - u32 t_tasks_check; - u32 t_tasks_no; - u32 t_tasks_sectors; - u32 t_tasks_se_num; - u32 t_tasks_se_bidi_num; - u32 t_tasks_sg_chained_no; - atomic_t t_fe_count; - atomic_t t_se_count; - atomic_t t_task_cdbs_left; - atomic_t t_task_cdbs_ex_left; - atomic_t t_task_cdbs_timeout_left; - atomic_t t_task_cdbs_sent; - atomic_t t_transport_aborted; - atomic_t t_transport_active; - atomic_t t_transport_complete; - atomic_t t_transport_queue_active; - atomic_t t_transport_sent; - atomic_t t_transport_stop; - atomic_t t_transport_timeout; - atomic_t transport_dev_active; - atomic_t transport_lun_active; - atomic_t transport_lun_fe_stop; - atomic_t transport_lun_stop; - spinlock_t t_state_lock; - struct completion t_transport_stop_comp; - struct completion transport_lun_fe_stop_comp; - struct completion transport_lun_stop_comp; - struct scatterlist *t_tasks_sg_chained; - struct scatterlist t_tasks_sg_bounce; - void *t_task_buf; - /* - * Used for pre-registered fabric SGL passthrough WRITE and READ - * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop - * and other HW target mode fabric modules. - */ - struct scatterlist *t_task_pt_sgl; - struct list_head t_mem_list; - /* Used for BIDI READ */ - struct list_head t_mem_bidi_list; - struct list_head t_task_list; -} ____cacheline_aligned; - struct se_task { unsigned char task_sense; struct scatterlist *task_sg; + u32 task_sg_num; struct scatterlist *task_sg_bidi; u8 task_scsi_status; u8 task_flags; @@ -471,8 +417,6 @@ struct se_task { u32 task_no; u32 task_sectors; u32 task_size; - u32 task_sg_num; - u32 task_sg_offset; enum dma_data_direction task_data_direction; struct se_cmd *task_se_cmd; struct se_device *se_dev; @@ -534,13 +478,58 @@ struct se_cmd { /* Only used for internal passthrough and legacy TCM fabric modules */ struct se_session *se_sess; struct se_tmr_req *se_tmr_req; - struct se_transport_task t_task; struct list_head se_queue_node; struct target_core_fabric_ops *se_tfo; int (*transport_emulate_cdb)(struct se_cmd *); void (*transport_split_cdb)(unsigned long long, u32 *, unsigned char *); void (*transport_wait_for_tasks)(struct se_cmd *, int, int); void (*transport_complete_callback)(struct se_cmd *); + unsigned char *t_task_cdb; + unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE]; + unsigned long long t_task_lba; + int t_tasks_failed; + int t_tasks_fua; + bool t_tasks_bidi; + u32 t_tasks_se_num; + u32 t_tasks_se_bidi_num; + u32 t_tasks_sg_chained_no; + atomic_t t_fe_count; + atomic_t t_se_count; + atomic_t t_task_cdbs_left; + atomic_t t_task_cdbs_ex_left; + atomic_t t_task_cdbs_timeout_left; + atomic_t t_task_cdbs_sent; + atomic_t t_transport_aborted; + atomic_t t_transport_active; + atomic_t t_transport_complete; + atomic_t t_transport_queue_active; + atomic_t t_transport_sent; + atomic_t t_transport_stop; + atomic_t t_transport_timeout; + atomic_t transport_dev_active; + atomic_t transport_lun_active; + atomic_t transport_lun_fe_stop; + atomic_t transport_lun_stop; + spinlock_t t_state_lock; + struct completion t_transport_stop_comp; + struct completion transport_lun_fe_stop_comp; + struct completion transport_lun_stop_comp; + struct scatterlist *t_tasks_sg_chained; + struct scatterlist t_tasks_sg_bounce; + void *t_task_buf; + /* + * Used for pre-registered fabric SGL passthrough WRITE and READ + * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop + * and other HW target mode fabric modules. + */ + struct scatterlist *t_task_pt_sgl; + u32 t_task_pt_sgl_num; + struct list_head t_mem_list; + /* Used for BIDI READ */ + struct list_head t_mem_bidi_list; + struct list_head t_task_list; + u32 t_task_list_num; + } ____cacheline_aligned; struct se_tmr_req { diff --git a/include/target/target_core_fabric_ops.h b/include/target/target_core_fabric_ops.h index 747e140..1752ed3 100644 --- a/include/target/target_core_fabric_ops.h +++ b/include/target/target_core_fabric_ops.h @@ -39,11 +39,6 @@ struct target_core_fabric_ops { */ int (*new_cmd_map)(struct se_cmd *); /* - * Optional function pointer for TCM fabric modules that use - * Linux/NET sockets to allocate struct iovec array to struct se_cmd - */ - int (*alloc_cmd_iovecs)(struct se_cmd *); - /* * Optional to release struct se_cmd and fabric dependent allocated * I/O descriptor in transport_cmd_check_stop() */ diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h index acd5914..c9846d5 100644 --- a/include/target/target_core_transport.h +++ b/include/target/target_core_transport.h @@ -184,10 +184,11 @@ extern void transport_generic_free_cmd(struct se_cmd *, int, int, int); extern void transport_generic_wait_for_cmds(struct se_cmd *, int); extern int transport_init_task_sg(struct se_task *, struct se_mem *, u32); extern int transport_map_mem_to_sg(struct se_task *, struct list_head *, - void *, struct se_mem *, + struct scatterlist *, struct se_mem *, struct se_mem **, u32 *, u32 *); extern void transport_do_task_sg_chain(struct se_cmd *); extern void transport_generic_process_write(struct se_cmd *); +extern int transport_generic_new_cmd(struct se_cmd *); extern int transport_generic_do_tmr(struct se_cmd *); /* From target_core_alua.c */ extern int core_alua_check_nonop_delay(struct se_cmd *); |