From: Mike Christie <michael.christie@oracle.com>
To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
target-devel@vger.kernel.org
Cc: Mike Christie <michael.christie@oracle.com>
Subject: [PATCH v2 3/8] target: Move core_alua_check_nonop_delay call
Date: Wed, 27 Sep 2023 21:09:02 -0500 [thread overview]
Message-ID: <20230928020907.5730-3-michael.christie@oracle.com> (raw)
In-Reply-To: <20230928020907.5730-1-michael.christie@oracle.com>
This moves core_alua_check_nonop_delay to transport_handle_cdb_direct so
the iSCSI target driver doesn't have to call as many core functions
directly. This patchset will eventually merge transport_handle_cdb_direct
and target_submit so iSCSI and the other drivers call a common function.
It will also be helpful with the next patches which allow the iSCSI
target to defer command submission to the lio submission workqueue,
because we will have a common submission function for that which will
be based on transport_handle_cdb_direct/target_submit.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
---
drivers/target/iscsi/iscsi_target.c | 6 ------
drivers/target/target_core_alua.c | 1 -
drivers/target/target_core_transport.c | 12 ++++++------
include/target/target_core_fabric.h | 2 --
4 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index b516c2893420..1d25e64b068a 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -1234,12 +1234,6 @@ int iscsit_setup_scsi_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd,
spin_lock_bh(&conn->cmd_lock);
list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list);
spin_unlock_bh(&conn->cmd_lock);
- /*
- * Check if we need to delay processing because of ALUA
- * Active/NonOptimized primary access state..
- */
- core_alua_check_nonop_delay(&cmd->se_cmd);
-
return 0;
}
EXPORT_SYMBOL(iscsit_setup_scsi_cmd);
diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
index 3372856319f7..01751faad386 100644
--- a/drivers/target/target_core_alua.c
+++ b/drivers/target/target_core_alua.c
@@ -850,7 +850,6 @@ int core_alua_check_nonop_delay(
msleep_interruptible(cmd->alua_nonop_delay);
return 0;
}
-EXPORT_SYMBOL(core_alua_check_nonop_delay);
static int core_alua_write_tpg_metadata(
const char *path,
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 0686882bcbda..709314415a01 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1587,6 +1587,12 @@ int transport_handle_cdb_direct(
might_sleep();
+ /*
+ * Check if we need to delay processing because of ALUA
+ * Active/NonOptimized primary access state..
+ */
+ core_alua_check_nonop_delay(cmd);
+
if (!cmd->se_lun) {
dump_stack();
pr_err("cmd->se_lun is NULL\n");
@@ -1818,12 +1824,6 @@ void target_submit(struct se_cmd *se_cmd)
}
- /*
- * Check if we need to delay processing because of ALUA
- * Active/NonOptimized primary access state..
- */
- core_alua_check_nonop_delay(se_cmd);
-
transport_handle_cdb_direct(se_cmd);
}
EXPORT_SYMBOL_GPL(target_submit);
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index dcd7d76d2f30..e5fcfb845529 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -206,8 +206,6 @@ void target_stop_session(struct se_session *se_sess);
void target_wait_for_sess_cmds(struct se_session *);
void target_show_cmd(const char *pfx, struct se_cmd *cmd);
-int core_alua_check_nonop_delay(struct se_cmd *);
-
int core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t);
void core_tmr_release_req(struct se_tmr_req *);
int transport_generic_handle_tmr(struct se_cmd *);
--
2.34.1
next prev parent reply other threads:[~2023-09-28 2:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-28 2:09 [PATCH v2 1/8] scsi: target: Make write_pending_must_be_called a bit field Mike Christie
2023-09-28 2:09 ` [PATCH v2 2/8] scsi: target: Have drivers report if they support direct submissions Mike Christie
2023-09-28 2:09 ` Mike Christie [this message]
2023-09-28 2:09 ` [PATCH v2 4/8] target: Move buffer clearing hack Mike Christie
2023-09-28 2:09 ` [PATCH v2 5/8] target: Kill transport_handle_cdb_direct Mike Christie
2023-09-28 2:09 ` [PATCH v2 6/8] scsi: target: Allow userspace to request direct submissions Mike Christie
2023-09-28 2:09 ` [PATCH v2 7/8] scsi: target: Unexport target_queue_submission Mike Christie
2023-09-28 2:09 ` [PATCH v2 8/8] scsi: target: Export fabric driver direct submit settings Mike Christie
2023-09-28 2:31 ` [PATCH v2 0/8] scsi: target: Allow userspace to config cmd submission Mike Christie
2023-10-13 19:57 ` Martin K. Petersen
2023-10-17 1:11 ` Martin K. Petersen
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=20230928020907.5730-3-michael.christie@oracle.com \
--to=michael.christie@oracle.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).