Skip to content

Commit dee5576

Browse files
michichkuba-moo
authored andcommitted
ice: use irq_update_affinity_hint()
irq_set_affinity_hint() is deprecated. Use irq_update_affinity_hint() instead. This removes the side-effect of actually applying the affinity. The driver does not really need to worry about spreading its IRQs across CPUs. The core code already takes care of that. On the contrary, when the driver applies affinities by itself, it breaks the users' expectations: 1. The user configures irqbalance with IRQBALANCE_BANNED_CPULIST in order to prevent IRQs from being moved to certain CPUs that run a real-time workload. 2. ice reconfigures VSIs at runtime due to a MIB change (ice_dcb_process_lldp_set_mib_change). Reopening a VSI resets the affinity in ice_vsi_req_irq_msix(). 3. ice has no idea about irqbalance's config, so it may move an IRQ to a banned CPU. The real-time workload suffers unacceptable latency. I am not sure if updating the affinity hints is at all useful, because irqbalance ignores them since 2016 ([1]), but at least it's harmless. This ice change is similar to i40e commit d34c54d ("i40e: Use irq_update_affinity_hint()"). [1] Irqbalance/irqbalance@dcc411e7bfdd Signed-off-by: Michal Schmidt <[email protected]> Reviewed-by: Sunil Goutham <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Tested-by: Pucha Himasekhar Reddy <[email protected]> Signed-off-by: Jacob Keller <[email protected]> Link: https://lore.kernel.org/r/20240607-next-2024-06-03-intel-next-batch-v3-3-d1470cee3347@intel.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 1d4ce38 commit dee5576

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/net/ethernet/intel/ice/ice_lib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2580,8 +2580,8 @@ void ice_vsi_free_irq(struct ice_vsi *vsi)
25802580
if (!IS_ENABLED(CONFIG_RFS_ACCEL))
25812581
irq_set_affinity_notifier(irq_num, NULL);
25822582

2583-
/* clear the affinity_mask in the IRQ descriptor */
2584-
irq_set_affinity_hint(irq_num, NULL);
2583+
/* clear the affinity_hint in the IRQ descriptor */
2584+
irq_update_affinity_hint(irq_num, NULL);
25852585
synchronize_irq(irq_num);
25862586
devm_free_irq(ice_pf_to_dev(pf), irq_num, vsi->q_vectors[i]);
25872587
}

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2607,7 +2607,7 @@ static int ice_vsi_req_irq_msix(struct ice_vsi *vsi, char *basename)
26072607
}
26082608

26092609
/* assign the mask for this irq */
2610-
irq_set_affinity_hint(irq_num, &q_vector->affinity_mask);
2610+
irq_update_affinity_hint(irq_num, &q_vector->affinity_mask);
26112611
}
26122612

26132613
err = ice_set_cpu_rx_rmap(vsi);
@@ -2625,7 +2625,7 @@ static int ice_vsi_req_irq_msix(struct ice_vsi *vsi, char *basename)
26252625
irq_num = vsi->q_vectors[vector]->irq.virq;
26262626
if (!IS_ENABLED(CONFIG_RFS_ACCEL))
26272627
irq_set_affinity_notifier(irq_num, NULL);
2628-
irq_set_affinity_hint(irq_num, NULL);
2628+
irq_update_affinity_hint(irq_num, NULL);
26292629
devm_free_irq(dev, irq_num, &vsi->q_vectors[vector]);
26302630
}
26312631
return err;

0 commit comments

Comments
 (0)