All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: bostroesser@gmail.com, mst@redhat.com, stefanha@redhat.com,
	Chaitanya.Kulkarni@wdc.com, hch@lst.de, loberman@redhat.com,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	target-devel@vger.kernel.org
Cc: Mike Christie <michael.christie@oracle.com>,
	Nilesh Javali <njavali@marvell.com>,
	Himanshu Madhani <himanshu.madhani@oracle.com>
Subject: [PATCH 07/25] qla2xxx: Convert to new submission API
Date: Wed, 17 Feb 2021 14:27:53 -0600	[thread overview]
Message-ID: <20210217202811.5575-8-michael.christie@oracle.com> (raw)
In-Reply-To: <20210217202811.5575-1-michael.christie@oracle.com>

target_submit_cmd is now only for simple drivers that do their
own sync during shutdown and do not use target_stop_session.

tcm_qla2xxx uses target_stop_session to sync session shutdown with lio
core, so we use target_init_cmd/target_submit_prep/target_submit, because
target_init_cmd will detect the target_stop_session call and return
an error.

Cc: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Tested-by: Laurence Oberman <loberman@redhat.com>
---
 drivers/scsi/qla2xxx/tcm_qla2xxx.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
index b55fc768a2a7..56394d901791 100644
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
@@ -451,7 +451,7 @@ static int tcm_qla2xxx_handle_cmd(scsi_qla_host_t *vha, struct qla_tgt_cmd *cmd,
 	struct se_portal_group *se_tpg;
 	struct tcm_qla2xxx_tpg *tpg;
 #endif
-	int target_flags = TARGET_SCF_ACK_KREF;
+	int rc, target_flags = TARGET_SCF_ACK_KREF;
 	unsigned long flags;
 
 	if (bidi)
@@ -486,9 +486,17 @@ static int tcm_qla2xxx_handle_cmd(scsi_qla_host_t *vha, struct qla_tgt_cmd *cmd,
 	list_add_tail(&cmd->sess_cmd_list, &sess->sess_cmd_list);
 	spin_unlock_irqrestore(&sess->sess_cmd_lock, flags);
 
-	return target_submit_cmd(se_cmd, se_sess, cdb, &cmd->sense_buffer[0],
-				 cmd->unpacked_lun, data_length, fcp_task_attr,
-				 data_dir, target_flags);
+	rc = target_init_cmd(se_cmd, se_sess, &cmd->sense_buffer[0],
+			     cmd->unpacked_lun, data_length, fcp_task_attr,
+			     data_dir, target_flags);
+	if (rc)
+		return rc;
+
+	if (target_submit_prep(se_cmd, cdb, NULL, 0, NULL, 0, NULL, 0))
+		return 0;
+
+	target_submit(se_cmd);
+	return 0;
 }
 
 static void tcm_qla2xxx_handle_data_work(struct work_struct *work)
-- 
2.25.1


  parent reply	other threads:[~2021-02-17 20:30 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17 20:27 [PATCH 00/25 V5] target: fix cmd plugging and submission Mike Christie
2021-02-17 20:27 ` [PATCH 01/25] target: move t_task_cdb initialization Mike Christie
2021-02-17 20:27 ` [PATCH 02/25] target: drop kref_get_unless_zero in target_get_sess_cmd Mike Christie
2021-02-17 20:27 ` [PATCH 03/25] target: rename transport_init_se_cmd Mike Christie
2021-02-17 20:27 ` [PATCH 04/25] target: break up target_submit_cmd_map_sgls Mike Christie
2021-02-17 20:27 ` [PATCH 05/25] srpt: Convert to new submission API Mike Christie
2021-02-19  0:22   ` Bart Van Assche
2021-02-17 20:27 ` [PATCH 06/25] ibmvscsi_tgt: " Mike Christie
2021-02-17 20:27 ` Mike Christie [this message]
2021-02-17 20:27 ` [PATCH 08/25] tcm_loop: " Mike Christie
2021-02-17 20:27 ` [PATCH 09/25] sbp_target: " Mike Christie
2021-02-17 20:27 ` [PATCH 10/25] usb gadget: " Mike Christie
2021-02-17 20:27 ` [PATCH 11/25] vhost-scsi: " Mike Christie
2021-02-17 20:27 ` [PATCH 12/25] xen-scsiback: " Mike Christie
2021-02-17 20:27 ` [PATCH 13/25] tcm_fc: " Mike Christie
2021-02-17 20:28 ` [PATCH 14/25] target: remove target_submit_cmd_map_sgls Mike Christie
2021-02-19 19:01   ` Bodo Stroesser
2021-02-17 20:28 ` [PATCH 15/25] target: add gfp_t arg to target_cmd_init_cdb Mike Christie
2021-02-19 18:53   ` Bodo Stroesser
2021-02-19 19:32   ` Bodo Stroesser
2021-02-19 19:41     ` michael.christie
2021-02-17 20:28 ` [PATCH 16/25] target: add workqueue based cmd submission Mike Christie
2021-02-19 19:10   ` Bodo Stroesser
2021-02-17 20:28 ` [PATCH 17/25] vhost scsi: use lio wq cmd submission helper Mike Christie
2021-02-17 20:28 ` [PATCH 18/25] tcm loop: use blk cmd allocator for se_cmds Mike Christie
2021-02-17 20:28 ` [PATCH 19/25] tcm loop: use lio wq cmd submission helper Mike Christie
2021-02-19 19:38   ` Bodo Stroesser
2021-02-17 20:28 ` [PATCH 20/25] target: cleanup cmd flag bits Mike Christie
2021-02-17 20:28 ` [PATCH 21/25] target: fix backend plugging Mike Christie
2021-02-19 19:40   ` Bodo Stroesser
2021-02-17 20:28 ` [PATCH 22/25] target iblock: add backend plug/unplug callouts Mike Christie
2021-02-17 20:28 ` [PATCH 23/25] target_core_user: " Mike Christie
2021-02-19 19:45   ` Bodo Stroesser
2021-02-17 20:28 ` [PATCH 24/25] target: flush submission work during TMR processing Mike Christie
2021-02-19 19:46   ` Bodo Stroesser
2021-02-17 20:28 ` [PATCH 25/25] target: make completion affinity configurable Mike Christie
  -- strict thread matches above, loose matches on Subject: below --
2021-02-27 16:59 [PATCH 00/25 V5] target: fix cmd plugging and submission Mike Christie
2021-02-27 16:59 ` [PATCH 07/25] qla2xxx: Convert to new submission API Mike Christie
2021-02-12  7:26 PATCH 00/25 V4] target: fix cmd plugging and submission Mike Christie
2021-02-12  7:26 ` [PATCH 07/25] qla2xxx: Convert to new submission API Mike Christie
2021-02-12 19:16   ` Himanshu Madhani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210217202811.5575-8-michael.christie@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=bostroesser@gmail.com \
    --cc=hch@lst.de \
    --cc=himanshu.madhani@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=loberman@redhat.com \
    --cc=martin.petersen@oracle.com \
    --cc=mst@redhat.com \
    --cc=njavali@marvell.com \
    --cc=stefanha@redhat.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.