netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: netdev@vger.kernel.org, mhuth@mvista.com,
	kgdb-bugreport@lists.sourceforge.net
Subject: Re: [Kgdb-bugreport] [PATCH] 8139too: harden against TX ring overflow
Date: Thu, 24 May 2007 17:39:22 -0400	[thread overview]
Message-ID: <4656060A.6000102@garzik.org> (raw)
In-Reply-To: <465603B9.90401@ru.mvista.com>

Sergei Shtylyov wrote:
> Hello, I wrote:
>> This driver's 4-packet deep TX queue is too sensible to the "careless" 
>> callers
>> ignoring its state (like netpoll in trapped mode), so add "queue full" 
>> check at
>> the start of the hard_start_xmit() method (only under #ifndef 
>> RTL8139_NDEBUG,
>> otherwise the queue will get stuck once dirty pointer gets out of 
>> sync); switch
>> to using appropriate mnemonics for the return values while at it.
>> Also, the out-of-sync dirty pointer check is misplaced in 
>> rtl8139_tx_interrupt()
>> which causes TX descriptors to be inspected more than once in case the 
>> pointer
>> really gets out-of-sync (and incrementing the dirty pointer always by 
>> 4 is just
>> not enough, e.g. KGDBoE managed to stuff 20+ extra buffers into the 
>> queue) --
>> place it before the loop and limit the loop to only look through 4 
>> descriptors
>> at most, so that already overwritten descriptors are just not counted.
> 
>> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> 
>    Jeff, do you have any opinion on this patch?

The out-of-sync dirty pointer check is leftover boilerplate, and not 
really indicative of anything except for some code to be removed.

As for the other stuff, I would say "fix the caller".  We don't need to 
hack every driver for cases where netpoll is being dumb.

	Jeff




  reply	other threads:[~2007-05-24 21:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-05 19:50 [PATCH] 8139too: harden against TX ring overflow Sergei Shtylyov
2007-04-06  1:48 ` Herbert Xu
2007-04-06  3:31   ` Amit S. Kale
2007-04-06 14:40     ` [Kgdb-bugreport] " Sergei Shtylyov
2007-05-24 21:29 ` Sergei Shtylyov
2007-05-24 21:39   ` Jeff Garzik [this message]
2007-05-24 21:44     ` Sergei Shtylyov
2007-05-24 21:44       ` Jeff Garzik

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=4656060A.6000102@garzik.org \
    --to=jeff@garzik.org \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=mhuth@mvista.com \
    --cc=netdev@vger.kernel.org \
    --cc=sshtylyov@ru.mvista.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).