diff options
author | Quinn Tran <quinn.tran@qlogic.com> | 2016-02-10 18:59:13 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2016-02-11 02:08:55 -0500 |
commit | 9095adaab8c1d82707e4e9961b6ad79b62f3361b (patch) | |
tree | 29d651b22487ed1b2bb19a3186e71aae3aa23710 | |
parent | 2e498f25b0daa9dec761e3e880024ff7417f2445 (diff) |
target/transport: add flag to indicate CPU Affinity is observed
Signed-off-by: Quinn Tran <quinn.tran@qlogic.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Fixes: fb3269b ("qla2xxx: Add selective command queuing")
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r-- | drivers/target/target_core_transport.c | 12 | ||||
-rw-r--r-- | include/target/target_core_base.h | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index d92cb644d8f9..867bc6d0a68a 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -711,10 +711,10 @@ void target_complete_cmd(struct se_cmd *cmd, u8 scsi_status) | |||
711 | cmd->transport_state |= (CMD_T_COMPLETE | CMD_T_ACTIVE); | 711 | cmd->transport_state |= (CMD_T_COMPLETE | CMD_T_ACTIVE); |
712 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); | 712 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); |
713 | 713 | ||
714 | if (cmd->cpuid == -1) | 714 | if (cmd->se_cmd_flags & SCF_USE_CPUID) |
715 | queue_work(target_completion_wq, &cmd->work); | ||
716 | else | ||
717 | queue_work_on(cmd->cpuid, target_completion_wq, &cmd->work); | 715 | queue_work_on(cmd->cpuid, target_completion_wq, &cmd->work); |
716 | else | ||
717 | queue_work(target_completion_wq, &cmd->work); | ||
718 | } | 718 | } |
719 | EXPORT_SYMBOL(target_complete_cmd); | 719 | EXPORT_SYMBOL(target_complete_cmd); |
720 | 720 | ||
@@ -1426,6 +1426,12 @@ int target_submit_cmd_map_sgls(struct se_cmd *se_cmd, struct se_session *se_sess | |||
1426 | */ | 1426 | */ |
1427 | transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, | 1427 | transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, |
1428 | data_length, data_dir, task_attr, sense); | 1428 | data_length, data_dir, task_attr, sense); |
1429 | |||
1430 | if (flags & TARGET_SCF_USE_CPUID) | ||
1431 | se_cmd->se_cmd_flags |= SCF_USE_CPUID; | ||
1432 | else | ||
1433 | se_cmd->cpuid = WORK_CPU_UNBOUND; | ||
1434 | |||
1429 | if (flags & TARGET_SCF_UNKNOWN_SIZE) | 1435 | if (flags & TARGET_SCF_UNKNOWN_SIZE) |
1430 | se_cmd->unknown_data_length = 1; | 1436 | se_cmd->unknown_data_length = 1; |
1431 | /* | 1437 | /* |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index d71a3ead9e63..e8c8c08bf575 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -141,6 +141,7 @@ enum se_cmd_flags_table { | |||
141 | SCF_COMPARE_AND_WRITE_POST = 0x00100000, | 141 | SCF_COMPARE_AND_WRITE_POST = 0x00100000, |
142 | SCF_PASSTHROUGH_PROT_SG_TO_MEM_NOALLOC = 0x00200000, | 142 | SCF_PASSTHROUGH_PROT_SG_TO_MEM_NOALLOC = 0x00200000, |
143 | SCF_ACK_KREF = 0x00400000, | 143 | SCF_ACK_KREF = 0x00400000, |
144 | SCF_USE_CPUID = 0x00800000, | ||
144 | }; | 145 | }; |
145 | 146 | ||
146 | /* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ | 147 | /* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ |
@@ -188,6 +189,7 @@ enum target_sc_flags_table { | |||
188 | TARGET_SCF_BIDI_OP = 0x01, | 189 | TARGET_SCF_BIDI_OP = 0x01, |
189 | TARGET_SCF_ACK_KREF = 0x02, | 190 | TARGET_SCF_ACK_KREF = 0x02, |
190 | TARGET_SCF_UNKNOWN_SIZE = 0x04, | 191 | TARGET_SCF_UNKNOWN_SIZE = 0x04, |
192 | TARGET_SCF_USE_CPUID = 0x08, | ||
191 | }; | 193 | }; |
192 | 194 | ||
193 | /* fabric independent task management function values */ | 195 | /* fabric independent task management function values */ |