On 10/29/20 1:49 AM, Mike Christie wrote:
Do a state_list/execute_task_lock per cpu, so we can do submissions
from different CPUs without contention with each other.
Note: tcm_fc was passing TARGET_SCF_USE_CPUID, but never set cpuid.
I think it wanted to set the cpuid to the CPU it was submitting
from so it will get this behavior with this patch.
Signed-off-by: Mike Christie <michael.christie@xxxxxxxxxx>
---
drivers/scsi/qla2xxx/tcm_qla2xxx.c | 3 -
drivers/target/target_core_device.c | 16 +++-
drivers/target/target_core_tmr.c | 166 +++++++++++++++++----------------
drivers/target/target_core_transport.c | 22 ++---
drivers/target/tcm_fc/tfc_cmd.c | 2 +-
include/target/target_core_base.h | 14 ++-
6 files changed, 121 insertions(+), 102 deletions(-)
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
index 784b43f..d225036 100644
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
@@ -457,9 +457,6 @@ static int tcm_qla2xxx_handle_cmd(scsi_qla_host_t *vha, struct qla_tgt_cmd *cmd,
if (bidi)
target_flags |= TARGET_SCF_BIDI_OP;
- if (se_cmd->cpuid != WORK_CPU_UNBOUND)
- target_flags |= TARGET_SCF_USE_CPUID;
-
sess = cmd->sess;
if (!sess) {
pr_err("Unable to locate struct fc_port from qla_tgt_cmd\n");
...
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index b228c66..71a6ec3 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1398,6 +1396,7 @@ void transport_init_se_cmd(
cmd->sam_task_attr = task_attr;
cmd->sense_buffer = sense_buffer;
cmd->orig_fe_lun = unpacked_lun;
+ cmd->cpuid = smp_processor_id();
cmd->state_active = false;
}
There is a bug where I am overwriting tcm_qla2xxx's cpuid above. I have
this fixed in a new version of the patch where I added a "if (cpuid flag
set)" check.
Since I just sent these last night, I'll wait for other comments to
resend so I don't flood the list.