netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: acenic lockup
  2003-05-07  7:06 acenic lockup Anton Blanchard
@ 2003-05-07  6:43 ` David S. Miller
  2003-05-07 17:06   ` Alexey Kuznetsov
  0 siblings, 1 reply; 10+ messages in thread
From: David S. Miller @ 2003-05-07  6:43 UTC (permalink / raw)
  To: anton; +Cc: jes, kuznet, netdev

   From: Anton Blanchard <anton@samba.org>
   Date: Wed, 7 May 2003 17:06:57 +1000
   
   Its stuck there and never coming out. Alexey: I have a feeling you
   wrote this code, is that correct? :)

It is well understood failure of this driver, actually.

If Acenic hangs in any way at all, driver hangs in this loop.

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

* acenic lockup
@ 2003-05-07  7:06 Anton Blanchard
  2003-05-07  6:43 ` David S. Miller
  0 siblings, 1 reply; 10+ messages in thread
From: Anton Blanchard @ 2003-05-07  7:06 UTC (permalink / raw)
  To: jes; +Cc: kuznet, netdev


Hi,

Ive got a bucketload of acenic adapters in a ppc64 box. I get random
tx timeouts, I suspect there is a missing memory barrier (power4 is
good at catching those). Still looking.

I did manage to lock a card up in ace_start_xmit:

restart:
...
        if (tx_ring_full(ap, ap->tx_ret_csm, idx))
	                goto overflow;
...
overflow:
        /*
         * This race condition is unavoidable with lock-free drivers.
         * We wake up the queue _before_ tx_prd is advanced, so that we
         * can
         * enter hard_start_xmit too early, while tx ring still looks
         * closed.
         * This happens ~1-4 times per 100000 packets, so that we can
         * allow
         * to loop syncing to other CPU. Probably, we need an additional
         * wmb() in ace_tx_intr as well.
         *
         * Note that this race is relieved by reserving one more entry
         * in tx ring than it is necessary (see original non-SG driver).
         * However, with SG we need to reserve 2*MAX_SKB_FRAGS+1, which
         * is already overkill.
         *
         * Alternative is to return with 1 not throttling queue. In this
         * case loop becomes longer, no more useful effects.
         */
        barrier();
        goto restart;

Its stuck there and never coming out. Alexey: I have a feeling you
wrote this code, is that correct? :)

Anton

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

* Re: acenic lockup
  2003-05-07  6:43 ` David S. Miller
@ 2003-05-07 17:06   ` Alexey Kuznetsov
  2003-05-07 19:34     ` David S. Miller
  0 siblings, 1 reply; 10+ messages in thread
From: Alexey Kuznetsov @ 2003-05-07 17:06 UTC (permalink / raw)
  To: David S. Miller; +Cc: anton, jes, netdev

Hello!

>    Its stuck there and never coming out. Alexey: I have a feeling you
>    wrote this code, is that correct? :)

Yes, I did. I am not sure about barriers, I stopped attempts
to understand this long ago. Anyway, intel does not have anything
to put here, mb() at side updating pointer looks enough.
 

There is a real ugly BUG in the driver, ace_watchdog():

 	} else {
		printk(KERN_DEBUG "%s: BUG... transmitter died. Kicking it.\n",
		       dev->name);
#if 0
		netif_wake_queue(dev);
#endif
	}

(#if is from my local tree). I remember we discussed this with Dave
and he was very angry about this flaw shared by most of drivers and, seems,
did not eat this fix.

So, if you see the message, it is surely this bug.


Alexey

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

* Re: acenic lockup
  2003-05-07 17:06   ` Alexey Kuznetsov
@ 2003-05-07 19:34     ` David S. Miller
  2003-05-07 22:21       ` Alexey Kuznetsov
  0 siblings, 1 reply; 10+ messages in thread
From: David S. Miller @ 2003-05-07 19:34 UTC (permalink / raw)
  To: kuznet; +Cc: anton, jes, netdev

   From: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
   Date: Wed, 7 May 2003 21:06:32 +0400 (MSD)
   
   I remember we discussed this with Dave
   and he was very angry about this flaw shared by most of drivers
   and, seems, did not eat this fix.
   
Yes, this netif_wake_queue() in acenic's watchdog routine
is bogus.  It is guarenteed lockup.

Ok, I applied this.

However, what does kick device back into working state?

Do we make shamans dance when this message hits the logs
and pray for the best? :-)

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

* Re: acenic lockup
  2003-05-07 19:34     ` David S. Miller
@ 2003-05-07 22:21       ` Alexey Kuznetsov
  2003-05-08 16:00         ` David S. Miller
  0 siblings, 1 reply; 10+ messages in thread
From: Alexey Kuznetsov @ 2003-05-07 22:21 UTC (permalink / raw)
  To: David S. Miller; +Cc: anton, jes, netdev

Hello!

> However, what does kick device back into working state?

Usually it is a link problem and device will recover after
link is restored. This happens here.

If it is some PCI failure or something went wrong in hardware,
the device will stop forever, I guess. And I guess this happens
with the same frequency as memory parity errors i.e. not so much. :-)


> Do we make shamans dance when this message hits the logs
> and pray for the best? :-) 

Sort of. I was about to dance for a while when saw creepy
"ethX: BUG, tx ring is full" from tulip, which has the same bogus
netif_wake_queue(). :-)

Well, full reset is difficult thing with lock-free acenic.
Seems, it has to throttle card, wake up something at process context,
to disable irq there and to reset nic like it happens at ifconfig down
(or even module unload in face of hard hardware failure?)

Alexey

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

* Re: acenic lockup
  2003-05-07 22:21       ` Alexey Kuznetsov
@ 2003-05-08 16:00         ` David S. Miller
  2003-05-08 17:11           ` Jeff Garzik
  0 siblings, 1 reply; 10+ messages in thread
From: David S. Miller @ 2003-05-08 16:00 UTC (permalink / raw)
  To: kuznet; +Cc: anton, jes, netdev, jgarzik

   From: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
   Date: Thu, 8 May 2003 02:21:11 +0400 (MSD)

   > However, what does kick device back into working state?
   
   Usually it is a link problem and device will recover after
   link is restored. This happens here.
   
I fully recognize this.

   If it is some PCI failure or something went wrong in hardware,
   the device will stop forever, I guess. And I guess this happens
   with the same frequency as memory parity errors i.e. not so much. :-)
   
Sometimes it is not cosmic bit-flip which causes this, but rather
bit-flip caused by programmer of some unrelated area of kernel :-)))
   
I am happy that hard-hang part is probably gone now.  But I also
desire real resiliency in this area of drivers.

   > Do we make shamans dance when this message hits the logs
   > and pray for the best? :-) 
   
   Sort of. I was about to dance for a while when saw creepy
   "ethX: BUG, tx ring is full" from tulip, which has the same bogus
   netif_wake_queue(). :-)
   
Note to Jeff, independant of what is being discussed here, a real
audit of drivers that blindly invoke netif_wake_queue() from transmit
timeout watchdog routine is in order at some point.  This is what
Alexey is referring to as "same bogus netif_wake_queue()".

   Well, full reset is difficult thing with lock-free acenic.
   Seems, it has to throttle card, wake up something at process context,
   to disable irq there and to reset nic like it happens at ifconfig down
   (or even module unload in face of hard hardware failure?)

It is simple, use schedule_work(), tg3.c does exactly this.
Only difference in acenic is need to use disable_irq(), that is all.

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

* Re: acenic lockup
  2003-05-08 17:11           ` Jeff Garzik
@ 2003-05-08 16:09             ` David S. Miller
  2003-05-08 17:27               ` Jeff Garzik
  0 siblings, 1 reply; 10+ messages in thread
From: David S. Miller @ 2003-05-08 16:09 UTC (permalink / raw)
  To: jgarzik; +Cc: kuznet, anton, jes, netdev

   From: Jeff Garzik <jgarzik@redhat.com>
   Date: Thu, 8 May 2003 13:11:35 -0400
   
   P.S. Can you please email @pobox.com for stuff that is not Red Hat
   specific?
   
My apologies, I will do this in the future.

How much will this affect latency though? :-)

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

* Re: acenic lockup
  2003-05-08 16:00         ` David S. Miller
@ 2003-05-08 17:11           ` Jeff Garzik
  2003-05-08 16:09             ` David S. Miller
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff Garzik @ 2003-05-08 17:11 UTC (permalink / raw)
  To: David S. Miller; +Cc: kuznet, anton, jes, netdev

On Thu, May 08, 2003 at 09:00:49AM -0700, David S. Miller wrote:
> Note to Jeff, independant of what is being discussed here, a real
> audit of drivers that blindly invoke netif_wake_queue() from transmit
> timeout watchdog routine is in order at some point.  This is what
> Alexey is referring to as "same bogus netif_wake_queue()".

Agreed.  Alexey has pointed out netif_wake_queue stupidities in
drivers before, and he's absolutely right.

	Jeff



P.S. Can you please email @pobox.com for stuff that is not Red Hat
specific?  I am trying to use @redhat.com for only official Red Hat
business.  My boss forces me to bk-commit as @redhat.com, otherwise you
would never see that address in public at all.

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

* Re: acenic lockup
  2003-05-08 16:09             ` David S. Miller
@ 2003-05-08 17:27               ` Jeff Garzik
  2003-05-14 11:40                 ` Jamal Hadi
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff Garzik @ 2003-05-08 17:27 UTC (permalink / raw)
  To: David S. Miller; +Cc: kuznet, anton, jes, netdev

On Thu, May 08, 2003 at 09:09:54AM -0700, David S. Miller wrote:
>    From: Jeff Garzik <jgarzik@redhat.com>
>    Date: Thu, 8 May 2003 13:11:35 -0400
>    
>    P.S. Can you please email @pobox.com for stuff that is not Red Hat
>    specific?
>    
> My apologies, I will do this in the future.
> 
> How much will this affect latency though? :-)

Should improve it :)  I didn't check my redhat.com email all weekend
this past weekend, for example.

	Jeff

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

* Re: acenic lockup
  2003-05-08 17:27               ` Jeff Garzik
@ 2003-05-14 11:40                 ` Jamal Hadi
  0 siblings, 0 replies; 10+ messages in thread
From: Jamal Hadi @ 2003-05-14 11:40 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: David S. Miller, kuznet, anton, jes, netdev



Jeff,

Dont forget that nice looking fixed tulip which gets rid of the
nonsense tx_timeout;->
http://www.cyberus.ca/~hadi/patches/tulip-sym-fixed-20030103.tgz

cheers,
jamal

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

end of thread, other threads:[~2003-05-14 11:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-07  7:06 acenic lockup Anton Blanchard
2003-05-07  6:43 ` David S. Miller
2003-05-07 17:06   ` Alexey Kuznetsov
2003-05-07 19:34     ` David S. Miller
2003-05-07 22:21       ` Alexey Kuznetsov
2003-05-08 16:00         ` David S. Miller
2003-05-08 17:11           ` Jeff Garzik
2003-05-08 16:09             ` David S. Miller
2003-05-08 17:27               ` Jeff Garzik
2003-05-14 11:40                 ` Jamal Hadi

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).