Skip to content

Commit fdb8ed1

Browse files
Nitesh Narayan LalKAGA-KOKO
authored andcommitted
scsi: mpt3sas: Use irq_set_affinity_and_hint()
The driver uses irq_set_affinity_hint() specifically for the high IOPS queue interrupts for two purposes: - To set the affinity_hint which is consumed by the userspace for distributing the interrupts - To apply an affinity that it provides The driver enforces its own affinity to bind the high IOPS queue interrupts to the local NUMA node. However, irq_set_affinity_hint() applying the provided cpumask as an affinity (if not NULL) for the interrupt is an undocumented side effect. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Hence, replace the irq_set_affinity_hint() with the new interface irq_set_affinity_and_hint() where the provided mask needs to be applied as the affinity and affinity_hint pointer needs to be set and replace with irq_update_affinity_hint() where only affinity_hint needs to be updated. Signed-off-by: Nitesh Narayan Lal <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Sreekanth Reddy <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8049da6 commit fdb8ed1

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

drivers/scsi/mpt3sas/mpt3sas_base.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3086,6 +3086,7 @@ _base_check_enable_msix(struct MPT3SAS_ADAPTER *ioc)
30863086
void
30873087
mpt3sas_base_free_irq(struct MPT3SAS_ADAPTER *ioc)
30883088
{
3089+
unsigned int irq;
30893090
struct adapter_reply_queue *reply_q, *next;
30903091

30913092
if (list_empty(&ioc->reply_queue_list))
@@ -3098,9 +3099,10 @@ mpt3sas_base_free_irq(struct MPT3SAS_ADAPTER *ioc)
30983099
continue;
30993100
}
31003101

3101-
if (ioc->smp_affinity_enable)
3102-
irq_set_affinity_hint(pci_irq_vector(ioc->pdev,
3103-
reply_q->msix_index), NULL);
3102+
if (ioc->smp_affinity_enable) {
3103+
irq = pci_irq_vector(ioc->pdev, reply_q->msix_index);
3104+
irq_update_affinity_hint(irq, NULL);
3105+
}
31043106
free_irq(pci_irq_vector(ioc->pdev, reply_q->msix_index),
31053107
reply_q);
31063108
kfree(reply_q);
@@ -3167,18 +3169,15 @@ _base_request_irq(struct MPT3SAS_ADAPTER *ioc, u8 index)
31673169
* @ioc: per adapter object
31683170
*
31693171
* The enduser would need to set the affinity via /proc/irq/#/smp_affinity
3170-
*
3171-
* It would nice if we could call irq_set_affinity, however it is not
3172-
* an exported symbol
31733172
*/
31743173
static void
31753174
_base_assign_reply_queues(struct MPT3SAS_ADAPTER *ioc)
31763175
{
3177-
unsigned int cpu, nr_cpus, nr_msix, index = 0;
3176+
unsigned int cpu, nr_cpus, nr_msix, index = 0, irq;
31783177
struct adapter_reply_queue *reply_q;
3179-
int local_numa_node;
31803178
int iopoll_q_count = ioc->reply_queue_count -
31813179
ioc->iopoll_q_start_index;
3180+
const struct cpumask *mask;
31823181

31833182
if (!_base_is_controller_msix_enabled(ioc))
31843183
return;
@@ -3201,11 +3200,11 @@ _base_assign_reply_queues(struct MPT3SAS_ADAPTER *ioc)
32013200
* corresponding to high iops queues.
32023201
*/
32033202
if (ioc->high_iops_queues) {
3204-
local_numa_node = dev_to_node(&ioc->pdev->dev);
3203+
mask = cpumask_of_node(dev_to_node(&ioc->pdev->dev));
32053204
for (index = 0; index < ioc->high_iops_queues;
32063205
index++) {
3207-
irq_set_affinity_hint(pci_irq_vector(ioc->pdev,
3208-
index), cpumask_of_node(local_numa_node));
3206+
irq = pci_irq_vector(ioc->pdev, index);
3207+
irq_set_affinity_and_hint(irq, mask);
32093208
}
32103209
}
32113210

0 commit comments

Comments
 (0)