From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: Anton Blanchard <anton@samba.org>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>,
Bruce Allan <bruce.w.allan@intel.com>,
PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com>,
John Ronciak <john.ronciak@intel.com>,
Don Skidmore <donald.c.skidmore@intel.com>,
Yi Zou <yi.zou@intel.com>,
Alexander Duyck <alexander.h.duyck@intel.com>,
e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org
Subject: Re: [PATCH 1/2] e1000: Fix DMA mapping error handling on TX
Date: Fri, 22 Jan 2010 19:40:48 -0800 [thread overview]
Message-ID: <9929d2391001221940r4482dde4k8e5409bc7933bc21@mail.gmail.com> (raw)
In-Reply-To: <20100121114244.GC32259@kryten>
On Thu, Jan 21, 2010 at 03:42, Anton Blanchard <anton@samba.org> wrote:
>
> There were a few issues in the DMA mapping error handling in e1000_tx_map
> which I found via fault injection.
>
> If we fail to map the first descriptor count will end up as -1 but the
> check of (count >= 0) will still be true since count is unsigned. Instead
> of changing count to be signed, just simplify the logic.
>
> Secondly, when we wrap the tx ring we rely on i to go negative, but it
> was unsigned.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>
> Index: linux.trees.git/drivers/net/e1000/e1000_main.c
> ===================================================================
> --- linux.trees.git.orig/drivers/net/e1000/e1000_main.c 2010-01-21 11:10:00.000000000 +1100
> +++ linux.trees.git/drivers/net/e1000/e1000_main.c 2010-01-21 11:12:52.000000000 +1100
> @@ -2693,8 +2693,9 @@ static int e1000_tx_map(struct e1000_ada
> struct pci_dev *pdev = adapter->pdev;
> struct e1000_buffer *buffer_info;
> unsigned int len = skb_headlen(skb);
> - unsigned int offset = 0, size, count = 0, i;
> + unsigned int offset = 0, size, count = 0;
> unsigned int f;
> + int i;
>
> i = tx_ring->next_to_use;
>
> @@ -2802,10 +2803,8 @@ static int e1000_tx_map(struct e1000_ada
> dma_error:
> dev_err(&pdev->dev, "TX DMA map failed\n");
> buffer_info->dma = 0;
> - count--;
>
> - while (count >= 0) {
> - count--;
> + while (count--) {
> i--;
> if (i < 0)
> i += tx_ring->count;
This patch does not apply to the current e1000 driver in net-2.6, much
of this patch has already been corrected (applied) by Roel Kluin
recent patch.
--
Cheers,
Jeff
next prev parent reply other threads:[~2010-01-23 3:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-21 11:42 [PATCH 1/2] e1000: Fix DMA mapping error handling on TX Anton Blanchard
2010-01-21 11:44 ` [PATCH 2/2] e1000: Fix DMA mapping error handling on RX Anton Blanchard
2010-01-23 3:42 ` Jeff Kirsher
2010-01-23 3:40 ` Jeff Kirsher [this message]
2010-01-24 0:47 ` [PATCH 1/2] e1000: Fix DMA mapping error handling on TX Anton Blanchard
2010-01-24 3:58 ` Jeff Kirsher
2010-01-26 15:59 ` Roel Kluin
2010-02-04 13:00 ` Roel Kluin
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=9929d2391001221940r4482dde4k8e5409bc7933bc21@mail.gmail.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=alexander.h.duyck@intel.com \
--cc=anton@samba.org \
--cc=bruce.w.allan@intel.com \
--cc=donald.c.skidmore@intel.com \
--cc=e1000-devel@lists.sourceforge.net \
--cc=jesse.brandeburg@intel.com \
--cc=john.ronciak@intel.com \
--cc=netdev@vger.kernel.org \
--cc=peter.p.waskiewicz.jr@intel.com \
--cc=yi.zou@intel.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).