diff options
author | Christoph Hellwig <hch@infradead.org> | 2012-07-08 15:58:44 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-07-16 20:35:19 -0400 |
commit | 43381ce8bb14d2536102fe700b43e97da1410169 (patch) | |
tree | ddef0a2b19ce900469d70fe2bf94c497249f056a /drivers/scsi/qla2xxx/tcm_qla2xxx.c | |
parent | e672a47fd99b47589dfe2f85759e4c8de526196b (diff) |
tcm_qla2xxx: Offload WRITE I/O backend submission to tcm_qla2xxx wq
Defer the whole tcm_qla2xxx_handle_data call instead of just the error
path to the qla2xxx-internal workqueue. Also remove the useless lock around
the CMD_T_ABORTED check.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Roland Dreier <roland@purestorage.com>
Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
Cc: tcm-qla2xxx@qlogic.com
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/scsi/qla2xxx/tcm_qla2xxx.c')
-rw-r--r-- | drivers/scsi/qla2xxx/tcm_qla2xxx.c | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index dd0a0dfd6e4..977cb8b1e42 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c | |||
@@ -604,22 +604,10 @@ static int tcm_qla2xxx_handle_cmd(scsi_qla_host_t *vha, struct qla_tgt_cmd *cmd, | |||
604 | return 0; | 604 | return 0; |
605 | } | 605 | } |
606 | 606 | ||
607 | static void tcm_qla2xxx_do_rsp(struct work_struct *work) | 607 | static void tcm_qla2xxx_handle_data_work(struct work_struct *work) |
608 | { | 608 | { |
609 | struct qla_tgt_cmd *cmd = container_of(work, struct qla_tgt_cmd, work); | 609 | struct qla_tgt_cmd *cmd = container_of(work, struct qla_tgt_cmd, work); |
610 | /* | ||
611 | * Dispatch ->queue_status from workqueue process context | ||
612 | */ | ||
613 | transport_generic_request_failure(&cmd->se_cmd); | ||
614 | } | ||
615 | 610 | ||
616 | /* | ||
617 | * Called from qla_target.c:qlt_do_ctio_completion() | ||
618 | */ | ||
619 | static int tcm_qla2xxx_handle_data(struct qla_tgt_cmd *cmd) | ||
620 | { | ||
621 | struct se_cmd *se_cmd = &cmd->se_cmd; | ||
622 | unsigned long flags; | ||
623 | /* | 611 | /* |
624 | * Ensure that the complete FCP WRITE payload has been received. | 612 | * Ensure that the complete FCP WRITE payload has been received. |
625 | * Otherwise return an exception via CHECK_CONDITION status. | 613 | * Otherwise return an exception via CHECK_CONDITION status. |
@@ -629,24 +617,26 @@ static int tcm_qla2xxx_handle_data(struct qla_tgt_cmd *cmd) | |||
629 | * Check if se_cmd has already been aborted via LUN_RESET, and | 617 | * Check if se_cmd has already been aborted via LUN_RESET, and |
630 | * waiting upon completion in tcm_qla2xxx_write_pending_status() | 618 | * waiting upon completion in tcm_qla2xxx_write_pending_status() |
631 | */ | 619 | */ |
632 | spin_lock_irqsave(&se_cmd->t_state_lock, flags); | 620 | if (cmd->se_cmd.transport_state & CMD_T_ABORTED) { |
633 | if (se_cmd->transport_state & CMD_T_ABORTED) { | 621 | complete(&cmd->se_cmd.t_transport_stop_comp); |
634 | spin_unlock_irqrestore(&se_cmd->t_state_lock, flags); | 622 | return; |
635 | complete(&se_cmd->t_transport_stop_comp); | ||
636 | return 0; | ||
637 | } | 623 | } |
638 | spin_unlock_irqrestore(&se_cmd->t_state_lock, flags); | ||
639 | 624 | ||
640 | se_cmd->scsi_sense_reason = TCM_CHECK_CONDITION_ABORT_CMD; | 625 | cmd->se_cmd.scsi_sense_reason = TCM_CHECK_CONDITION_ABORT_CMD; |
641 | INIT_WORK(&cmd->work, tcm_qla2xxx_do_rsp); | 626 | transport_generic_request_failure(&cmd->se_cmd); |
642 | queue_work(tcm_qla2xxx_free_wq, &cmd->work); | 627 | return; |
643 | return 0; | ||
644 | } | 628 | } |
645 | /* | 629 | |
646 | * We now tell TCM to queue this WRITE CDB with TRANSPORT_PROCESS_WRITE | 630 | return target_execute_cmd(&cmd->se_cmd); |
647 | * status to the backstore processing thread. | 631 | } |
648 | */ | 632 | |
649 | return transport_generic_handle_data(&cmd->se_cmd); | 633 | /* |
634 | * Called from qla_target.c:qlt_do_ctio_completion() | ||
635 | */ | ||
636 | static void tcm_qla2xxx_handle_data(struct qla_tgt_cmd *cmd) | ||
637 | { | ||
638 | INIT_WORK(&cmd->work, tcm_qla2xxx_handle_data_work); | ||
639 | queue_work(tcm_qla2xxx_free_wq, &cmd->work); | ||
650 | } | 640 | } |
651 | 641 | ||
652 | /* | 642 | /* |