public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft•net>
To: avorontsov@ru•mvista.com
Cc: linuxppc-dev@ozlabs•org, netdev@vger•kernel.org,
	martyn.welch@ge•com, paul.gortmaker@windriver•com,
	Sandeep.Kumar@freescale•com
Subject: Re: [PATCH] gianfar: Fix TX ring processing on SMP machines
Date: Thu, 04 Mar 2010 00:41:57 -0800 (PST)	[thread overview]
Message-ID: <20100304.004157.18721737.davem@davemloft.net> (raw)
In-Reply-To: <20100303181858.GA458@oksana.dev.rtsoft.ru>

From: Anton Vorontsov <avorontsov@ru•mvista.com>
Date: Wed, 3 Mar 2010 21:18:58 +0300

> Starting with commit a3bc1f11e9b867a4f49505 ("gianfar: Revive SKB
> recycling") gianfar driver sooner or later stops transmitting any
> packets on SMP machines.
> 
> start_xmit() prepares new skb for transmitting, generally it does
> three things:
> 
> 1. sets up all BDs (marks them ready to send), except the first one.
> 2. stores skb into tx_queue->tx_skbuff so that clean_tx_ring()
>    would cleanup it later.
> 3. sets up the first BD, i.e. marks it ready.
> 
> Here is what clean_tx_ring() does:
> 
> 1. reads skbs from tx_queue->tx_skbuff
> 2. checks if the *last* BD is ready. If it's still ready [to send]
>    then it it isn't transmitted, so clean_tx_ring() returns.
>    Otherwise it actually cleanups BDs. All is OK.
> 
> Now, if there is just one BD, code flow:
> 
> - start_xmit(): stores skb into tx_skbuff. Note that the first BD
>   (which is also the last one) isn't marked as ready, yet.
> - clean_tx_ring(): sees that skb is not null, *and* its lstatus
>   says that it is NOT ready (like if BD was sent), so it cleans
>   it up (bad!)
> - start_xmit(): marks BD as ready [to send], but it's too late.
> 
> We can fix this simply by reordering lstatus/tx_skbuff writes.
> 
> Reported-by: Martyn Welch <martyn.welch@ge•com>
> Bisected-by: Paul Gortmaker <paul.gortmaker@windriver•com>
> Signed-off-by: Anton Vorontsov <avorontsov@ru•mvista.com>
> Tested-by: Paul Gortmaker <paul.gortmaker@windriver•com>
> Tested-by: Martyn Welch <martyn.welch@ge•com>

Applied.

  reply	other threads:[~2010-03-04  8:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-03 18:18 [PATCH] gianfar: Fix TX ring processing on SMP machines Anton Vorontsov
2010-03-04  8:41 ` David Miller [this message]
2010-03-04 16:34   ` Kumar Gala
2010-06-11  8:45 ` Esben Haabendal

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=20100304.004157.18721737.davem@davemloft.net \
    --to=davem@davemloft$(echo .)net \
    --cc=Sandeep.Kumar@freescale$(echo .)com \
    --cc=avorontsov@ru$(echo .)mvista.com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=martyn.welch@ge$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=paul.gortmaker@windriver$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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