From 722c51d207ea30388dfc63cec635e1d3e7d9d681 Mon Sep 17 00:00:00 2001 From: "M. Vefa Bicakci" Date: Fri, 14 Jan 2022 17:50:39 -0500 Subject: [PATCH] ice_main, ice_lib: Use irq_update_affinity_hint This commit makes the ice device driver use the irq_update_affinity_hint function instead of the irq_set_affinity_hint function. This is done because the latter function sets the IRQ CPU affinities, whereas the former does not, and this allows the use of the default IRQ affinity CPU mask provided via the irqaffinity= kernel command line option. Please note that this patch was not cherry-picked from an upstream commit. The changes have been inspired by the i40e and iavf device driver patches in the following patch series: https://lore.kernel.org/netdev/20210903152430.244937-1-nitesh@redhat.com/t/#u The aforementioned patches have been mainlined as of this writing with the following merge commit by Linus Torvalds: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=147cc5838c0f5c76e908b816e924ca378e0d4735 And the i40e and iavf patches are accessible at: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d34c54d1739c2cdf2e4437b74e6da269147f4987 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0f9744f4ed539f2e847d7ed41993b243e3ba5cff Signed-off-by: M. Vefa Bicakci [jm: Adapted the patch for context changes.] Signed-off-by: Jiping Ma --- src/ice_lib.c | 2 +- src/ice_main.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ice_lib.c b/src/ice_lib.c index 034a064..313273f 100644 --- a/src/ice_lib.c +++ b/src/ice_lib.c @@ -2900,7 +2900,7 @@ void ice_vsi_free_irq(struct ice_vsi *vsi) irq_set_affinity_notifier(irq_num, NULL); /* clear the affinity_mask in the IRQ descriptor */ - irq_set_affinity_hint(irq_num, NULL); + irq_update_affinity_hint(irq_num, NULL); synchronize_irq(irq_num); devm_free_irq(ice_pf_to_dev(pf), irq_num, vsi->q_vectors[i]); } diff --git a/src/ice_main.c b/src/ice_main.c index e00d7f8..ca761bd 100644 --- a/src/ice_main.c +++ b/src/ice_main.c @@ -3417,8 +3417,8 @@ static int ice_vsi_req_irq_msix(struct ice_vsi *vsi, char *basename) irq_set_affinity_notifier(irq_num, affinity_notify); } - /* assign the mask for this irq */ - irq_set_affinity_hint(irq_num, &q_vector->affinity_mask); + /* assign the affinity hint for this irq */ + irq_update_affinity_hint(irq_num, &q_vector->affinity_mask); } vsi->irqs_ready = true; @@ -3430,7 +3430,7 @@ free_q_irqs: irq_num = ice_get_irq_num(pf, base + vector); if (!IS_ENABLED(CONFIG_RFS_ACCEL)) irq_set_affinity_notifier(irq_num, NULL); - irq_set_affinity_hint(irq_num, NULL); + irq_update_affinity_hint(irq_num, NULL); devm_free_irq(dev, irq_num, &vsi->q_vectors[vector]); } return err; -- 2.31.1