]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/scsi/qla2xxx/qla_target.c
scsi: qla2xxx: Add debug knob for user control workload
[mirror_ubuntu-bionic-kernel.git] / drivers / scsi / qla2xxx / qla_target.c
index 92e41055e6f86b7e30706a361e0b12b8a8ff0a2e..87f80dccaf8cd9b2a6f3f66e71ece4878ba4a149 100644 (file)
@@ -66,6 +66,13 @@ MODULE_PARM_DESC(ql_dm_tgt_ex_pct,
        "the percentage of exchanges/cmds FW will allocate resources "
        "for Target mode.");
 
+int ql2xuctrlirq = 1;
+module_param(ql2xuctrlirq, int, 0644);
+MODULE_PARM_DESC(ql2xuctrlirq,
+    "User to control IRQ placement via smp_affinity."
+    "Valid with qlini_mode=disabled."
+    "1(default): enable");
+
 int ql2x_ini_mode = QLA2XXX_INI_MODE_EXCLUSIVE;
 
 static int temp_sam_status = SAM_STAT_BUSY;
@@ -4059,6 +4066,31 @@ static void qlt_do_work(struct work_struct *work)
        __qlt_do_work(cmd);
 }
 
+void qlt_clr_qp_table(struct scsi_qla_host *vha)
+{
+       unsigned long flags;
+       struct qla_hw_data *ha = vha->hw;
+       struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
+       void *node;
+       u64 key = 0;
+
+       ql_log(ql_log_info, vha, 0x706c,
+           "User update Number of Active Qpairs %d\n",
+           ha->tgt.num_act_qpairs);
+
+       spin_lock_irqsave(&ha->tgt.atio_lock, flags);
+
+       btree_for_each_safe64(&tgt->lun_qpair_map, key, node)
+               btree_remove64(&tgt->lun_qpair_map, key);
+
+       ha->base_qpair->lun_cnt = 0;
+       for (key = 0; key < ha->max_qpairs; key++)
+               if (ha->queue_pair_map[key])
+                       ha->queue_pair_map[key]->lun_cnt = 0;
+
+       spin_unlock_irqrestore(&ha->tgt.atio_lock, flags);
+}
+
 static void qlt_assign_qpair(struct scsi_qla_host *vha,
        struct qla_tgt_cmd *cmd)
 {