* [Intel-wired-lan] [PATCH iwl-next] e1000e: Use __napi_schedule_irqoff()
@ 2026-04-08 22:16 Matt Vollrath
2026-04-09 8:43 ` Loktionov, Aleksandr
0 siblings, 1 reply; 2+ messages in thread
From: Matt Vollrath @ 2026-04-08 22:16 UTC (permalink / raw)
To: intel-wired-lan; +Cc: Matt Vollrath
The __napi_schedule_irqoff() macro is intended to bypass saving and
restoring IRQ state when scheduling is requested from an IRQ handler,
where hard interrupts are already disabled. Use this macro in all three
interrupt handlers.
This was tested on a system with an I218-V and MSI interrupts. Because
this is an optimization, I was interested in measuring the impact, so I
added ktime_get() time measurement to e1000_intr_msi and a print of the
last sample in the watchdog task. For each test case I ran a
bi-directional iperf3 to saturate the line. With some help from awk,
here are the statistics.
49 samples each, all units ns
previous: min 678 max 1265 mean 879.429 median 806 stddev 137.188
noirq: min 707 max 1165 mean 811.857 median 790 stddev 89.486
According to this informal comparison, the mean time to handle an
interrupt from start to finish is improved by about 8% under load.
Signed-off-by: Matt Vollrath <tactii@gmail.com>
---
drivers/net/ethernet/intel/e1000e/netdev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 9befdacd6730..3ba108bc3036 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -1803,7 +1803,7 @@ static irqreturn_t e1000_intr_msi(int __always_unused irq, void *data)
adapter->total_tx_packets = 0;
adapter->total_rx_bytes = 0;
adapter->total_rx_packets = 0;
- __napi_schedule(&adapter->napi);
+ __napi_schedule_irqoff(&adapter->napi);
}
return IRQ_HANDLED;
@@ -1882,7 +1882,7 @@ static irqreturn_t e1000_intr(int __always_unused irq, void *data)
adapter->total_tx_packets = 0;
adapter->total_rx_bytes = 0;
adapter->total_rx_packets = 0;
- __napi_schedule(&adapter->napi);
+ __napi_schedule_irqoff(&adapter->napi);
}
return IRQ_HANDLED;
@@ -1951,7 +1951,7 @@ static irqreturn_t e1000_intr_msix_rx(int __always_unused irq, void *data)
if (napi_schedule_prep(&adapter->napi)) {
adapter->total_rx_bytes = 0;
adapter->total_rx_packets = 0;
- __napi_schedule(&adapter->napi);
+ __napi_schedule_irqoff(&adapter->napi);
}
return IRQ_HANDLED;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Intel-wired-lan] [PATCH iwl-next] e1000e: Use __napi_schedule_irqoff()
2026-04-08 22:16 [Intel-wired-lan] [PATCH iwl-next] e1000e: Use __napi_schedule_irqoff() Matt Vollrath
@ 2026-04-09 8:43 ` Loktionov, Aleksandr
0 siblings, 0 replies; 2+ messages in thread
From: Loktionov, Aleksandr @ 2026-04-09 8:43 UTC (permalink / raw)
To: Matt Vollrath, intel-wired-lan@lists.osuosl.org
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Matt Vollrath
> Sent: Thursday, April 9, 2026 12:17 AM
> To: intel-wired-lan@lists.osuosl.org
> Cc: Matt Vollrath <tactii@gmail.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next] e1000e: Use
> __napi_schedule_irqoff()
>
> The __napi_schedule_irqoff() macro is intended to bypass saving and
> restoring IRQ state when scheduling is requested from an IRQ handler,
> where hard interrupts are already disabled. Use this macro in all
> three interrupt handlers.
>
> This was tested on a system with an I218-V and MSI interrupts. Because
> this is an optimization, I was interested in measuring the impact, so
> I added ktime_get() time measurement to e1000_intr_msi and a print of
> the last sample in the watchdog task. For each test case I ran a bi-
> directional iperf3 to saturate the line. With some help from awk, here
> are the statistics.
>
> 49 samples each, all units ns
> previous: min 678 max 1265 mean 879.429 median 806 stddev 137.188
> noirq: min 707 max 1165 mean 811.857 median 790 stddev 89.486
>
> According to this informal comparison, the mean time to handle an
> interrupt from start to finish is improved by about 8% under load.
>
> Signed-off-by: Matt Vollrath <tactii@gmail.com>
> ---
> drivers/net/ethernet/intel/e1000e/netdev.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c
> b/drivers/net/ethernet/intel/e1000e/netdev.c
> index 9befdacd6730..3ba108bc3036 100644
> --- a/drivers/net/ethernet/intel/e1000e/netdev.c
> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
> @@ -1803,7 +1803,7 @@ static irqreturn_t e1000_intr_msi(int
> __always_unused irq, void *data)
> adapter->total_tx_packets = 0;
> adapter->total_rx_bytes = 0;
> adapter->total_rx_packets = 0;
> - __napi_schedule(&adapter->napi);
> + __napi_schedule_irqoff(&adapter->napi);
> }
>
> return IRQ_HANDLED;
> @@ -1882,7 +1882,7 @@ static irqreturn_t e1000_intr(int
> __always_unused irq, void *data)
> adapter->total_tx_packets = 0;
> adapter->total_rx_bytes = 0;
> adapter->total_rx_packets = 0;
> - __napi_schedule(&adapter->napi);
> + __napi_schedule_irqoff(&adapter->napi);
> }
>
> return IRQ_HANDLED;
> @@ -1951,7 +1951,7 @@ static irqreturn_t e1000_intr_msix_rx(int
> __always_unused irq, void *data)
> if (napi_schedule_prep(&adapter->napi)) {
> adapter->total_rx_bytes = 0;
> adapter->total_rx_packets = 0;
> - __napi_schedule(&adapter->napi);
> + __napi_schedule_irqoff(&adapter->napi);
> }
> return IRQ_HANDLED;
> }
> --
> 2.43.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-09 8:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-08 22:16 [Intel-wired-lan] [PATCH iwl-next] e1000e: Use __napi_schedule_irqoff() Matt Vollrath
2026-04-09 8:43 ` Loktionov, Aleksandr
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox