Subject: Re: netif_tx_disable vs netif_stop_queue (possible races?)

From: Daniel Drake <[email-masked]>
Date: Fri, 09 Jun 2006 16:29:13 +0100

Herbert Xu wrote:
> Daniel Drake <[email-masked]> wrote:
>> More specifically, we're talking about drivers/usb/net/usbnet.c and the 
>> usbnet_disconnect() function.  The race I am highlighting is that 
>> usbnet's hard_start_xmit handler (usbnet_start_xmit) may be running when 
>> the disconnect happens.
>>
>> Is this a possible scenario?
> 
> It should be safe, if only because of the synchronize_net that occurs
> before a netdev can be freed.

Can I interpret your response as: If the TX queue is disabled in 
advance, no hard_start_xmit functions will be running on any CPU after 
synchronize_net() has returned?

The synchronize_net() code doesn't make it very clear.

Thanks,
Daniel