Re: question about napi_disable (was Re: [PATCH] virtio_net: set/cancel work on ndo_open/ndo_stop)

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

On 04/04/2012 05:32 PM, Michael S. Tsirkin wrote:
On Thu, Dec 29, 2011 at 09:12:38PM +1030, Rusty Russell wrote:
>  Michael S. Tsirkin noticed that we could run the refill work after
>  ndo_close, which can re-enable napi - we don't disable it until
>  virtnet_remove.  This is clearly wrong, so move the workqueue control
>  to ndo_open and ndo_stop (aka. virtnet_open and virtnet_close).
> > One subtle point: virtnet_probe() could simply fail if it couldn't
>  allocate a receive buffer, but that's less polite in virtnet_open() so
>  we schedule a refill as we do in the normal receive path if we run out
>  of memory.
> > Signed-off-by: Rusty Russell<rusty@xxxxxxxxxxxxxxx>
Doh.
napi_disable does not prevent the following
napi_schedule, does it?

Can someone confirm that I am not seeing things please?
Looks like napi_disable() does prevent the following scheduling, as napi_schedule_prep() returns true only when there's an 0 -> 1 transition of NAPI_STATE_SCHED bit.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux Kernel Discussion]     [Ethernet Bridging]     [Linux Wireless Networking]     [Linux Bluetooth Networking]     [Linux Networking Users]     [VLAN]     [Git]     [IETF Annouce]     [Linux Assembly]     [Security]     [Bugtraq]     [Photo]     [Singles Social Networking]     [Yosemite Information]     [MIPS Linux]     [ARM Linux Kernel]     [ARM Linux]     [Linux Virtualization]     [Linux Security]     [Linux IDE]     [Linux RAID]     [Linux SCSI]     [Free Dating]

Add to Google Powered by Linux