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]
Date:   Thu, 09 Mar 2017 15:06:20 -0800
From:   Eric Dumazet <eric.dumazet@...il.com>
To:     Tom Lendacky <thomas.lendacky@....com>
Cc:     Jeremy Linton <jeremy.linton@....com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Eric Dumazet <edumazet@...gle.com>
Subject: Re: xgbe unbalanced enable for IRQ XX in 4.11-rc1

On Thu, 2017-03-09 at 16:35 -0600, Tom Lendacky wrote:
> On 3/9/2017 4:17 PM, Jeremy Linton wrote:
> > Hi,
> >
> > On 03/09/2017 03:39 PM, Tom Lendacky wrote:
> >> On 3/9/2017 3:26 PM, Jeremy Linton wrote:
> >>> Hi,
> >>
> >> Hi Jeremy,
> >>
> >> I'll have a look at it.  Can you send me your kernel config just in
> >> case?
> >
> > Sure, i will send it to you off list to avoid spamming everyone with a
> > 43k gziped file.
> >
> 
> I'm able to recreate the problem with my current config.  If I revert
> patch 39e6c8208d7b ("net: solve a NAPI race"), then the problem goes
> away.
> 
> Eric, any thoughts on this?  I'm guessing the driver should check that
> napi_complete_done returns true before enabling IRQs...
> 
> Thanks,
> Tom

Yes, it seems this driver has a conditional disable_irq_nosync()
following the napi_schedule_prep()

So it probably needs the same for the enable_irq() side.

This would be broken with busy polling anyway, before my patch.

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
index 248f60d171a5a0ce76744a95e2d59039939e6538..c47a3a93f034ab608286d1ae343e9b7778063df8 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
@@ -2272,9 +2272,8 @@ 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)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ