Commit 18fd3d8c authored by Suganath Prabu S's avatar Suganath Prabu S Committed by Martin K. Petersen

scsi: mpt3sas: Add flag high_iops_queues

Aero controllers support balanced performance mode through the ability to
configure queues with different properties.

Reply queues with interrupt coalescing enabled are called "high iops reply
queues" and reply queues with interrupt coalescing disabled are called "low
latency reply queues".

The driver configures a combination of high iops and low latency reply
queues if:

 - HBA is an AERO controller;

 - MSI-X vectors supported by the HBA is 128;

 - Total CPU count in the system more than high iops queue count;

 - Driver is loaded with default max_msix_vectors module parameter; and

 - System booted in non-kdump mode.
Signed-off-by: default avatarSuganath Prabu S <suganath-prabu.subramani@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 79c74d03
...@@ -2912,6 +2912,34 @@ _base_assign_reply_queues(struct MPT3SAS_ADAPTER *ioc) ...@@ -2912,6 +2912,34 @@ _base_assign_reply_queues(struct MPT3SAS_ADAPTER *ioc)
} }
} }
/**
* _base_check_and_enable_high_iops_queues - enable high iops mode
* @ ioc - per adapter object
* @ hba_msix_vector_count - msix vectors supported by HBA
*
* Enable high iops queues only if
* - HBA is a SEA/AERO controller and
* - MSI-Xs vector supported by the HBA is 128 and
* - total CPU count in the system >=16 and
* - loaded driver with default max_msix_vectors module parameter and
* - system booted in non kdump mode
*
* returns nothing.
*/
static void
_base_check_and_enable_high_iops_queues(struct MPT3SAS_ADAPTER *ioc,
int hba_msix_vector_count)
{
if (!reset_devices && ioc->is_aero_ioc &&
hba_msix_vector_count == MPT3SAS_GEN35_MAX_MSIX_QUEUES &&
num_online_cpus() >= MPT3SAS_HIGH_IOPS_REPLY_QUEUES &&
max_msix_vectors == -1)
ioc->high_iops_queues = MPT3SAS_HIGH_IOPS_REPLY_QUEUES;
else
ioc->high_iops_queues = 0;
}
/** /**
* _base_disable_msix - disables msix * _base_disable_msix - disables msix
* @ioc: per adapter object * @ioc: per adapter object
...@@ -2948,11 +2976,14 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc) ...@@ -2948,11 +2976,14 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
if (_base_check_enable_msix(ioc) != 0) if (_base_check_enable_msix(ioc) != 0)
goto try_ioapic; goto try_ioapic;
ioc->reply_queue_count = min_t(int, ioc->cpu_count, ioc_info(ioc, "MSI-X vectors supported: %d\n", ioc->msix_vector_count);
ioc->msix_vector_count); pr_info("\t no of cores: %d, max_msix_vectors: %d\n",
ioc->cpu_count, max_msix_vectors);
ioc_info(ioc, "MSI-X vectors supported: %d, no of cores: %d, max_msix_vectors: %d\n", _base_check_and_enable_high_iops_queues(ioc, ioc->msix_vector_count);
ioc->msix_vector_count, ioc->cpu_count, max_msix_vectors); ioc->reply_queue_count =
min_t(int, ioc->cpu_count + ioc->high_iops_queues,
ioc->msix_vector_count);
if (!ioc->rdpq_array_enable && max_msix_vectors == -1) if (!ioc->rdpq_array_enable && max_msix_vectors == -1)
local_max_msix_vectors = (reset_devices) ? 1 : 8; local_max_msix_vectors = (reset_devices) ? 1 : 8;
...@@ -2991,11 +3022,15 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc) ...@@ -2991,11 +3022,15 @@ _base_enable_msix(struct MPT3SAS_ADAPTER *ioc)
} }
} }
ioc_info(ioc, "High IOPs queues : %s\n",
ioc->high_iops_queues ? "enabled" : "disabled");
return 0; return 0;
/* failback to io_apic interrupt routing */ /* failback to io_apic interrupt routing */
try_ioapic: try_ioapic:
ioc->high_iops_queues = 0;
ioc_info(ioc, "High IOPs queues : disabled\n");
ioc->reply_queue_count = 1; ioc->reply_queue_count = 1;
r = pci_alloc_irq_vectors(ioc->pdev, 1, 1, PCI_IRQ_LEGACY); r = pci_alloc_irq_vectors(ioc->pdev, 1, 1, PCI_IRQ_LEGACY);
if (r < 0) { if (r < 0) {
......
...@@ -355,6 +355,10 @@ struct mpt3sas_nvme_cmd { ...@@ -355,6 +355,10 @@ struct mpt3sas_nvme_cmd {
#define VIRTUAL_IO_FAILED_RETRY (0x32010081) #define VIRTUAL_IO_FAILED_RETRY (0x32010081)
/* High IOPs definitions */
#define MPT3SAS_HIGH_IOPS_REPLY_QUEUES 8
#define MPT3SAS_GEN35_MAX_MSIX_QUEUES 128
/* OEM Specific Flags will come from OEM specific header files */ /* OEM Specific Flags will come from OEM specific header files */
struct Mpi2ManufacturingPage10_t { struct Mpi2ManufacturingPage10_t {
MPI2_CONFIG_PAGE_HEADER Header; /* 00h */ MPI2_CONFIG_PAGE_HEADER Header; /* 00h */
...@@ -1209,6 +1213,7 @@ struct MPT3SAS_ADAPTER { ...@@ -1209,6 +1213,7 @@ struct MPT3SAS_ADAPTER {
atomic64_t total_io_cnt; atomic64_t total_io_cnt;
bool msix_load_balance; bool msix_load_balance;
u16 thresh_hold; u16 thresh_hold;
u8 high_iops_queues;
/* internal commands, callback index */ /* internal commands, callback index */
u8 scsi_io_cb_idx; u8 scsi_io_cb_idx;
......
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