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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8628FE4E7912BF47A96AE7DD7BAC0AADCB46A2ADC5@SJEXCHCCR02.corp.ad.broadcom.com>
Date:	Thu, 25 Feb 2010 07:49:48 -0800
From:	"Vladislav Zolotarov" <vladz@...adcom.com>
To:	"Stanislaw Gruszka" <sgruszka@...hat.com>,
	"David Miller" <davem@...emloft.net>
cc:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"Eilon Greenstein" <eilong@...adcom.com>,
	"dhowells@...hat.com" <dhowells@...hat.com>
Subject: RE: [RFC PATCH] bnx2x: fix tx queue locking and memory barriers

In bnx2x_start_xmit(): right after the "stop queue" there is an smp_mb(), which will bring the cpu0 cache and a fresh fp->tx_bd_cons value to cpu1 and the following if() will return true and the queue will be released from bnx2x_start_xmit() flow.

No deadlock here.

vlad

> -----Original Message-----
> From: Stanislaw Gruszka [mailto:sgruszka@...hat.com] 
> Sent: Thursday, February 25, 2010 5:40 PM
> To: David Miller
> Cc: netdev@...r.kernel.org; Vladislav Zolotarov; Eilon 
> Greenstein; dhowells@...hat.com
> Subject: Re: [RFC PATCH] bnx2x: fix tx queue locking and 
> memory barriers
> 
> On Thu, 25 Feb 2010 02:18:22 -0800 (PST)
> David Miller <davem@...emloft.net> wrote:
> 
> > > Memory barriers here IMHO, prevent to make queue 
> permanently stopped
> > > when on one cpu bnx2x_tx_int() make queue empty, whereas on other
> > > cpu bnx2x_start_xmit() see it full and make stop it, such cause
> > > queue will be stopped forever.
> > 
> > Instead of having an opinion, please show the exact sequence
> > of events that can lead to this situation.  With such facts
> > inhand, you will have no need for an opinion :-)
> 
> Ok, here is the story:
> 
> Queue (4000 elements) is almost full: fp->tx_bd_prod = 3980, 
> fp->tx_bd_cons = 0,
> Packets ware already transmitted by device, but that was not 
> reported to
> the driver because interrupts where disabled. We are 
> transmitting new skb
> with 20 fragments.
> 
> cpu0: (in bnx2x_poll)                   cpu1: (transferring data)
> 
> bnx2x_tx_int():                         bnx2x_start_xmit():
> local fp->tx_bd_cons = 3980;            send more data to device
> return
> 
> bnx2x_tx_int():                         local fp->tx_bd_prod = 4000
> local fp->tx_bd_cons = 4000;            local fp->tx_bd_cons still 0
> queue not stopped                       no avail space in queue
> return;                                 stop queue
>                                         smp_mb() - not 
> paired, cpu1 does not "see" cpu0 caches changes
>                                         local fp->tx_bd_cons still 0
>                                         no wake
> 					
> Finally queue is sopped and device will not generate interrupt nor
> call bnx2x_tx_int() from bnx2x_poll() since bnx2x_has_tx_work() will
> return false.
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ