summaryrefslogtreecommitdiff
path: root/drivers/target/iscsi
diff options
context:
space:
mode:
authorMike Christie <michael.christie@oracle.com>2023-03-19 04:56:13 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2023-03-25 00:32:23 +0300
commit4edba7e4a8f39112398d3cda94128a8e13a7d527 (patch)
treef9ba054f1511293f229e05bf999a801f699fe621 /drivers/target/iscsi
parentbecd9be6069e7b183c084f460f0eb363e43cc487 (diff)
downloadlinux-4edba7e4a8f39112398d3cda94128a8e13a7d527.tar.xz
scsi: target: Move cmd counter allocation
iSCSI needs to allocate its cmd counter per connection for MCS support where we need to stop and wait on commands running on a connection instead of per session. This moves the cmd counter allocation to target_setup_session() which is used by drivers that need the stop+wait behavior per session. xcopy doesn't need stop+wait at all, so we will be OK moving the cmd counter allocation outside of transport_init_session(). Signed-off-by: Mike Christie <michael.christie@oracle.com> Link: https://lore.kernel.org/r/20230319015620.96006-3-michael.christie@oracle.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target/iscsi')
-rw-r--r--drivers/target/iscsi/iscsi_target_login.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c
index 27e448c2d066..8ab6c0107d89 100644
--- a/drivers/target/iscsi/iscsi_target_login.c
+++ b/drivers/target/iscsi/iscsi_target_login.c
@@ -324,8 +324,18 @@ static int iscsi_login_zero_tsih_s1(
goto free_ops;
}
+ /*
+ * This is temp for iser. It will be moved to per conn in later
+ * patches for iscsi.
+ */
+ sess->se_sess->cmd_cnt = target_alloc_cmd_counter();
+ if (!sess->se_sess->cmd_cnt)
+ goto free_se_sess;
+
return 0;
+free_se_sess:
+ transport_free_session(sess->se_sess);
free_ops:
kfree(sess->sess_ops);
free_id: