lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 25 Mar 2014 00:44:41 +0000
From:	Wei Liu <liuw@...w.name>
To:	David Miller <davem@...emloft.net>
Cc:	Wei Liu <wei.liu2@...rix.com>,
	Ian Campbell <ian.campbell@...rix.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	edwin@...rok.net,
	"xen-devel@...ts.xen.org" <xen-devel@...ts.xen.org>,
	Paul Durrant <paul.durrant@...rix.com>, zoltan.kiss@...rix.com
Subject: Re: [Xen-devel] [PATCH net] xen-netback: disable rogue vif in kthread context

On Mon, Mar 24, 2014 at 7:29 PM, David Miller <davem@...emloft.net> wrote:
> From: Wei Liu <wei.liu2@...rix.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.
>

Yes, you're right. I made a mistake in using the budget the other way around.

Wei.

> _______________________________________________
> Xen-devel mailing list
> Xen-devel@...ts.xen.org
> http://lists.xen.org/xen-devel
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ