public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] tftp: adjust settings to be suitable for 100Mbit ethernet
@ 2015-08-18 12:34 Pavel Machek
  2015-08-21 21:19 ` Joe Hershberger
  2015-08-24 14:48 ` Joe Hershberger
  0 siblings, 2 replies; 3+ messages in thread
From: Pavel Machek @ 2015-08-18 12:34 UTC (permalink / raw)
  To: u-boot


Adjust timouts and retry counts to be suitable for loaded ethernet
network. With 5 seconds timeout, 10 retries maximum, tftp is
impossible even on local network with single full-speed TCP
connection.

100msec timeout should be suitable for most networks tftp is used on,
that is local ethernets. Timeout count really needs to be way higher,
as lost packets are normal when TCP is running over the same network.

Enforce 10msec minimum. 

Signed-off-by: Pavel Machek <pavel@denx.de>

diff --git a/net/tftp.c b/net/tftp.c
index 0a2c533..c5ea3f2 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -18,10 +18,10 @@
 /* Well known TFTP port # */
 #define WELL_KNOWN_PORT	69
 /* Millisecs to timeout for lost pkt */
-#define TIMEOUT		5000UL
+#define TIMEOUT		100UL
 #ifndef	CONFIG_NET_RETRY_COUNT
 /* # of timeouts before giving up */
-# define TIMEOUT_COUNT	10
+# define TIMEOUT_COUNT	1000
 #else
 # define TIMEOUT_COUNT  (CONFIG_NET_RETRY_COUNT * 2)
 #endif
@@ -703,11 +703,11 @@ void TftpStart(enum proto_t protocol)
 	if (ep != NULL)
 		TftpTimeoutMSecs = simple_strtol(ep, NULL, 10);
 
-	if (TftpTimeoutMSecs < 1000) {
+	if (TftpTimeoutMSecs < 10) {
 		printf("TFTP timeout (%ld ms) too low, "
-			"set minimum = 1000 ms\n",
+			"set minimum = 10 ms\n",
 			TftpTimeoutMSecs);
-		TftpTimeoutMSecs = 1000;
+		TftpTimeoutMSecs = 10;
 	}
 
 	debug("TFTP blocksize = %i, timeout = %ld ms\n",

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* [U-Boot] [PATCH] tftp: adjust settings to be suitable for 100Mbit ethernet
  2015-08-18 12:34 [U-Boot] [PATCH] tftp: adjust settings to be suitable for 100Mbit ethernet Pavel Machek
@ 2015-08-21 21:19 ` Joe Hershberger
  2015-08-24 14:48 ` Joe Hershberger
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Hershberger @ 2015-08-21 21:19 UTC (permalink / raw)
  To: u-boot

Hi Pavel,

On Tue, Aug 18, 2015 at 7:34 AM, Pavel Machek <pavel@denx.de> wrote:
>
> Adjust timouts and retry counts to be suitable for loaded ethernet
> network. With 5 seconds timeout, 10 retries maximum, tftp is
> impossible even on local network with single full-speed TCP
> connection.
>
> 100msec timeout should be suitable for most networks tftp is used on,
> that is local ethernets. Timeout count really needs to be way higher,
> as lost packets are normal when TCP is running over the same network.
>
> Enforce 10msec minimum.
>
> Signed-off-by: Pavel Machek <pavel@denx.de>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>

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

* [U-Boot] [PATCH] tftp: adjust settings to be suitable for 100Mbit ethernet
  2015-08-18 12:34 [U-Boot] [PATCH] tftp: adjust settings to be suitable for 100Mbit ethernet Pavel Machek
  2015-08-21 21:19 ` Joe Hershberger
@ 2015-08-24 14:48 ` Joe Hershberger
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Hershberger @ 2015-08-24 14:48 UTC (permalink / raw)
  To: u-boot

On Tue, Aug 18, 2015 at 7:34 AM, Pavel Machek <pavel@denx.de> wrote:
>
> Adjust timouts and retry counts to be suitable for loaded ethernet
> network. With 5 seconds timeout, 10 retries maximum, tftp is
> impossible even on local network with single full-speed TCP
> connection.
>
> 100msec timeout should be suitable for most networks tftp is used on,
> that is local ethernets. Timeout count really needs to be way higher,
> as lost packets are normal when TCP is running over the same network.
>
> Enforce 10msec minimum.
>
> Signed-off-by: Pavel Machek <pavel@denx.de>

Applied to u-boot-net, thanks!
-Joe

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

end of thread, other threads:[~2015-08-24 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-18 12:34 [U-Boot] [PATCH] tftp: adjust settings to be suitable for 100Mbit ethernet Pavel Machek
2015-08-21 21:19 ` Joe Hershberger
2015-08-24 14:48 ` Joe Hershberger

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