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 12:33:14 +1000 [thread overview]
Message-ID: <1185330794.1803.452.camel@localhost.localdomain> (raw)
In-Reply-To: <20070724.184759.111203672.davem@davemloft.net>
On Tue, 2007-07-24 at 18:47 -0700, David Miller wrote:
> One thing that's peculiar is that when netif_rx_schedule_prep()
> fails, we don't disable interrupts but we also don't clear the
> condition that is causing the interrupt to occur.
I think we're ok, but this stuff is tricky.
In the driver in -rc1, I think it will only fail if racing with the
netif_rx_reschedule, which will do the right thing.
In your version, there is only one place where prep can fail (ie.
interrupts are enabled, but netif_rx_complete() hasn't been called):
when ibmveth_poll saw pending buffers and disabled the irq (which has
already been delivered and is spinning on the poll_lock)
In this case, we're ok because the irqs really are disabled now: the
running handler is a relic.
> Perhaps the lock is avoidable somehow, who knows :)
Maybe by adding YA state bit? Hold on, this might get ugly...
Say netif_rx_schedule_prep() sets the MORE_TODO bit (atomically instead
of setting __LINK_STATE_RX_SCHED) if it's going to fail, and
netif_rx_complete() returns 0 if it was set, or 1 if it's OK. Now
callers do:
reenable_interrupts();
if (rx_pending() || !netif_rx_complete(netdev, napi))
disable_interrupts();
I'm going to go absorb some more caffeine before you reply 8)
Rusty.
next prev parent reply other threads:[~2007-07-25 2:33 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
2007-07-25 1:47 ` David Miller
2007-07-25 2:33 ` Rusty Russell [this message]
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=1185330794.1803.452.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 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).