All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, shemminger@linux-foundation.org,
	jgarzik@pobox.com, hadi@cyberus.ca
Subject: Re: [PATCH RFX]: napi_struct V3
Date: Wed, 25 Jul 2007 11:15:49 +1000	[thread overview]
Message-ID: <1185326149.1803.421.camel@localhost.localdomain> (raw)
In-Reply-To: <20070724.174537.21926733.davem@davemloft.net>

On Tue, 2007-07-24 at 17:45 -0700, David Miller wrote:
> I'm now going to go over the other resched cases and make sure
> things can be similarly handled in those drivers as well.
> To be honest I'm quite confident this will be the case.

If I understand correctly, you're looking at a general model like the
following:

	while (more_packets()) { ... netif_receive_skb() }

	enable_rx_and_rxnobuf_ints();

	/* Lock protects against race w/ rx interrupt re-queueing us */
	spin_lock_irq();
	if (!more_packets())
		netif_rx_complete(dev);
	else
		/* We'll be scheduled again. */
		disable_rx_and_rxnobuff_ints();
	spin_unlock_irq();

Seems pretty robust to me.  The race is probably pretty unusual, so the
only downside is the locking overhead?  Even non-irq-problematic drivers
could use this (ie. virt_net.c probably wants to do it even though
virtio implementation may not have this issue).

Cheers,
Rusty.


  reply	other threads:[~2007-07-25  1:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-24  4:07 [PATCH RFX]: napi_struct V3 David Miller
2007-07-24  4:47 ` Rusty Russell
2007-07-24  5:47   ` David Miller
2007-07-24  6:21     ` Rusty Russell
2007-07-25  0:45       ` David Miller
2007-07-25  1:15         ` Rusty Russell [this message]
2007-07-25  1:47           ` David Miller
2007-07-25  2:33             ` Rusty Russell
2007-07-25  4:29               ` David Miller
2007-07-25  5:09                 ` Rusty Russell
2007-07-25  5:12                   ` David Miller
2007-07-25  5:10             ` David Miller
2007-07-24  7:12 ` Francois Romieu
2007-07-24  7:33   ` Jeff Garzik
2007-07-24  7:35   ` David Miller
2007-07-28 15:21 ` Roland Dreier
2007-07-29  5:30   ` 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=1185326149.1803.421.camel@localhost.localdomain \
    --to=rusty@rustcorp.com.au \
    --cc=davem@davemloft.net \
    --cc=hadi@cyberus.ca \
    --cc=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.