Skip to contentSkip to conversation

iavf: convert to NAPI IRQ affinity API

PATCH In review Ahmed Zaki 2 participants 2 messages May 16, 2025 – May 28, 2025

Subsystems (3)
lore
Share & tools
lore

Ahmed Zaki

author
#0 lore raw

PATCH 1/1 iavf: convert to NAPI IRQ affinity API

Commit bd7c00605ee0 ("net: move aRFS rmap management and CPU affinity to core") allows the drivers to delegate the IRQ affinity to the NAPI instance. However, the driver needs to use a persistent NAPI config and explicitly set/unset the NAPI<->IRQ association.

Convert to the new IRQ affinity API.

---
 drivers/net/ethernet/intel/iavf/iavf.h      |  2 -
 drivers/net/ethernet/intel/iavf/iavf_main.c | 58 ++++-----------------
 drivers/net/ethernet/intel/iavf/iavf_txrx.c |  3 +-
 3 files changed, 12 insertions(+), 51 deletions(-)
drivers/net/ethernet/intel/iavf/iavf.h +0 -2
index eb86cca38be2..a87e0c6d4017 100644
@@ -114,8 +114,6 @@ struct iavf_q_vector {
 	u16 reg_idx;		/* register index of the interrupt */
 	char name[IFNAMSIZ + 15];
 	bool arm_wb_state;
-	cpumask_t affinity_mask;
-	struct irq_affinity_notify affinity_notify;
 };
 
 /* Helper macros to switch between ints/sec and what the register uses.
drivers/net/ethernet/intel/iavf/iavf_main.c +10 -48

118 lines not on this page · raw message

drivers/net/ethernet/intel/iavf/iavf_txrx.c +2 -1
index 35d353d38129..aaf70c625655 100644
@@ -1650,7 +1650,8 @@ int iavf_napi_poll(struct napi_struct *napi, int budget)
 		 * continue to poll, otherwise we must stop polling so the
 		 * interrupt can move to the correct cpu.
 		 */
-		if (!cpumask_test_cpu(cpu_id, &q_vector->affinity_mask)) {
+		if (!cpumask_test_cpu(cpu_id,
+				      &q_vector->napi.config->affinity_mask)) {
 			/* Tell napi that we are done polling */
 			napi_complete_done(napi, work_done);
 
Signature · 1 line
2.43.0
Tested-by on v1 1/1
#1 lore raw

drivers/net/ethernet/intel/iavf/iavf.h struct iavf_q_vector {

Quoted 30 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Ahmed Zaki
Sent: Saturday, May 17, 2025 12:19 AM
To: [email protected]
Cc: [email protected]; Zaki, Ahmed <[email protected]>; Keller, Jacob E <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next] iavf: convert to NAPI IRQ affinity API

Commit bd7c00605ee0 ("net: move aRFS rmap management and CPU affinity to core") allows the drivers to delegate the IRQ affinity to the NAPI instance. However, the driver needs to use a persistent NAPI config and explicitly set/unset the NAPI<->IRQ association.

Convert to the new IRQ affinity API.

---
 drivers/net/ethernet/intel/iavf/iavf.h      |  2 -
 drivers/net/ethernet/intel/iavf/iavf_main.c | 58 ++++-----------------
drivers/net/ethernet/intel/iavf/iavf_txrx.c |  3 +-
 3 files changed, 12 insertions(+), 51 deletions(-)
drivers/net/ethernet/intel/iavf/iavf.h +0 -0
index eb86cca38be2..a87e0c6d4017 100644
@@ -114,8 +114,6 @@ struct iavf_q_vector {