Skip to contentSkip to conversation

: Add ALUA Active/NonOptimized state check

PATCH New Nicholas A. Bellinger 1 participant 1 message Aug 18, 2009 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 3/4 : Add ALUA Active/NonOptimized state check

Greetings,

This patch adds a call to target_core_mod symbol core_alua_check_nonop_delay() in iscsi_handle_scsi_cmd(), which can optionally call msleep_interruptible() for ALUA target port group members currently in the Active/NonOptimized primary access state to allow schedule() to be run for real time iSCSI traffic shaping using SPC-4 ALUA primitives.

The millisecond sleep interval is changed on a per ALUA target port group basis
in target_core_mod configfs at /sys/kernel/config/target/core/$HBA/$DEV/alua/$TG_PT_GP_NAME/nonop_delay_msecs which will update the timeout for all members of the ALUA target port group using
generic target_core_mod infrastructure.

---
 drivers/lio-core/iscsi_target.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/lio-core/iscsi_target.c +6 -1
index 3b1e3b7..5d00473 100644
@@ -57,6 +57,7 @@
 #include <iscsi_debug_opcodes.h>
 #include <iscsi_target_core.h>
 #include <target/target_core_base.h>
+#include <target/target_core_alua.h>
 #include <iscsi_target_error.h>
 #include <iscsi_target_datain_values.h>
 #include <iscsi_target_discovery.h>
@@ -1571,7 +1572,11 @@ build_list:
 
 attach_cmd:
 	iscsi_attach_cmd_to_queue(conn, cmd);
-
+	/*
+	 * Check if we need to delay processing because of ALUA
+	 * Active/NonOptimized primary access state..
+	 */
+	core_alua_check_nonop_delay(SE_CMD(cmd));
 	/*
 	 * Check the CmdSN against ExpCmdSN/MaxCmdSN here if
 	 * the Immediate Bit is not set, and no Immediate
Signature · 1 line
1.5.4.1