From: "Kok, Auke" <auke-jan.h.kok@intel.com>
To: David Acker <dacker@roinet.com>, Jeff Garzik <jgarzik@pobox.com>
Cc: Auke Kok <auke-jan.h.kok@intel.com>,
e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
Jesse Brandeburg <jesse.brandeburg@intel.com>,
Milton Miller <miltonm@bga.com>,
Scott Feldman <sfeldma@pobox.com>,
John Ronciak <john.ronciak@intel.com>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: Re: [PATCH] Fix e100 on systems that have cache incoherent DMA
Date: Tue, 06 Nov 2007 09:01:15 -0800 [thread overview]
Message-ID: <47309DDB.6090403@intel.com> (raw)
In-Reply-To: <20071102132703.1652446C128@localhost>
David Acker wrote:
> On the systems that have cache incoherent DMA, including ARM, there is a
> race condition between software allocating a new receive buffer and hardware
> writing into a buffer. The two race on touching the last Receive Frame
> Descriptor (RFD). It has its el-bit set and its next link equal to 0.
> When hardware encounters this buffer it attempts to write data to it and
> then update Status Word bits and Actual Count in the RFD. At the same time
> software may try to clear the el-bit and set the link address to a new buffer.
>
> Since the entire RFD is once cache-line, the two write operations can collide.
> This can lead to the receive unit stalling or interpreting random memory as
> its receive area.
>
> The fix is to set the el-bit on and the size to 0 on the next to last buffer
> in the chain. When the hardware encounters this buffer it stops and does not
> write to it at all. The hardware issues an RNR interrupt with the receive
> unit in the No Resources state. Software can write to the tail of the list
> because it knows hardware will stop on the previous descriptor that was
> marked as the end of list.
>
> Once it has a new next to last buffer prepared, it can clear the el-bit and
> set the size on the previous one. The race on this buffer is safe since
> the link already points to a valid next buffer and the software can handle
> the race setting the size (assuming aligned 16 bit writes are atomic with
> respect to the DMA read). If the hardware sees the el-bit cleared without
> the size set, it will move on to the next buffer and skip this one. If it
> sees the size set but the el-bit still set, it will complete that buffer
> and then RNR interrupt and wait.
>
>
> This is a patch for 2.6.24-rc1.
>
> Signed-off-by: David Acker <dacker@roinet.com>
OK, there are still a few small tests running but I think it's good. It ran over
the weekend in various tests and we didn't see any receive unit hangs, which we
would have spotted by now. That means that the patch as far as I can assess is
good to go and I will send it to Jeff later on.
There is a minute impact to small packet receive performance. the driver uses
about 0.5% more CPU at 64byte packets wire speed but it's still in the 3% total
range, so I think we're fine there.
Thanks for all the work David!
Auke
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
next prev parent reply other threads:[~2007-11-06 17:01 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-02 13:27 [PATCH] Fix e100 on systems that have cache incoherent DMA David Acker
2007-11-02 16:05 ` Kok, Auke
2007-11-02 16:11 ` Jeff Garzik
2007-11-06 17:01 ` Kok, Auke [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-11-08 18:17 Auke Kok
2007-11-28 19:12 ` David Acker
2007-11-28 19:21 ` Kok, Auke
2007-11-28 19:26 ` Jeff Garzik
2007-11-28 19:50 ` David Acker
2008-06-18 18:54 ` Anders Grafström
2008-06-18 19:16 ` David Acker
2008-06-19 12:38 ` Anders Grafström
2008-07-01 8:26 ` Andrew Morton
2008-07-01 9:49 ` Jeff Garzik
2008-07-01 18:07 ` Andrew Morton
2008-07-02 17:36 ` Anders Grafström
2008-07-02 17:45 ` Andrew Morton
2008-07-01 21:35 ` David Acker
2007-08-31 20:54 David Acker
2007-09-04 17:02 ` Kok, Auke
2007-09-07 16:31 ` Kok, Auke
2007-09-07 20:41 ` David Acker
2007-09-07 21:03 ` Kok, Auke
2007-09-07 21:18 ` Kok, Auke
2007-09-07 23:24 ` Jeff Garzik
2007-09-11 20:54 ` David Acker
2007-09-12 11:30 ` James Chapman
2007-09-12 20:11 ` David Acker
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=47309DDB.6090403@intel.com \
--to=auke-jan.h.kok@intel.com \
--cc=dacker@roinet.com \
--cc=e1000-devel@lists.sourceforge.net \
--cc=jeffrey.t.kirsher@intel.com \
--cc=jesse.brandeburg@intel.com \
--cc=jgarzik@pobox.com \
--cc=john.ronciak@intel.com \
--cc=miltonm@bga.com \
--cc=netdev@vger.kernel.org \
--cc=sfeldma@pobox.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).