Skip to content

Commit 0f9744f

Browse files
Nitesh Narayan LalKAGA-KOKO
authored andcommitted
iavf: Use irq_update_affinity_hint()
The driver uses irq_set_affinity_hint() 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 for the iavf interrupts The latter is done to ensure that all the interrupts are evenly spread across all available CPUs. However, since commit a0c9259 ("irq/matrix: Spread interrupts on allocation") the spreading of interrupts is dynamically performed at the time of allocation. Hence, there is no need for the drivers to enforce their own affinity for the spreading of interrupts. Also, irq_set_affinity_hint() applying the provided cpumask as an affinity 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_update_affinity_hint() that only sets the pointer for the affinity_hint. Signed-off-by: Nitesh Narayan Lal <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Jesse Brandeburg <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 65c7cde commit 0f9744f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,10 @@ iavf_request_traffic_irqs(struct iavf_adapter *adapter, char *basename)
492492
irq_set_affinity_notifier(irq_num, &q_vector->affinity_notify);
493493
/* Spread the IRQ affinity hints across online CPUs. Note that
494494
* get_cpu_mask returns a mask with a permanent lifetime so
495-
* it's safe to use as a hint for irq_set_affinity_hint.
495+
* it's safe to use as a hint for irq_update_affinity_hint.
496496
*/
497497
cpu = cpumask_local_spread(q_vector->v_idx, -1);
498-
irq_set_affinity_hint(irq_num, get_cpu_mask(cpu));
498+
irq_update_affinity_hint(irq_num, get_cpu_mask(cpu));
499499
}
500500

501501
return 0;
@@ -505,7 +505,7 @@ iavf_request_traffic_irqs(struct iavf_adapter *adapter, char *basename)
505505
vector--;
506506
irq_num = adapter->msix_entries[vector + NONQ_VECS].vector;
507507
irq_set_affinity_notifier(irq_num, NULL);
508-
irq_set_affinity_hint(irq_num, NULL);
508+
irq_update_affinity_hint(irq_num, NULL);
509509
free_irq(irq_num, &adapter->q_vectors[vector]);
510510
}
511511
return err;
@@ -557,7 +557,7 @@ static void iavf_free_traffic_irqs(struct iavf_adapter *adapter)
557557
for (vector = 0; vector < q_vectors; vector++) {
558558
irq_num = adapter->msix_entries[vector + NONQ_VECS].vector;
559559
irq_set_affinity_notifier(irq_num, NULL);
560-
irq_set_affinity_hint(irq_num, NULL);
560+
irq_update_affinity_hint(irq_num, NULL);
561561
free_irq(irq_num, &adapter->q_vectors[vector]);
562562
}
563563
}

0 commit comments

Comments
 (0)