lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 14 Sep 2020 13:54:15 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Hauke Mehrtens <hauke@...ke-m.de>
Cc:     davem@...emloft.net, netdev@...r.kernel.org,
        martin.blumenstingl@...glemail.com, eric.dumazet@...il.com
Subject: Re: [PATCH v2 4/4] net: lantiq: Disable IRQs only if NAPI gets
 scheduled

On Sat, 12 Sep 2020 21:36:29 +0200 Hauke Mehrtens wrote:
> The napi_schedule() call will only schedule the NAPI if it is not
> already running. To make sure that we do not deactivate interrupts
> without scheduling NAPI only deactivate the interrupts in case NAPI also
> gets scheduled.
> 
> Signed-off-by: Hauke Mehrtens <hauke@...ke-m.de>
> ---
>  drivers/net/ethernet/lantiq_xrx200.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c
> index abee7d61074c..635ff3a5dcfb 100644
> --- a/drivers/net/ethernet/lantiq_xrx200.c
> +++ b/drivers/net/ethernet/lantiq_xrx200.c
> @@ -345,10 +345,12 @@ static irqreturn_t xrx200_dma_irq(int irq, void *ptr)
>  {
>  	struct xrx200_chan *ch = ptr;
>  
> -	ltq_dma_disable_irq(&ch->dma);
> -	ltq_dma_ack_irq(&ch->dma);
> +	if (napi_schedule_prep(&ch->napi)) {
> +		__napi_schedule(&ch->napi);
> +		ltq_dma_disable_irq(&ch->dma);
> +	}
>  
> -	napi_schedule(&ch->napi);
> +	ltq_dma_ack_irq(&ch->dma);
>  
>  	return IRQ_HANDLED;
>  }

The patches look good to me, but I wonder why you don't want to always
disable the IRQ here? You're guaranteed that NAPI will get called, or it
was disabled. In both cases seems like disabling the IRQ can only help.

Powered by blists - more mailing lists