Subject: Re: [PATCH 2.6.18 2/3] tg3: Convert to non-LLTX

From: Stephen Hemminger <[email-masked]>
Date: Mon, 5 Jun 2006 15:58:34 -0700

On Mon, 05 Jun 2006 12:47:32 -0700
"Michael Chan" <[email-masked]> wrote:

> Herbert Xu pointed out that it is unsafe to call netif_tx_disable()
> from LLTX drivers because it uses dev->xmit_lock to synchronize
> whereas LLTX drivers use private locks.
> 
> Convert tg3 to non-LLTX to fix this issue. tg3 is a lockless driver
> where hard_start_xmit and tx completion handling can run concurrently
> under normal conditions. A tx_lock is only needed to prevent
> netif_stop_queue and netif_wake_queue race condtions when the queue
> is full.
> 
> So whether we use LLTX or non-LLTX, it makes practically no
> difference.
> 
> Signed-off-by: Michael Chan <[email-masked]>

Since you are going more lockless, you probably need memory barriers.

I don't feel although that comfortable with the lockless driver model as is.
Perhaps there is something simpler that could be done with a ring model and
some atomic primitives like cmpxchg()?