Skip to contentSkip to conversation

net: ipv4: ipconfig: decrease CONF_CARRIER_TIMEOUT

RFC PATCH In review Christian Hemp 3 participants 3 messages May 2, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 net: ipv4: ipconfig: decrease CONF_CARRIER_TIMEOUT

A timeout of two minutes is pretty anoying if _no_ ethernet cable is attached by purpose. This patch decreases the timeout of CONF_CARRIER_TIMEOUT to an accaptable value of 10 secounds.

---
 net/ipv4/ipconfig.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv4/ipconfig.c +1 -1
index 99ec116..2aa80ac 100644
@@ -89,7 +89,7 @@
 
 /* Define the friendly delay before and after opening net devices */
 #define CONF_POST_OPEN		10	/* After opening: 10 msecs */
-#define CONF_CARRIER_TIMEOUT	120000	/* Wait for carrier timeout */
+#define CONF_CARRIER_TIMEOUT	1000	/* Wait for carrier timeout */
 
 /* Define the timeout for waiting for a DHCP/BOOTP/RARP reply */
 #define CONF_OPEN_RETRIES 	2	/* (Re)open devices twice */
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 5 lines

A timeout of two minutes is pretty anoying if _no_ ethernet cable is attached by purpose. This patch decreases the timeout of CONF_CARRIER_TIMEOUT to an accaptable value of 10 secounds.

...

net/ipv4/ipconfig.c line 92

Quoted 6 lines

/* Define the friendly delay before and after opening net devices */
#define CONF_POST_OPEN 10 /* After
opening: 10 msecs */

net/ipv4/ipconfig.c +1 -1
-#define CONF_CARRIER_TIMEOUT	120000	/* Wait for carrier timeout */
+#define CONF_CARRIER_TIMEOUT	1000	/* Wait for carrier timeout */

Doesn't that reduce it to 1 second!

I'm also not all sure how long it might take.
I'm sure there are some switches/routers that can take quite a while do negotiate the link.
Usually noticed when dhcp takes links down and up as it assigns an address.

David

maintainer
#2 lore raw
In reply to Christian Hemp

From: Christian Hemp <[email protected]>
Date: Wed, 2 May 2012 17:24:19 +0200

Quoted 5 lines

A timeout of two minutes is pretty anoying if _no_ ethernet cable is attached by purpose. This patch decreases the timeout of CONF_CARRIER_TIMEOUT to an accaptable value of 10 secounds.

It was increased to 2 minutes intentionally, therefore you better go look into the history of why this was done and you better explain in your commit message why those issues don't matter.

Otherwise your patch will be completely ignored.