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. Signed-off-by: Nicholas A. Bellinger <nab@xxxxxxxxxxxxxxx> --- drivers/lio-core/iscsi_target.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/lio-core/iscsi_target.c b/drivers/lio-core/iscsi_target.c index 3b1e3b7..5d00473 100644 --- a/drivers/lio-core/iscsi_target.c +++ b/drivers/lio-core/iscsi_target.c @@ -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 -- 1.5.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html