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  linux-hardening  linux-cve-announce  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]
Message-ID: <3e8765da-19ee-c320-0ddb-7fe3b585607f@arm.com>
Date:   Fri, 10 Mar 2017 10:33:22 -0600
From:   Jeremy Linton <jeremy.linton@....com>
To:     Tom Lendacky <thomas.lendacky@....com>, netdev@...r.kernel.org
Cc:     David Miller <davem@...emloft.net>
Subject: Re: [PATCH net] amd-xgbe: Enable IRQs only if napi_complete_done() is
 true

On 03/09/2017 05:48 PM, Tom Lendacky wrote:
> Depending on the hardware, the amd-xgbe driver may use disable_irq_nosync()
> and enable_irq() when an interrupt is received to process Rx packets. If
> the napi_complete_done() return value isn't checked an unbalanced enable
> for the IRQ could result, generating a warning stack trace.
>
> Update the driver to only enable interrupts if napi_complete_done() returns
> true.

I've been running this for a few hours now and haven't seen the warning. 
So it appears to be fixed. Thanks!

I guess Dave M picked it up already, but I will toss this in anyway.


Tested-by: Jeremy Linton <jeremy.linton@....com>

>
> Reported-by: Jeremy Linton <jeremy.linton@....com>
> Signed-off-by: Tom Lendacky <thomas.lendacky@....com>
> ---
>  drivers/net/ethernet/amd/xgbe/xgbe-drv.c |   10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
> index 248f60d..ffea985 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
> @@ -2272,10 +2272,7 @@ static int xgbe_one_poll(struct napi_struct *napi, int budget)
>  	processed = xgbe_rx_poll(channel, budget);
>
>  	/* If we processed everything, we are done */
> -	if (processed < budget) {
> -		/* Turn off polling */
> -		napi_complete_done(napi, processed);
> -
> +	if ((processed < budget) && napi_complete_done(napi, processed)) {
>  		/* Enable Tx and Rx interrupts */
>  		if (pdata->channel_irq_mode)
>  			xgbe_enable_rx_tx_int(pdata, channel);
> @@ -2317,10 +2314,7 @@ static int xgbe_all_poll(struct napi_struct *napi, int budget)
>  	} while ((processed < budget) && (processed != last_processed));
>
>  	/* If we processed everything, we are done */
> -	if (processed < budget) {
> -		/* Turn off polling */
> -		napi_complete_done(napi, processed);
> -
> +	if ((processed < budget) && napi_complete_done(napi, processed)) {
>  		/* Enable Tx and Rx interrupts */
>  		xgbe_enable_rx_tx_ints(pdata);
>  	}
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ