qla2x00t-32gbit: Backport to older kernel versions

Commit ccf2e9c8fab7 ("qla2x00t-32gbit: Select qpair depending on which
CPU post_cmd() gets called") introduced an optimization based on the
pci_irq_get_affinity() API.

Due to support for older kernel versions, limit the minimum kernel
version to use this optimization to v4.9.

See also commit ee8d41e53efe ("pci/msi: Retrieve affinity for a vector") # v4.9.
This commit is contained in:
Gleb Chesnokov
2023-03-13 14:58:28 +03:00
parent a1ff8c3ae9
commit f3b50fb570
3 changed files with 15 additions and 0 deletions
+6
View File
@@ -9429,6 +9429,12 @@ struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *vha, int qos,
qpair->req = ha->req_q_map[req_id];
qpair->rsp->req = qpair->req;
qpair->rsp->qpair = qpair;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(7, 5))
/* init qpair to this cpu. Will adjust at run time. */
qla_cpu_update(qpair, raw_smp_processor_id());
#endif
if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif) {
if (ha->fw_attributes & BIT_4)
+4
View File
@@ -541,6 +541,9 @@ qla_mapq_init_qp_cpu_map(struct qla_hw_data *ha,
struct qla_msix_entry *msix,
struct qla_qpair *qpair)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) || \
(defined(RHEL_RELEASE_CODE) && \
RHEL_RELEASE_CODE -0 >= RHEL_RELEASE_VERSION(7, 5))
const struct cpumask *mask;
unsigned int cpu;
@@ -552,6 +555,7 @@ qla_mapq_init_qp_cpu_map(struct qla_hw_data *ha,
ha->qp_cpu_map[cpu] = qpair;
}
msix->cpuid = qpair->cpuid;
#endif
}
static inline void
+5
View File
@@ -3793,6 +3793,11 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
if (rsp->qpair->cpuid != raw_smp_processor_id() ||
!rsp->qpair->rcv_intr) {
rsp->qpair->rcv_intr = 1;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(7, 5))
qla_cpu_update(rsp->qpair, raw_smp_processor_id());
#endif
}
#define __update_rsp_in(_is_shadow_hba, _rsp, _rsp_in) \