Skip to contentSkip to conversation

igb/igc: use napi_schedule_irqoff() instead of napi_schedule()

PATCH In review Daiki Harada 5 participants 8 messages Mar 31 – May 14

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover igb/igc: use napi_schedule_irqoff() instead of napi_schedule()

This patch set is meant to replace the calls to napi_schedule with napi_schedule_irqoff as this should help to reduce the interrupt overhead slightly by removing the unneeded call to local_irq_save and local_irq_restore.

In the interrupt path, callers of napi_schedule() are invoked with local IRQ disabled, so napi_schedule_irqoff() can be used instead.

This series applies the same optimization that was done for other drivers in [1] to the igb/igc driver.

Daiki Harada (2):
igb: use napi_schedule_irqoff() instead of napi_schedule()
igc: use napi_schedule_irqoff() instead of napi_schedule()

 drivers/net/ethernet/intel/igb/igb_main.c | 6 +++---
 drivers/net/ethernet/intel/igc/igc_main.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.53.0
#1 lore raw

PATCH 1/2 igb: use napi_schedule_irqoff() instead of napi_schedule()

Replace napi_schedule() with napi_schedule_irqoff() in the interrupt handler path in igb driver

Tested on QEMU with igb NIC emulation (-nic user,model=igb)

---
 drivers/net/ethernet/intel/igb/igb_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/igb/igb_main.c +3 -3
index ee99fd8fd513..d7a6ae938cc5 100644
@@ -7158,7 +7158,7 @@ static irqreturn_t igb_msix_ring(int irq, void *data)
 	/* Write the ITR value calculated from the previous interrupt. */
 	igb_write_itr(q_vector);
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
 	return IRQ_HANDLED;
 }
@@ -8199,7 +8199,7 @@ static irqreturn_t igb_intr_msi(int irq, void *data)
 	if (icr & E1000_ICR_TS)
 		igb_tsync_interrupt(adapter);
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
 	return IRQ_HANDLED;
 }
@@ -8245,7 +8245,7 @@ static irqreturn_t igb_intr(int irq, void *data)
 	if (icr & E1000_ICR_TS)
 		igb_tsync_interrupt(adapter);
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
 	return IRQ_HANDLED;
 }
Signature · 1 line
2.53.0
Reviewed-by on v1 1/2
#2 lore raw

RE: [Intel-wired-lan] [PATCH iwl-next v1 1/2] igb: use napi_schedule_irqoff() instead of napi_schedule()

Quoted 64 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Daiki Harada
Sent: Tuesday, March 31, 2026 12:39 PM
To: [email protected]; [email protected]; linux- [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Daiki Harada <[email protected]>; Kohei Enju <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next v1 1/2] igb: use napi_schedule_irqoff() instead of napi_schedule()

Replace napi_schedule() with napi_schedule_irqoff() in the interrupt handler path in igb driver

Tested on QEMU with igb NIC emulation (-nic user,model=igb)

---
 drivers/net/ethernet/intel/igb/igb_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/igb/igb_main.c +1 -1
index ee99fd8fd513..d7a6ae938cc5 100644
@@ -7158,7 +7158,7 @@ static irqreturn_t igb_msix_ring(int irq, void
 *data)
 	/* Write the ITR value calculated from the previous interrupt.
 */
 	igb_write_itr(q_vector);
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
drivers/net/ethernet/intel/igb/igb_main.c +1 -1
 	return IRQ_HANDLED;
 }
@@ -8199,7 +8199,7 @@ static irqreturn_t igb_intr_msi(int irq, void
 *data)
 	if (icr & E1000_ICR_TS)
 		igb_tsync_interrupt(adapter);
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
 	return IRQ_HANDLED;

}

drivers/net/ethernet/intel/igb/igb_main.c +1 -2
@@ -8245,7 +8245,7 @@ static irqreturn_t igb_intr(int irq, void *data)
 	if (icr & E1000_ICR_TS)
 		igb_tsync_interrupt(adapter);
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
 	return IRQ_HANDLED;
 }
--
Quoted 1 line

2.53.0

Tested-by on v1 1/2
#3 lore raw

RE: [Intel-wired-lan] [PATCH iwl-next v1 1/2] igb: use napi_schedule_irqoff() instead of napi_schedule()

In reply to Daiki Harada
Quoted 9 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Daiki Harada
Sent: 31 March 2026 16:09
To: [email protected]; [email protected]; [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Daiki Harada <[email protected]>; Kohei Enju <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next v1 1/2] igb: use napi_schedule_irqoff() instead of napi_schedule()

Replace napi_schedule() with napi_schedule_irqoff() in the interrupt handler path in igb driver

Quoted 8 lines

Tested on QEMU with igb NIC emulation (-nic user,model=igb)

---
drivers/net/ethernet/intel/igb/igb_main.c | 6 +++---

1 file changed, 3 insertions(+), 3 deletions(-)
#4 lore raw

PATCH 2/2 igc: use napi_schedule_irqoff() instead of napi_schedule()

In reply to Daiki Harada

Replace napi_schedule() with napi_schedule_irqoff() in the interrupt handler path in igc driver Tested on Intel Corporation Ethernet Controller I226-V.

---
 drivers/net/ethernet/intel/igc/igc_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/igc/igc_main.c +3 -3
index 72bc5128d8b8..712605886104 100644
@@ -5688,7 +5688,7 @@ static irqreturn_t igc_msix_ring(int irq, void *data)
 	/* Write the ITR value calculated from the previous interrupt. */
 	igc_write_itr(q_vector);
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
 	return IRQ_HANDLED;
 }
@@ -6059,7 +6059,7 @@ static irqreturn_t igc_intr_msi(int irq, void *data)
 	if (icr & IGC_ICR_TS)
 		igc_tsync_interrupt(adapter);
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
 	return IRQ_HANDLED;
 }
@@ -6105,7 +6105,7 @@ static irqreturn_t igc_intr(int irq, void *data)
 	if (icr & IGC_ICR_TS)
 		igc_tsync_interrupt(adapter);
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
 	return IRQ_HANDLED;
 }
Signature · 1 line
2.53.0
Reviewed-by on v1 2/2
#5 lore raw

RE: [Intel-wired-lan] [PATCH iwl-next v1 2/2] igc: use napi_schedule_irqoff() instead of napi_schedule()

Quoted 63 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Daiki Harada
Sent: Tuesday, March 31, 2026 12:39 PM
To: [email protected]; [email protected]; linux- [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Daiki Harada <[email protected]>; Kohei Enju <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next v1 2/2] igc: use napi_schedule_irqoff() instead of napi_schedule()

Replace napi_schedule() with napi_schedule_irqoff() in the interrupt handler path in igc driver Tested on Intel Corporation Ethernet Controller I226-V.

---
 drivers/net/ethernet/intel/igc/igc_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/igc/igc_main.c +1 -1
index 72bc5128d8b8..712605886104 100644
@@ -5688,7 +5688,7 @@ static irqreturn_t igc_msix_ring(int irq, void
 *data)
 	/* Write the ITR value calculated from the previous interrupt.
 */
 	igc_write_itr(q_vector);
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
drivers/net/ethernet/intel/igc/igc_main.c +1 -1
 	return IRQ_HANDLED;
 }
@@ -6059,7 +6059,7 @@ static irqreturn_t igc_intr_msi(int irq, void
 *data)
 	if (icr & IGC_ICR_TS)
 		igc_tsync_interrupt(adapter);
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
 	return IRQ_HANDLED;

}

drivers/net/ethernet/intel/igc/igc_main.c +1 -2
@@ -6105,7 +6105,7 @@ static irqreturn_t igc_intr(int irq, void *data)
 	if (icr & IGC_ICR_TS)
 		igc_tsync_interrupt(adapter);
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
 	return IRQ_HANDLED;
 }
--
Quoted 1 line

2.53.0

Reviewed-by
#6 lore raw

Re: [Intel-wired-lan] [PATCH iwl-next v1 2/2] igc: use napi_schedule_irqoff() instead of napi_schedule()

Quoted 60 lines · Aleksandr
Quoted 60 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Daiki Harada
Sent: Tuesday, March 31, 2026 12:39 PM
To: [email protected]; [email protected]; linux- [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Daiki Harada <[email protected]>; Kohei Enju <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next v1 2/2] igc: use napi_schedule_irqoff() instead of napi_schedule()

Replace napi_schedule() with napi_schedule_irqoff() in the interrupt handler path in igc driver Tested on Intel Corporation Ethernet Controller I226-V.

---
  drivers/net/ethernet/intel/igc/igc_main.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/igc/igc_main.c +1 -1
index 72bc5128d8b8..712605886104 100644
@@ -5688,7 +5688,7 @@ static irqreturn_t igc_msix_ring(int irq, void
 *data)
  	/* Write the ITR value calculated from the previous interrupt.
 */
  	igc_write_itr(q_vector);
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
  	return IRQ_HANDLED;
  }
drivers/net/ethernet/intel/igc/igc_main.c +1 -1
@@ -6059,7 +6059,7 @@ static irqreturn_t igc_intr_msi(int irq, void
 *data)
  	if (icr & IGC_ICR_TS)
  		igc_tsync_interrupt(adapter);
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
  	return IRQ_HANDLED;
  }
drivers/net/ethernet/intel/igc/igc_main.c +1 -1
@@ -6105,7 +6105,7 @@ static irqreturn_t igc_intr(int irq, void *data)
  	if (icr & IGC_ICR_TS)
  		igc_tsync_interrupt(adapter);
 
-	napi_schedule(&q_vector->napi);
+	napi_schedule_irqoff(&q_vector->napi);
 
Quoted 7 lines
Quoted 4 lines
drivers/net/ethernet/intel/igc/igc_main.c +0 -1
  	return IRQ_HANDLED;
  }
--

2.53.0

Tested-by
#7 lore raw

Re: [Intel-wired-lan] [PATCH iwl-next v1 2/2] igc: use napi_schedule_irqoff() instead of napi_schedule()

Quoted 61 lines · Dima
Quoted 60 lines · Aleksandr
Quoted 60 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Daiki Harada
Sent: Tuesday, March 31, 2026 12:39 PM
To: [email protected]; [email protected]; linux- [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Daiki Harada <[email protected]>; Kohei Enju <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next v1 2/2] igc: use napi_schedule_irqoff() instead of napi_schedule()

Replace napi_schedule() with napi_schedule_irqoff() in the interrupt handler path in igc driver Tested on Intel Corporation Ethernet Controller I226-V.

---
  drivers/net/ethernet/intel/igc/igc_main.c | 6 +++---

  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/igc/igc_main.c +1 -1
index 72bc5128d8b8..712605886104 100644
@@ -5688,7 +5688,7 @@ static irqreturn_t igc_msix_ring(int irq, void
 *data)
       /* Write the ITR value calculated from the previous interrupt.
 */
       igc_write_itr(q_vector);
 
-    napi_schedule(&q_vector->napi);
+    napi_schedule_irqoff(&q_vector->napi);
 

      return IRQ_HANDLED;
  }

drivers/net/ethernet/intel/igc/igc_main.c +1 -1
@@ -6059,7 +6059,7 @@ static irqreturn_t igc_intr_msi(int irq, void
 *data)
       if (icr & IGC_ICR_TS)
           igc_tsync_interrupt(adapter);
 
-    napi_schedule(&q_vector->napi);
+    napi_schedule_irqoff(&q_vector->napi);
 
       return IRQ_HANDLED;

  }

drivers/net/ethernet/intel/igc/igc_main.c +1 -1
@@ -6105,7 +6105,7 @@ static irqreturn_t igc_intr(int irq, void *data)
       if (icr & IGC_ICR_TS)
           igc_tsync_interrupt(adapter);
 
-    napi_schedule(&q_vector->napi);
+    napi_schedule_irqoff(&q_vector->napi);
 
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
drivers/net/ethernet/intel/igc/igc_main.c +0 -0
       return IRQ_HANDLED;
   }
Signature · 1 line
2.53.0