Commit eedc42a0 authored by Sreekanth Reddy's avatar Sreekanth Reddy Committed by Martin K. Petersen

scsi: mpt3sas: Fix msix load balance on and off settings

Enable msix load balance only when combined reply queue mode is disabled on
the SAS3 and above generation HBA devices.

Earlier msix load balance used to enable if the number of online cpus is
greater than the number of MSI-X vectors enabled on the HBA.  Combined reply
queue mode will be disabled only on those HBA which works in shared
resources mode. I.e. on SAS3 HBAs it will be <= 8 and on SAS35 HBA devices
it will be <= 16.

 - Before this patch if system has 256 logical CPUs and HBA exposes 128
   MSI-X vectors, driver will enable msix load balance.

 - After this patch if system has 256 logical CPUs and HBA exposes 128
   MSI-X vectors, driver will disable msix load balance.

 - After this patch if system has 256 logical CPUs and HBA exposes 16 MSI-X
   vectors (due to combined reply queue mode being off in HW), driver will
   enable msix load balance.
Signed-off-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 610ef1e9
...@@ -2884,11 +2884,9 @@ _base_assign_reply_queues(struct MPT3SAS_ADAPTER *ioc) ...@@ -2884,11 +2884,9 @@ _base_assign_reply_queues(struct MPT3SAS_ADAPTER *ioc)
if (!_base_is_controller_msix_enabled(ioc)) if (!_base_is_controller_msix_enabled(ioc))
return; return;
ioc->msix_load_balance = false;
if (ioc->reply_queue_count < num_online_cpus()) { if (ioc->msix_load_balance)
ioc->msix_load_balance = true;
return; return;
}
memset(ioc->cpu_msix_table, 0, ioc->cpu_msix_table_sz); memset(ioc->cpu_msix_table, 0, ioc->cpu_msix_table_sz);
...@@ -3060,6 +3058,8 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc) ...@@ -3060,6 +3058,8 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
int i, local_max_msix_vectors; int i, local_max_msix_vectors;
u8 try_msix = 0; u8 try_msix = 0;
ioc->msix_load_balance = false;
if (msix_disable == -1 || msix_disable == 0) if (msix_disable == -1 || msix_disable == 0)
try_msix = 1; try_msix = 1;
...@@ -3090,7 +3090,20 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc) ...@@ -3090,7 +3090,20 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
else if (local_max_msix_vectors == 0) else if (local_max_msix_vectors == 0)
goto try_ioapic; goto try_ioapic;
if (ioc->msix_vector_count < ioc->cpu_count) /*
* Enable msix_load_balance only if combined reply queue mode is
* disabled on SAS3 & above generation HBA devices.
*/
if (!ioc->combined_reply_queue &&
ioc->hba_mpi_version_belonged != MPI2_VERSION) {
ioc->msix_load_balance = true;
}
/*
* smp affinity setting is not need when msix load balance
* is enabled.
*/
if (ioc->msix_load_balance)
ioc->smp_affinity_enable = 0; ioc->smp_affinity_enable = 0;
r = _base_alloc_irq_vectors(ioc); r = _base_alloc_irq_vectors(ioc);
......
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