Commit 620776d734e4b126c407f636bda825a594a17723

Authored by Pavel Machek
Committed by Joe Hershberger
1 parent 8d77576371

tftp: adjust settings to be suitable for 100Mbit ethernet

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>

Showing 1 changed file with 5 additions and 5 deletions Side-by-side Diff

... ... @@ -19,10 +19,10 @@
19 19 /* Well known TFTP port # */
20 20 #define WELL_KNOWN_PORT 69
21 21 /* Millisecs to timeout for lost pkt */
22   -#define TIMEOUT 5000UL
  22 +#define TIMEOUT 100UL
23 23 #ifndef CONFIG_NET_RETRY_COUNT
24 24 /* # of timeouts before giving up */
25   -# define TIMEOUT_COUNT 10
  25 +# define TIMEOUT_COUNT 1000
26 26 #else
27 27 # define TIMEOUT_COUNT (CONFIG_NET_RETRY_COUNT * 2)
28 28 #endif
29 29  
... ... @@ -711,10 +711,10 @@
711 711 if (ep != NULL)
712 712 timeout_ms = simple_strtol(ep, NULL, 10);
713 713  
714   - if (timeout_ms < 1000) {
715   - printf("TFTP timeout (%ld ms) too low, set min = 1000 ms\n",
  714 + if (timeout_ms < 10) {
  715 + printf("TFTP timeout (%ld ms) too low, set min = 10 ms\n",
716 716 timeout_ms);
717   - timeout_ms = 1000;
  717 + timeout_ms = 10;
718 718 }
719 719  
720 720 debug("TFTP blocksize = %i, timeout = %ld ms\n",