All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] Allow change timing values to wait slow devices bring up  before try register an interface to IP-Config
@ 2010-02-10  3:44 Tiago Maluta
  2010-02-10  7:01 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Tiago Maluta @ 2010-02-10  3:44 UTC (permalink / raw)
  To: linux-net, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 233 bytes --]

I had some problems with 'slow' net devices when ic_open_devs() try to
search for interfaces before they are registered. The solution was
change some timing values. I propose this patch to allow user change
this on menuconfig.

--tm

[-- Attachment #2: 0001-Allow-change-timing-values-to-wait-slow-devices-brin.patch --]
[-- Type: application/octet-stream, Size: 2246 bytes --]

From e414000eed1a951bf03f125f5307bc1edffcecf1 Mon Sep 17 00:00:00 2001
From: Tiago Maluta <maluta@unifei.edu.br>
Date: Wed, 10 Feb 2010 03:34:49 +0000
Subject: [RFC][PATCH] Allow change timing values to wait slow devices bring up before try register an interface
 to IP-Config (used on some drivers using Multi-purpose USB Networking Framework)


Signed-off-by: Tiago Maluta <maluta@unifei.edu.br>
---
 drivers/net/Kconfig |   18 ++++++++++++++++++
 net/ipv4/ipconfig.c |    4 ++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index dd9a09c..12fbe4a 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -38,6 +38,24 @@ config IFB
 	  'ifb1' etc.
 	  Look at the iproute2 documentation directory for usage etc
 
+config NETDEVICES_DELAY_PRE_OPEN
+	int "Define the delay before opening net devices (ms)"
+	depends on NETDEVICES
+	default 500
+	help
+	    Some devices may not work properly due to a delay from hardware bring
+	    the interface up. This value add a delay, in miilliseconds, before
+	    kernel search and register the interface. Default value is 500ms.
+
+config NETDEVICES_DELAY_POST_OPEN
+	int "Define the delay after opening net devices (s)"
+	depends on NETDEVICES
+	default 1
+	help
+	    Some devices may not work properly due to a delay from hardware bring
+	    the interface up. This value add a delay, in seconds, after
+	    kernel search and register the interface. Default value is 1s.
+
 config DUMMY
 	tristate "Dummy net driver support"
 	---help---
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 10a6a60..2530126 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -86,8 +86,8 @@
 #endif
 
 /* Define the friendly delay before and after opening net devices */
-#define CONF_PRE_OPEN		500	/* Before opening: 1/2 second */
-#define CONF_POST_OPEN		1	/* After opening: 1 second */
+#define CONF_PRE_OPEN		CONFIG_NETDEVICES_DELAY_PRE_OPEN	/* Before opening. Default is 1/2 second */
+#define CONF_POST_OPEN		CONFIG_NETDEVICES_DELAY_POST_OPEN	/* After opening. Default is 1 second */
 
 /* Define the timeout for waiting for a DHCP/BOOTP/RARP reply */
 #define CONF_OPEN_RETRIES 	2	/* (Re)open devices twice */
-- 
1.6.4.2


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

* [RFC][PATCH] Allow change timing values to wait slow devices bring up  before try register an interface to IP-Config
@ 2010-02-10  3:47 Tiago Maluta
  2010-02-10  5:51 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Tiago Maluta @ 2010-02-10  3:47 UTC (permalink / raw)
  To: linux-net, linux-kernel

Sorry for previous attached patch in email.

--tm


>From e414000eed1a951bf03f125f5307bc1edffcecf1 Mon Sep 17 00:00:00 2001
From: Tiago Maluta <maluta@unifei.edu.br>
Date: Wed, 10 Feb 2010 03:34:49 +0000
Subject: [RFC][PATCH] Allow change timing values to wait slow devices
bring up before try register an interface
 to IP-Config (used on some drivers using Multi-purpose USB Networking
Framework)


Signed-off-by: Tiago Maluta <maluta@unifei.edu.br>
---
 drivers/net/Kconfig |   18 ++++++++++++++++++
 net/ipv4/ipconfig.c |    4 ++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index dd9a09c..12fbe4a 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -38,6 +38,24 @@ config IFB
 	  'ifb1' etc.
 	  Look at the iproute2 documentation directory for usage etc

+config NETDEVICES_DELAY_PRE_OPEN
+	int "Define the delay before opening net devices (ms)"
+	depends on NETDEVICES
+	default 500
+	help
+	    Some devices may not work properly due to a delay from hardware bring
+	    the interface up. This value add a delay, in miilliseconds, before
+	    kernel search and register the interface. Default value is 500ms.
+
+config NETDEVICES_DELAY_POST_OPEN
+	int "Define the delay after opening net devices (s)"
+	depends on NETDEVICES
+	default 1
+	help
+	    Some devices may not work properly due to a delay from hardware bring
+	    the interface up. This value add a delay, in seconds, after
+	    kernel search and register the interface. Default value is 1s.
+
 config DUMMY
 	tristate "Dummy net driver support"
 	---help---
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 10a6a60..2530126 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -86,8 +86,8 @@
 #endif

 /* Define the friendly delay before and after opening net devices */
-#define CONF_PRE_OPEN		500	/* Before opening: 1/2 second */
-#define CONF_POST_OPEN		1	/* After opening: 1 second */
+#define CONF_PRE_OPEN		CONFIG_NETDEVICES_DELAY_PRE_OPEN	/* Before
opening. Default is 1/2 second */
+#define CONF_POST_OPEN		CONFIG_NETDEVICES_DELAY_POST_OPEN	/* After
opening. Default is 1 second */

 /* Define the timeout for waiting for a DHCP/BOOTP/RARP reply */
 #define CONF_OPEN_RETRIES 	2	/* (Re)open devices twice */
-- 
1.6.4.2

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

* Re: [RFC][PATCH] Allow change timing values to wait slow devices bring up  before try register an interface to IP-Config
  2010-02-10  3:47 [RFC][PATCH] Allow change timing values to wait slow devices bring up before try register an interface to IP-Config Tiago Maluta
@ 2010-02-10  5:51 ` Andrew Morton
  2010-02-10  7:04   ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2010-02-10  5:51 UTC (permalink / raw)
  To: Tiago Maluta; +Cc: linux-net, linux-kernel, netdev


On Wed, 10 Feb 2010 03:47:59 +0000 Tiago Maluta <tiago.maluta@gmail.com> wrote:
>
> 

Please cc netdev@vger.kernel.org on net patches - linux-net@vger is not
used for development.

> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index dd9a09c..12fbe4a 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -38,6 +38,24 @@ config IFB
>  	  'ifb1' etc.
>  	  Look at the iproute2 documentation directory for usage etc
> 
> +config NETDEVICES_DELAY_PRE_OPEN
> +	int "Define the delay before opening net devices (ms)"
> +	depends on NETDEVICES
> +	default 500
> +	help
> +	    Some devices may not work properly due to a delay from hardware bring
> +	    the interface up. This value add a delay, in miilliseconds, before

typo.

> +	    kernel search and register the interface. Default value is 500ms.
> +
> +config NETDEVICES_DELAY_POST_OPEN
> +	int "Define the delay after opening net devices (s)"
> +	depends on NETDEVICES
> +	default 1
> +	help
> +	    Some devices may not work properly due to a delay from hardware bring
> +	    the interface up. This value add a delay, in seconds, after
> +	    kernel search and register the interface. Default value is 1s.
> +
>  config DUMMY
>  	tristate "Dummy net driver support"
>  	---help---
> diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
> index 10a6a60..2530126 100644
> --- a/net/ipv4/ipconfig.c
> +++ b/net/ipv4/ipconfig.c
> @@ -86,8 +86,8 @@
>  #endif
> 
>  /* Define the friendly delay before and after opening net devices */
> -#define CONF_PRE_OPEN		500	/* Before opening: 1/2 second */
> -#define CONF_POST_OPEN		1	/* After opening: 1 second */
> +#define CONF_PRE_OPEN		CONFIG_NETDEVICES_DELAY_PRE_OPEN	/* Before
> opening. Default is 1/2 second */
> +#define CONF_POST_OPEN		CONFIG_NETDEVICES_DELAY_POST_OPEN	/* After
> opening. Default is 1 second */

Your email client wordwrapped this.

Using delays was dumb of us, but I guess the problem is difficult.

It would be much better to configure this delay at runtime rather than
at compile time.  Perhaps with new kernel boot parameters, perhaps by
extending the ip= argument.



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

* Re: [RFC][PATCH] Allow change timing values to wait slow devices bring up before try register an interface to IP-Config
  2010-02-10  3:44 Tiago Maluta
@ 2010-02-10  7:01 ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2010-02-10  7:01 UTC (permalink / raw)
  To: tiago.maluta; +Cc: linux-net, netdev, linux-kernel

From: Tiago Maluta <tiago.maluta@gmail.com>
Date: Wed, 10 Feb 2010 03:44:50 +0000

> I had some problems with 'slow' net devices when ic_open_devs() try to
> search for interfaces before they are registered. The solution was
> change some timing values. I propose this patch to allow user change
> this on menuconfig.

First, please use plain text attachments when posting patches.

Second, please use netdev@vger.kernel.org for reaching the
networking developers.  linux-net is for user questions only.

Lastly, others have hit this issue before, and config options
and kernel command line options are prone to failure and
hard for casual users to discover.  For one example thread
on this topic see:

http://marc.info/?l=linux-netdev&m=126319430325919&w=2

Better is just to change the defaults to higher values and
I'd like to hear some suggestions from people hitting this issue.

Thanks.

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

* Re: [RFC][PATCH] Allow change timing values to wait slow devices bring up before try register an interface to IP-Config
  2010-02-10  5:51 ` Andrew Morton
@ 2010-02-10  7:04   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2010-02-10  7:04 UTC (permalink / raw)
  To: akpm; +Cc: tiago.maluta, linux-net, linux-kernel, netdev

From: Andrew Morton <akpm@linux-foundation.org>
Date: Tue, 9 Feb 2010 21:51:20 -0800

> Using delays was dumb of us, but I guess the problem is difficult.
> 
> It would be much better to configure this delay at runtime rather than
> at compile time.  Perhaps with new kernel boot parameters, perhaps by
> extending the ip= argument.

Old topic, see the thread at:

http://marc.info/?l=linux-netdev&m=126311212608318&w=2

I would prefer to just jack up the defaults a bit.

My opinion is that just about any larger default value is reasonable,
because if you enable IP autoconfig on the command line, you expect
the link and device to be there and waiting a few extra seconds won't
bother you.

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

end of thread, other threads:[~2010-02-10  7:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-10  3:47 [RFC][PATCH] Allow change timing values to wait slow devices bring up before try register an interface to IP-Config Tiago Maluta
2010-02-10  5:51 ` Andrew Morton
2010-02-10  7:04   ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2010-02-10  3:44 Tiago Maluta
2010-02-10  7:01 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.