On Fri, 2012-03-30 at 11:29 -0700, Roland Dreier wrote:
> From: Roland Dreier <roland@xxxxxxxxxxxxxxx>
>
> With the modern target core, se_cmd->t_data_sg already points to a
> sglist that covers the whole command. So task_sg chaining is needless
> overhead and obfuscation -- instead of splicing the split up task
> sglists back into one list, we can just use the original list directly.
>
> Signed-off-by: Roland Dreier <roland@xxxxxxxxxxxxxxx>
> ---
Applied with a Cc: to Arun here..
Thanks Roland!
--nab
> drivers/scsi/qla2xxx/qla_target.c | 4 ++--
> drivers/scsi/qla2xxx/tcm_qla2xxx.c | 23 +++++------------------
> 2 files changed, 7 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
> index 0cbd9cc..c834ef3 100644
> --- a/drivers/scsi/qla2xxx/qla_target.c
> +++ b/drivers/scsi/qla2xxx/qla_target.c
> @@ -3224,8 +3224,8 @@ restart:
> }
> se_cmd = &cmd->se_cmd;
>
> - cmd->sg_cnt = se_cmd->t_tasks_sg_chained_no;
> - cmd->sg = se_cmd->t_tasks_sg_chained;
> + cmd->sg_cnt = se_cmd->t_data_nents;
> + cmd->sg = se_cmd->t_data_sg;
>
> ql_dbg(ql_dbg_tgt_mgt, vha, 0xe131, "SRR cmd %p (se_cmd %p, tag %d, op %x), "
> "sg_cnt=%d, offset=%d", cmd, &cmd->se_cmd,
> diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
> index c2b716e..c8e5b68 100644
> --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
> +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
> @@ -517,13 +517,8 @@ int tcm_qla2xxx_write_pending(struct se_cmd *se_cmd)
>
> cmd->bufflen = se_cmd->data_length;
> cmd->dma_data_direction = tcm_qla2xxx_mapping_dir(se_cmd);
> -
> - /*
> - * Setup the struct se_task->task_sg[] chained SG list
> - */
> - transport_do_task_sg_chain(se_cmd);
> - cmd->sg_cnt = se_cmd->t_tasks_sg_chained_no;
> - cmd->sg = se_cmd->t_tasks_sg_chained;
> + cmd->sg_cnt = se_cmd->t_data_nents;
> + cmd->sg = se_cmd->t_data_sg;
>
> /*
> * qla_target.c:qla_tgt_rdy_to_xfer() will call pci_map_sg() to setup
> @@ -666,13 +661,8 @@ int tcm_qla2xxx_queue_data_in(struct se_cmd *se_cmd)
> cmd->bufflen = se_cmd->data_length;
> cmd->dma_data_direction = tcm_qla2xxx_mapping_dir(se_cmd);
> cmd->aborted = (se_cmd->transport_state & CMD_T_ABORTED);
> -
> - /*
> - * Setup the struct se_task->task_sg[] chained SG list
> - */
> - transport_do_task_sg_chain(se_cmd);
> - cmd->sg_cnt = se_cmd->t_tasks_sg_chained_no;
> - cmd->sg = se_cmd->t_tasks_sg_chained;
> + cmd->sg_cnt = se_cmd->t_data_nents;
> + cmd->sg = se_cmd->t_data_sg;
> cmd->offset = 0;
>
> /*
> @@ -1850,10 +1840,7 @@ static int tcm_qla2xxx_register_configfs(void)
> * Setup fabric->tf_ops from our local tcm_qla2xxx_ops
> */
> fabric->tf_ops = tcm_qla2xxx_ops;
> - /*
> - * Setup the struct se_task->task_sg[] chaining bit
> - */
> - fabric->tf_ops.task_sg_chaining = 1;
> +
> /*
> * Setup default attribute lists for various fabric->tf_cit_tmpl
> */
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux SCSI]
[Kernel Newbies]
[Linux SCSI Target Infrastructure]
[Share Photos]
[IDE]
[Security]
[Git]
[Netfilter]
[Bugtraq]
[Photos]
[Yosemite]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Linux ATA RAID]
[Linux IIO]
[Samba]
[Video 4 Linux]
[Device Mapper]
[Linux Resources]