Subject: Re: [PATCH] [e1000]: Remove unnecessary tx_lock

From: David Miller <[email-masked]>
Date: Tue, 08 Aug 2006 15:06:07 -0700 (PDT)

From: Benjamin LaHaise <[email-masked]>
Date: Tue, 8 Aug 2006 13:04:32 -0400

> Maybe the way NETDEV_TX_BUSY is implemented is wrong -- that is, it should 
> be possible to return a result saying "we sent the packet, but the queue is 
> now full".  That would eliminate the atomic op that netif_queue_stop() 
> performs and allow higher layers to merge the necessary barrier on the full 
> case with the op on the tx lock.  That way we could have lockless queue 
> handling within the driver.  This might need start/stop sequence counters, 
> though.

The driver ->hard_start_xmit() method is invoked with the queue
unlocked, so this kind of scheme would not be workable.

While the queue is unlocked, another cpu could empty entries in the
TX queue making it not-full, which invalidates this "queue is now
full" return value the driver just gave.

We don't do things the way we do it now for fun, it's just the most
reasonable scheme we've come up with given the locking constraints.