[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100225171654.3cdeb854@dhcp-lab-109.englab.brq.redhat.com>
Date: Thu, 25 Feb 2010 17:16:54 +0100
From: Stanislaw Gruszka <sgruszka@...hat.com>
To: David Miller <davem@...emloft.net>
Cc: vladz@...adcom.com, netdev@...r.kernel.org, eilong@...adcom.com,
dhowells@...hat.com
Subject: Re: [RFC PATCH] bnx2x: fix tx queue locking and memory barriers
On Thu, 25 Feb 2010 08:06:24 -0800 (PST)
David Miller <davem@...emloft.net> wrote:
> > If I understand correctly what is written in Documentation/memory-barriers.txt
> > this smp_mb() need to have another "paired" smp_{w}mb() on cpu0 to make value
> > be updated on cpu1, which is missing.
>
> The invocation of ->hard_start_xmit() creates an implicit memory
> barrier because all such invocations take the netdev spinlock.
But barrier is missing on cpu which call bnx2x_pull(), how spinlock
before bnx2x_start_xmit() helps with that? Below again the whole
picture:
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
--
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