netdev
[Top] [All Lists]

Re: [PATCH] net: Disable queueing when carrier is lost

To: Tommy Christensen <tommy.christensen@xxxxxxxxx>
Subject: Re: [PATCH] net: Disable queueing when carrier is lost
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 28 Apr 2005 09:43:59 +1000
Cc: davem@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <42701FFD.5000505@tpack.net>
References: <E1DQlsn-0005yd-00@gondolin.me.apana.org.au> <426FDF8B.1030808@tpack.net> <20050427214224.GA25325@gondor.apana.org.au> <42701FFD.5000505@tpack.net>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6+20040907i
On Thu, Apr 28, 2005 at 01:27:57AM +0200, Tommy Christensen wrote:
> 
> Hmm, maybe this is more common than I thought. But do any of these really
> have a problem? I.e. do they call netif_stop_queue on link down?
> That's the case I'm trying to address with the patch.

You're still assuming that the hardware will continue to drain packets
when the carrier goes off.  This may be true for a lot of NICs, but it
is certainly not universal.
 
> This is indeed possible, but hopefully you can agree that this would be
> a driver bug. As stated above, I'm not trying to solve everything. We
> have to assume some level of sanity of the drivers. E.g. for a NIC that
> stalls the TX engine on carrier off, the driver would have to flush the
> TX ring and either call netif_stop_queue or discard packets in their
> hard_start_xmit function.  At present, even such well-behaving drivers
> would hit the problem, because packets were piling up in the qdisc.

I am not saying that there is nothing to fix.  I'm simply stating
that doing it in the watchdog is not ideal for two reasons:

1) The watchdog is not always there.
2) The delay introduced by the watchdog is driver-dependent and
varies wildly.  For the purpose of shutting down the qdisc after
a carrier off we want everything to use the same delay (if we're
going to delay at all).

So instead of doing it in the watchdog, just do both actions in
the link_watch worker.

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

<Prev in Thread] Current Thread [Next in Thread>