Subject: Re: netdev ioctl & dev_base_lock : bad idea ?

From: "David S. Miller" <[email-masked]>
Date: Wed, 8 Dec 2004 23:13:31 -0800

On Thu, 09 Dec 2004 17:22:13 +1100
Benjamin Herrenschmidt <[email-masked]> wrote:

> Right, and I missed the fact that we did indeed take the semaphore and
> not the lock in the _set_ functions which is just fine, we can actually
> schedule.... except in set_multicast...
> 
> Is there any reason we actually _need_ to get the xmit lock in this one
> specifically ?

Since we implement NETIF_F_LLTX, the core packet transmit routines do
no locking, the driver does it all.

So if we don't hold the tx lock in the set multicast routine, any other
cpu can come into our hard_start_xmit function and poke at the hardware.

Upon further consideration, it seems that it may be OK to drop that tx
lock right after we do the netif_stop_queue().  But we should regrab
the tx lock when we do the subsequent netif_wake_queue().