From: Stanislaw Gruszka <sgruszka@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, vladz@broadcom.com, eilong@broadcom.com,
dhowells@redhat.com
Subject: Re: [RFC PATCH] bnx2x: fix tx queue locking and memory barriers
Date: Thu, 25 Feb 2010 16:40:15 +0100 [thread overview]
Message-ID: <20100225164015.3991ab5e@dhcp-lab-109.englab.brq.redhat.com> (raw)
In-Reply-To: <20100225.021822.66777947.davem@davemloft.net>
On Thu, 25 Feb 2010 02:18:22 -0800 (PST)
David Miller <davem@davemloft.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.
next prev parent reply other threads:[~2010-02-25 15:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-25 13:08 [RFC PATCH] bnx2x: fix tx queue locking and memory barriers Stanislaw Gruszka
2010-02-25 10:18 ` David Miller
2010-02-25 15:40 ` Stanislaw Gruszka [this message]
2010-02-25 15:49 ` Vladislav Zolotarov
2010-02-25 16:03 ` Stanislaw Gruszka
2010-02-25 16:06 ` David Miller
2010-02-25 16:16 ` Stanislaw Gruszka
2010-02-25 16:14 ` Vladislav Zolotarov
2010-02-25 13:28 ` Vladislav Zolotarov
2010-03-10 17:09 ` David Howells
2010-03-10 17:49 ` David Miller
2010-03-10 18:32 ` David Howells
2010-03-11 13:10 ` Stanislaw Gruszka
2010-03-10 17:19 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100225164015.3991ab5e@dhcp-lab-109.englab.brq.redhat.com \
--to=sgruszka@redhat.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=eilong@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=vladz@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).