Commit 9095adaa authored by Quinn Tran's avatar Quinn Tran Committed by Nicholas Bellinger

target/transport: add flag to indicate CPU Affinity is observed

Signed-off-by: default avatarQuinn Tran <quinn.tran@qlogic.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
Fixes: fb3269ba ("qla2xxx: Add selective command queuing")
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 2e498f25
...@@ -711,10 +711,10 @@ void target_complete_cmd(struct se_cmd *cmd, u8 scsi_status) ...@@ -711,10 +711,10 @@ void target_complete_cmd(struct se_cmd *cmd, u8 scsi_status)
cmd->transport_state |= (CMD_T_COMPLETE | CMD_T_ACTIVE); cmd->transport_state |= (CMD_T_COMPLETE | CMD_T_ACTIVE);
spin_unlock_irqrestore(&cmd->t_state_lock, flags); spin_unlock_irqrestore(&cmd->t_state_lock, flags);
if (cmd->cpuid == -1) if (cmd->se_cmd_flags & SCF_USE_CPUID)
queue_work(target_completion_wq, &cmd->work);
else
queue_work_on(cmd->cpuid, target_completion_wq, &cmd->work); queue_work_on(cmd->cpuid, target_completion_wq, &cmd->work);
else
queue_work(target_completion_wq, &cmd->work);
} }
EXPORT_SYMBOL(target_complete_cmd); EXPORT_SYMBOL(target_complete_cmd);
...@@ -1426,6 +1426,12 @@ int target_submit_cmd_map_sgls(struct se_cmd *se_cmd, struct se_session *se_sess ...@@ -1426,6 +1426,12 @@ int target_submit_cmd_map_sgls(struct se_cmd *se_cmd, struct se_session *se_sess
*/ */
transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess,
data_length, data_dir, task_attr, sense); data_length, data_dir, task_attr, sense);
if (flags & TARGET_SCF_USE_CPUID)
se_cmd->se_cmd_flags |= SCF_USE_CPUID;
else
se_cmd->cpuid = WORK_CPU_UNBOUND;
if (flags & TARGET_SCF_UNKNOWN_SIZE) if (flags & TARGET_SCF_UNKNOWN_SIZE)
se_cmd->unknown_data_length = 1; se_cmd->unknown_data_length = 1;
/* /*
......
...@@ -141,6 +141,7 @@ enum se_cmd_flags_table { ...@@ -141,6 +141,7 @@ enum se_cmd_flags_table {
SCF_COMPARE_AND_WRITE_POST = 0x00100000, SCF_COMPARE_AND_WRITE_POST = 0x00100000,
SCF_PASSTHROUGH_PROT_SG_TO_MEM_NOALLOC = 0x00200000, SCF_PASSTHROUGH_PROT_SG_TO_MEM_NOALLOC = 0x00200000,
SCF_ACK_KREF = 0x00400000, SCF_ACK_KREF = 0x00400000,
SCF_USE_CPUID = 0x00800000,
}; };
/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ /* struct se_dev_entry->lun_flags and struct se_lun->lun_access */
...@@ -188,6 +189,7 @@ enum target_sc_flags_table { ...@@ -188,6 +189,7 @@ enum target_sc_flags_table {
TARGET_SCF_BIDI_OP = 0x01, TARGET_SCF_BIDI_OP = 0x01,
TARGET_SCF_ACK_KREF = 0x02, TARGET_SCF_ACK_KREF = 0x02,
TARGET_SCF_UNKNOWN_SIZE = 0x04, TARGET_SCF_UNKNOWN_SIZE = 0x04,
TARGET_SCF_USE_CPUID = 0x08,
}; };
/* fabric independent task management function values */ /* fabric independent task management function values */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment