From: Stephen Hemminger <shemminger@osdl.org>
To: Roland Dreier <rdreier@cisco.com>
Cc: netdev@vger.kernel.org
Subject: Re: NAPI: netif_rx_reschedule() ??
Date: Wed, 30 Aug 2006 16:38:29 -0700 [thread overview]
Message-ID: <20060830163829.5843c3c7@localhost.localdomain> (raw)
In-Reply-To: <adapsehls1r.fsf@cisco.com>
On Wed, 30 Aug 2006 16:31:12 -0700
Roland Dreier <rdreier@cisco.com> wrote:
> Stephen> The undo should really be handled by the caller, not in
> Stephen> netif_rx_reschedule. The existing interface assumes you
> Stephen> have already deducted N from your quota and so it needs
> Stephen> to be put back.
>
> makes sense -- especially since the caller probably also deducted N
> from *budget, and netif_rx_reschedule() doesn't touch that.
Changing it wouldn't be hard with only a couple of users.
>
> Stephen> If poll is already scheduled, then after leaving this
> Stephen> poll call, another will occur. If the poll routine just
> Stephen> went ahead and rescanned that would work as well. The
> Stephen> important part is not to leave the poll routine without
> Stephen> being in one of these states: * all work is done, and
> Stephen> hardware is empty and/or will interrupt for more. * some
> Stephen> work was done, and device left on poll_list with softirq
> Stephen> raised
>
> But how does the return value of netif_rx_reschedule() help anything?
> It either tells you that a poll was already scheduled, or that it
> succeeded in scheduling a poll. In either case another poll will
> happen. So why should the caller care?
>
> Or is it possible that netif_rx_reschedule() returning 0 might mean
> that it failed to reschedule the poll routine? But even if that's
> true, how can the caller use that -- 0 might mean the poll was already
> rescheduled, and it might mean that the poll couldn't be resheduled,
> but there's no way for the caller to know which.
>
> - R.
The return value doesn't really help. It should just be a void
function, the resulting state is the same in either case.
--
Stephen Hemminger <shemminger@osdl.org>
next prev parent reply other threads:[~2006-08-30 23:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-30 22:07 NAPI: netif_rx_reschedule() ?? Roland Dreier
2006-08-30 23:12 ` Stephen Hemminger
2006-08-30 23:31 ` Roland Dreier
2006-08-30 23:38 ` Stephen Hemminger [this message]
2006-08-30 23:39 ` Roland Dreier
2006-08-31 21:29 ` Stephen Hemminger
2006-08-31 21:50 ` jamal
2006-08-31 23:54 ` Alexey Kuznetsov
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=20060830163829.5843c3c7@localhost.localdomain \
--to=shemminger@osdl.org \
--cc=netdev@vger.kernel.org \
--cc=rdreier@cisco.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