[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH net] xen-netback: disable rogue vif in kthread context



From: Wei Liu <wei.liu2@xxxxxxxxxx>
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.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.