Skip to content

Commit cf15c3e

Browse files
mchp-memcgowenmartinkpetersen
authored andcommitted
scsi: smartpqi: Add module param to disable managed ints
Allow SMP affinity to be changeable by disabling managed interrupts. On distributions where the driver is enabled for multi-queue support the driver utilizes kernel managed interrupts, which automatically distributes interrupts to all available CPUs and assigns SMP affinity. On most distributions, the affinity can not be changed by the user. This change will allow managed interrupts to be disabled by the user via a module parameter while still allowing multi-queue support to function properly. Use the module parameter disable_managed_interrupts=1 Link: https://lore.kernel.org/r/165730606638.177165.12846020942931640329.stgit@brunhilda Reviewed-by: Scott Benesh <scott.benesh@microchip.com> Reviewed-by: Scott Teel <scott.teel@microchip.com> Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com> Signed-off-by: Mike McGowen <Mike.McGowen@microchip.com> Signed-off-by: Don Brace <don.brace@microchip.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 6ce3cfb commit cf15c3e

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

drivers/scsi/smartpqi/smartpqi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,7 @@ struct pqi_ctrl_info {
13511351
u8 enable_r6_writes : 1;
13521352
u8 lv_drive_type_mix_valid : 1;
13531353
u8 enable_stream_detection : 1;
1354-
1354+
u8 disable_managed_interrupts : 1;
13551355
u8 ciss_report_log_flags;
13561356
u32 max_transfer_encrypted_sas_sata;
13571357
u32 max_transfer_encrypted_nvme;

drivers/scsi/smartpqi/smartpqi_init.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ module_param_named(hide_vsep,
175175
pqi_hide_vsep, int, 0644);
176176
MODULE_PARM_DESC(hide_vsep, "Hide the virtual SEP for direct attached drives.");
177177

178+
static int pqi_disable_managed_interrupts;
179+
module_param_named(disable_managed_interrupts,
180+
pqi_disable_managed_interrupts, int, 0644);
181+
MODULE_PARM_DESC(disable_managed_interrupts,
182+
"Disable the kernel automatically assigning SMP affinity to IRQs.");
183+
178184
static char *raid_levels[] = {
179185
"RAID-0",
180186
"RAID-4",
@@ -4039,10 +4045,14 @@ static void pqi_free_irqs(struct pqi_ctrl_info *ctrl_info)
40394045
static int pqi_enable_msix_interrupts(struct pqi_ctrl_info *ctrl_info)
40404046
{
40414047
int num_vectors_enabled;
4048+
unsigned int flags = PCI_IRQ_MSIX;
4049+
4050+
if (!pqi_disable_managed_interrupts)
4051+
flags |= PCI_IRQ_AFFINITY;
40424052

40434053
num_vectors_enabled = pci_alloc_irq_vectors(ctrl_info->pci_dev,
40444054
PQI_MIN_MSIX_VECTORS, ctrl_info->num_queue_groups,
4045-
PCI_IRQ_MSIX | PCI_IRQ_AFFINITY);
4055+
flags);
40464056
if (num_vectors_enabled < 0) {
40474057
dev_err(&ctrl_info->pci_dev->dev,
40484058
"MSI-X init failed with error %d\n",
@@ -8588,6 +8598,7 @@ static struct pqi_ctrl_info *pqi_alloc_ctrl_info(int numa_node)
85888598
ctrl_info->max_write_raid_5_6 = PQI_DEFAULT_MAX_WRITE_RAID_5_6;
85898599
ctrl_info->max_write_raid_1_10_2drive = ~0;
85908600
ctrl_info->max_write_raid_1_10_3drive = ~0;
8601+
ctrl_info->disable_managed_interrupts = pqi_disable_managed_interrupts;
85918602

85928603
return ctrl_info;
85938604
}

0 commit comments

Comments
 (0)