netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: netif_tx_disable and lockless TX
@ 2006-05-31  4:51 Michael Chan
  2006-05-31  4:58 ` Herbert Xu
  0 siblings, 1 reply; 42+ messages in thread
From: Michael Chan @ 2006-05-31  4:51 UTC (permalink / raw)
  To: Herbert Xu, David Miller; +Cc: jgarzik, netdev

Herbert Xu wrote:

> On Tue, May 30, 2006 at 09:13:22PM -0700, David Miller wrote:
> > As per the bug, I always keep thinking about changing how we
> > do the lockless stuff by simply making xmit_lock a pointer.
> > Drivers like tg3 can make it point to their local driver lock.
> 
> This is equivalent to just using the xmit_lock in the driver, right?
> IIRC the problem was with IRQ disabling vs. BH disabling.

For drivers that always take a private tx lock between tx completion
and hard_start_xmit on top of the xmit_lock, getting rid of the
xmit_lock using LLTX is a net gain.

For drivers that don't need a private tx lock or rarely need it between
tx completion and hard_start_xmit, it makes little difference whether
you use xmit_lock or private lock with LLTX.

> 
> That's why I suggest that every NIC that uses this feature be forced
> to do what TG3 does so only BH disabling is needed.  Once that's done
> they can just use xmit_lock and everyone will be happy again.
> 

As long as the tx completion is all done in NAPI, it can use BH
disabling
without irq disabling.

TG3 uses LLTX with a private tx_lock. BNX2 uses xmit_lock with a private
tx_lock that is rarely used. Both drivers use BH disabling. The profiles
of the 2 drivers are very similar.


^ permalink raw reply	[flat|nested] 42+ messages in thread
* Re: netif_tx_disable and lockless TX
@ 2006-05-31  5:30 Michael Chan
  2006-05-31  5:33 ` Herbert Xu
  0 siblings, 1 reply; 42+ messages in thread
From: Michael Chan @ 2006-05-31  5:30 UTC (permalink / raw)
  To: David Miller, herbert; +Cc: jgarzik, netdev

David Miller wrote:

> From: Herbert Xu <herbert@gondor.apana.org.au>
> Date: Wed, 31 May 2006 14:58:11 +1000
> 
> > Yes, TG3 does not disable IRQs when taking its TX lock.  So do you
see
> > any problems with replacing the TG3 TX lock using xmit_lock?
> 
> I don't see any.
> 

I also don't see any problem. It looks like we don't have to set
xmit_lock_owner, right?


^ permalink raw reply	[flat|nested] 42+ messages in thread
* netif_tx_disable and lockless TX
@ 2006-05-31  4:03 Herbert Xu
  2006-05-31  4:13 ` David Miller
  2006-05-31  4:13 ` Roland Dreier
  0 siblings, 2 replies; 42+ messages in thread
From: Herbert Xu @ 2006-05-31  4:03 UTC (permalink / raw)
  To: David S. Miller, mchan, Jeff Garzik, netdev

Hi:

It has occured to me that the function netif_tx_disable may be unsafe
when used in drivers that do lockless transmission.  In particular,
the function relies on taking the xmit_lock to ensure that no further
transmissions will occur until the queue is started again.

However, lockless drivers do not take the xmit_lock so this method
is ineffective.  Such drivers need to do their own checking inside
whatever locks that they do take.  For example, tg3 could get around
this by checking whether the queue is stopped in its hard_start_xmit
function.

I must say though that I'm becoming less and less impressed by the
lockless feature based on the number of problems that it has caused.
Does anyone have any hard figures as to its effectiveness (excluding
any stats relating to the loopback interface which can be easily
separated from normal NIC drivers).

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2006-06-14 12:55 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-31  4:51 netif_tx_disable and lockless TX Michael Chan
2006-05-31  4:58 ` Herbert Xu
2006-05-31  5:11   ` David Miller
2006-05-31  5:14     ` Herbert Xu
2006-05-31  6:26       ` David Miller
2006-05-31  6:31         ` Herbert Xu
2006-05-31  7:08           ` David Miller
2006-05-31 12:06             ` Herbert Xu
2006-05-31 12:36               ` jamal
2006-05-31 12:40                 ` Herbert Xu
2006-05-31 13:03                   ` jamal
2006-05-31 17:52                 ` Robert Olsson
2006-06-02  3:25                   ` Stephen Hemminger
2006-06-02 10:46                     ` Robert Olsson
2006-06-14 12:52                   ` jamal
2006-05-31 21:20     ` Michael Chan
2006-06-01  0:09       ` David Miller
2006-06-01  0:25         ` Herbert Xu
2006-05-31 23:01           ` Michael Chan
2006-06-01  0:42             ` Herbert Xu
2006-06-01  0:27               ` Michael Chan
2006-06-01  2:27                 ` Herbert Xu
2006-06-01 11:15           ` [NET]: Add netif_tx_lock Herbert Xu
2006-06-06  4:32             ` David Miller
2006-06-06  4:44               ` Roland Dreier
2006-06-06  4:50                 ` Roland Dreier
2006-06-06  4:57                   ` Roland Dreier
2006-06-06  5:10                     ` David Miller
2006-06-06  6:01                       ` Roland Dreier
2006-06-06  4:58                   ` David Miller
2006-06-06  5:04                     ` Roland Dreier
2006-06-06  5:09                       ` David Miller
2006-06-06  4:57                 ` David Miller
2006-06-06 10:22               ` Herbert Xu
2006-06-09  5:48             ` Herbert Xu
2006-06-09 19:21               ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2006-05-31  5:30 netif_tx_disable and lockless TX Michael Chan
2006-05-31  5:33 ` Herbert Xu
2006-05-31  4:03 Herbert Xu
2006-05-31  4:13 ` David Miller
2006-05-31  4:17   ` Herbert Xu
2006-05-31  4:13 ` Roland Dreier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).