From: David Miller <davem@davemloft.net>
To: wei.liu2@citrix.com
Cc: netdev@vger.kernel.org, xen-devel@lists.xen.org,
paul.durrant@citrix.com, zoltan.kiss@citrix.com,
edwin@etorok.net, ian.campbell@citrix.com
Subject: Re: [PATCH net] xen-netback: disable rogue vif in kthread context
Date: Mon, 24 Mar 2014 15:29:45 -0400 (EDT) [thread overview]
Message-ID: <20140324.152945.1082990562317636743.davem@davemloft.net> (raw)
In-Reply-To: <1395663214-14133-1-git-send-email-wei.liu2@citrix.com>
From: Wei Liu <wei.liu2@citrix.com>
Date: Mon, 24 Mar 2014 12:13:34 +0000
> @@ -62,6 +62,13 @@ static int xenvif_poll(struct napi_struct *napi, int budget)
> struct xenvif *vif = container_of(napi, struct xenvif, napi);
> int work_done;
>
> + /* This vif is rogue, we pretend we've used up all budget to
> + * deschedule it from NAPI. But this interface will be turned
> + * off in thread context later.
> + */
> + if (unlikely(vif->disabled))
> + return budget;
> +
As mentioned by others, this makes NAPI poll forever.
The following comment was referenced:
/* Drivers must not modify the NAPI state if they
* consume the entire weight. In such cases this code
* still "owns" the NAPI instance and therefore can
* move the instance around on the list at-will.
*/
if (unlikely(work == weight)) {
WHICH MEANS, if you return that you used the full budget, the NAPI instance
is still owned by the core.
Why? Becuase if you used the entire budget, it's going to put you back onto
the polling list and invoke you again some time soon.
If the interface is disabled, you should return zero from the poll and do a
NAPI completion.
next prev parent reply other threads:[~2014-03-24 19:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-24 12:13 [PATCH net] xen-netback: disable rogue vif in kthread context Wei Liu
2014-03-24 12:22 ` Ian Campbell
2014-03-24 12:33 ` David Laight
2014-03-24 12:49 ` [Xen-devel] " David Vrabel
2014-03-24 13:17 ` Zoltan Kiss
2014-03-25 0:55 ` Wei Liu
2014-03-24 19:29 ` David Miller [this message]
2014-03-25 0:44 ` Wei Liu
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=20140324.152945.1082990562317636743.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=edwin@etorok.net \
--cc=ian.campbell@citrix.com \
--cc=netdev@vger.kernel.org \
--cc=paul.durrant@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
--cc=zoltan.kiss@citrix.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).