Stephen Hemminger [off-list ref] :
The e1000 driver has an tx_lock which unneeded. It is only used to protect
the start/stop queue flags which are already handled by doing atomic bit
operations.
I am not terribly used to this code but as far as I can read it, the lock
avoids that the condition which leads to netif_stop_queue() in the xmit
thread changes (due to an irq) "just before" netif_stop_queue() is actually
called.
So, if the lock is removed, I would be tempted to have the xmit thread
issue an smp_rmb() and revalidate that it was fine to netif_stop_queue().
Otherwise, one could have:
[e1000_xmit_frame]
if (E1000_DESC_UNUSED(&adapter->tx_ring) < count + 2 ) {
<- at the same time on a different CPU ->
[...]
e1000_clean_tx_irq::netif_wake_queue() // Plenty of room has been made
[...]
<- back to e1000_xmit_frame() ->
netif_stop_queue
return 1;
}
--
Ueimor