netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krishna Kumar <kumarkr@linux.vnet.ibm.com>
To: "Waskiewicz Jr, Peter P" <peter.p.waskiewicz.jr@intel.com>
Cc: davem@davemloft.net, hadi@cyberus.ca,
	herbert@gondor.apana.org.au, tgraf@suug.ch, kaber@trash.net,
	netdev@vger.kernel.org
Subject: RE: [PATCH 1/2] qdisc_restart - readability changes, one bug fix.
Date: Mon, 18 Jun 2007 09:41:25 +0530	[thread overview]
Message-ID: <1182139885.6082.3.camel@localhost.localdomain> (raw)
In-Reply-To: <D5C1322C3E673F459512FB59E0DDC329030A0E5F@orsmsx414.amr.corp.intel.com>

On Fri, 2007-06-15 at 11:01 -0700, Waskiewicz Jr, Peter P wrote:

Hi Peter,

> I agree that the case shouldn't happen, and will only surface if the
> driver is indeed buggy.  I've thought about this conditional being
> removed for awhile, since it will protect against a poorly written
> driver wrt locking, but then again a driver behaving like that shouldn't
> be making it into the kernel.  That being said, out-of-tree drivers are
> heavily used (we have an out-of-tree e1000), and something like this
> could be missed.  But since that is the corner case of a crappy driver,
> I'm ok with this being removed.

Removing this check will work more efficiently for correctly written
drivers, but it will also catch the wrongly written drivers and free
up all the skbs (and print messages) as without this change, nothing
happens and resources are never freed up.

> These, at a glance, look very similar to the qdisc ->enqueue() and
> ->dequeue() function pointers.  I know I had to look a few times to
> realize they were separate calls through the qdisc and this new function
> name.  Perhaps dequeue_skb() can become dev_dequeue_skb() and
> requeue_skb() can be dev_requeue_skb()?  Something that helps
> differentiate these from the function pointers of the qdisc_ops might
> help distinguish what layer the operation is running on.

That is definitely required, I will send out a revised patch.

> I know there's been discussion on the driver side of the world to stop
> using unlikely() and likely() clauses.  I personally think it's ok in
> situations like this where you have one corner-case conditional without
> an else, but it's something to keep in mind when using them in
> new/rewritten code like this.

OK. The reason I had put the unlikely is that we are executing qdisc_restart
due to the synchronous queuing of a packet, or since we were rescheduled
after either :
	a. not getting tx lock (and when qdisc_restart had atleast one
	   packet in the queue, look for the qdisc_qlen return value in
	   handle_dev_cpu_collision).
	b. tx was busy and packet was requeue'd.

So in most (all?) cases, an skb should be found (I was not able to find a
case where skb can be NULL).

> The patch looks fine to me outside of the choice of names for
> dequeue_skb() and requeue_skb(), but I can be easily swayed.

I will send an updated patch for review. Thanks for your review comments.

- KK



  reply	other threads:[~2007-06-18  4:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-13  8:40 [PATCH 1/2] qdisc_restart - readability changes, one bug fix Krishna Kumar
2007-06-15 18:01 ` Waskiewicz Jr, Peter P
2007-06-18  4:11   ` Krishna Kumar [this message]
2007-06-18  4:51 ` [PATCH 1/2 - rev2] qdisc_restart - readability changes plus " Krishna Kumar
2007-06-18 17:51   ` [PATCH 1/2 - rev2] qdisc_restart - readability changes plus onebug fix Waskiewicz Jr, Peter P
2007-06-19  3:35     ` Krishna Kumar2
2007-06-19  3:58       ` David Miller
2007-06-19  4:00         ` Krishna Kumar2
2007-06-19 16:15         ` jamal
2007-06-25  2:48           ` Krishna Kumar
2007-06-25  2:54             ` David Miller
2007-06-25  2:56   ` [PATCH 1/2 - rev2] qdisc_restart - readability changes plus one bug fix David Miller

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=1182139885.6082.3.camel@localhost.localdomain \
    --to=kumarkr@linux.vnet.ibm.com \
    --cc=davem@davemloft.net \
    --cc=hadi@cyberus.ca \
    --cc=herbert@gondor.apana.org.au \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=peter.p.waskiewicz.jr@intel.com \
    --cc=tgraf@suug.ch \
    /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).