nfp: use irq_update_affinity_hint()
authorMohammad Heib <mheib@redhat.com>
Thu, 7 Nov 2024 11:50:02 +0000 (13:50 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 11 Nov 2024 23:32:18 +0000 (15:32 -0800)
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. when the driver applies the
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. nfp device reopening will resets the affinity
   in nfp_net_netdev_open().

3. nfp has no idea about irqbalance's config, so it may move an IRQ to
   a banned CPU. The real-time workload suffers unacceptable latency.

Signed-off-by: Mohammad Heib <mheib@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Louis Peens <louis.peens@corigine.com>
Link: https://patch.msgid.link/20241107115002.413358-1-mheib@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/netronome/nfp/nfp_net_common.c

index 6e0929af0f725b2b3855c69bbe894e6626c566b3..98e098c09c034860f24812356df3137e5bcc0968 100644 (file)
@@ -829,7 +829,7 @@ nfp_net_prepare_vector(struct nfp_net *nn, struct nfp_net_r_vector *r_vec,
                return err;
        }
 
-       irq_set_affinity_hint(r_vec->irq_vector, &r_vec->affinity_mask);
+       irq_update_affinity_hint(r_vec->irq_vector, &r_vec->affinity_mask);
 
        nn_dbg(nn, "RV%02d: irq=%03d/%03d\n", idx, r_vec->irq_vector,
               r_vec->irq_entry);
@@ -840,7 +840,7 @@ nfp_net_prepare_vector(struct nfp_net *nn, struct nfp_net_r_vector *r_vec,
 static void
 nfp_net_cleanup_vector(struct nfp_net *nn, struct nfp_net_r_vector *r_vec)
 {
-       irq_set_affinity_hint(r_vec->irq_vector, NULL);
+       irq_update_affinity_hint(r_vec->irq_vector, NULL);
        nfp_net_napi_del(&nn->dp, r_vec);
        free_irq(r_vec->irq_vector, r_vec);
 }