Netdev List
 help / color / mirror / Atom feed
* [PATCH] Speedup link loss detection for 3c59x
@ 2010-04-15  9:11 Martin Buck
  2010-04-15  9:59 ` Steffen Klassert
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Buck @ 2010-04-15  9:11 UTC (permalink / raw)
  To: Steffen Klassert, netdev; +Cc: linux-kernel

From: Martin Buck <mb-tmp-yvahk-argqri@gromit.dyndns.org>

Change the timer used for link status checking to check link every 5s,
regardless of the current link state. This way, link loss is detected as
fast as new link, whereas this took up to 60s previously (which is pretty
inconvenient when trying to react on link loss using e.g. ifplugd). This
also matches behaviour of most other Ethernet drivers which typically have
link check intervals in the low second range.

Signed-off-by: Martin Buck <mb-tmp-yvahk-argqri@gromit.dyndns.org>
---

--- linux-2.6.31.6/drivers/net/3c59x.c.orig	2010-04-13 17:46:07.000000000 +0200
+++ linux-2.6.31.6/drivers/net/3c59x.c	2010-04-13 17:55:31.000000000 +0200
@@ -1761,7 +1761,7 @@ vortex_timer(unsigned long data)
 	struct net_device *dev = (struct net_device *)data;
 	struct vortex_private *vp = netdev_priv(dev);
 	void __iomem *ioaddr = vp->ioaddr;
-	int next_tick = 60*HZ;
+	int next_tick = 5*HZ;
 	int ok = 0;
 	int media_status, old_window;
 
@@ -1807,9 +1807,6 @@ vortex_timer(unsigned long data)
 		ok = 1;
 	}
 
-	if (!netif_carrier_ok(dev))
-		next_tick = 5*HZ;
-
 	if (vp->medialock)
 		goto leave_media_alone;
 

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

* Re: [PATCH] Speedup link loss detection for 3c59x
  2010-04-15  9:11 [PATCH] Speedup link loss detection for 3c59x Martin Buck
@ 2010-04-15  9:59 ` Steffen Klassert
  0 siblings, 0 replies; 2+ messages in thread
From: Steffen Klassert @ 2010-04-15  9:59 UTC (permalink / raw)
  To: Martin Buck; +Cc: netdev, linux-kernel

On Thu, Apr 15, 2010 at 11:11:34AM +0200, Martin Buck wrote:
> From: Martin Buck <mb-tmp-yvahk-argqri@gromit.dyndns.org>
> 
> Change the timer used for link status checking to check link every 5s,
> regardless of the current link state. This way, link loss is detected as
> fast as new link, whereas this took up to 60s previously (which is pretty
> inconvenient when trying to react on link loss using e.g. ifplugd). This
> also matches behaviour of most other Ethernet drivers which typically have
> link check intervals in the low second range.
> 

We discussed this issue already some years ago. The 3c59x does polling
for external environment changes which is quite expensive. Firing a
timer that disables the interrupts on a running interface every 5
seconds is not reasonable for checking for external environment changes.
So we decided to let it depend on the link status, 5 seconds if the link
is down and 60 seconds if the link is up.

Steffen

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

end of thread, other threads:[~2010-04-15  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-15  9:11 [PATCH] Speedup link loss detection for 3c59x Martin Buck
2010-04-15  9:59 ` Steffen Klassert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox