Skip to content

Commit d34c54d

Browse files
Nitesh Narayan LalKAGA-KOKO
authored andcommitted
i40e: 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 i40e 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 0f9744f commit d34c54d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3891,10 +3891,10 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename)
38913891
*
38923892
* get_cpu_mask returns a static constant mask with
38933893
* a permanent lifetime so it's ok to pass to
3894-
* irq_set_affinity_hint without making a copy.
3894+
* irq_update_affinity_hint without making a copy.
38953895
*/
38963896
cpu = cpumask_local_spread(q_vector->v_idx, -1);
3897-
irq_set_affinity_hint(irq_num, get_cpu_mask(cpu));
3897+
irq_update_affinity_hint(irq_num, get_cpu_mask(cpu));
38983898
}
38993899

39003900
vsi->irqs_ready = true;
@@ -3905,7 +3905,7 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename)
39053905
vector--;
39063906
irq_num = pf->msix_entries[base + vector].vector;
39073907
irq_set_affinity_notifier(irq_num, NULL);
3908-
irq_set_affinity_hint(irq_num, NULL);
3908+
irq_update_affinity_hint(irq_num, NULL);
39093909
free_irq(irq_num, &vsi->q_vectors[vector]);
39103910
}
39113911
return err;
@@ -4726,7 +4726,7 @@ static void i40e_vsi_free_irq(struct i40e_vsi *vsi)
47264726
/* clear the affinity notifier in the IRQ descriptor */
47274727
irq_set_affinity_notifier(irq_num, NULL);
47284728
/* remove our suggested affinity mask for this IRQ */
4729-
irq_set_affinity_hint(irq_num, NULL);
4729+
irq_update_affinity_hint(irq_num, NULL);
47304730
synchronize_irq(irq_num);
47314731
free_irq(irq_num, vsi->q_vectors[i]);
47324732

0 commit comments

Comments
 (0)