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>
This commit is contained in:
		
							parent
							
								
									8d77576371
								
							
						
					
					
						commit
						620776d734
					
				
							
								
								
									
										10
									
								
								net/tftp.c
								
								
								
								
							
							
						
						
									
										10
									
								
								net/tftp.c
								
								
								
								
							|  | @ -19,10 +19,10 @@ | ||||||
| /* Well known TFTP port # */ | /* Well known TFTP port # */ | ||||||
| #define WELL_KNOWN_PORT	69 | #define WELL_KNOWN_PORT	69 | ||||||
| /* Millisecs to timeout for lost pkt */ | /* Millisecs to timeout for lost pkt */ | ||||||
| #define TIMEOUT		5000UL | #define TIMEOUT		100UL | ||||||
| #ifndef	CONFIG_NET_RETRY_COUNT | #ifndef	CONFIG_NET_RETRY_COUNT | ||||||
| /* # of timeouts before giving up */ | /* # of timeouts before giving up */ | ||||||
| # define TIMEOUT_COUNT	10 | # define TIMEOUT_COUNT	1000 | ||||||
| #else | #else | ||||||
| # define TIMEOUT_COUNT  (CONFIG_NET_RETRY_COUNT * 2) | # define TIMEOUT_COUNT  (CONFIG_NET_RETRY_COUNT * 2) | ||||||
| #endif | #endif | ||||||
|  | @ -711,10 +711,10 @@ void tftp_start(enum proto_t protocol) | ||||||
| 	if (ep != NULL) | 	if (ep != NULL) | ||||||
| 		timeout_ms = simple_strtol(ep, NULL, 10); | 		timeout_ms = simple_strtol(ep, NULL, 10); | ||||||
| 
 | 
 | ||||||
| 	if (timeout_ms < 1000) { | 	if (timeout_ms < 10) { | ||||||
| 		printf("TFTP timeout (%ld ms) too low, set min = 1000 ms\n", | 		printf("TFTP timeout (%ld ms) too low, set min = 10 ms\n", | ||||||
| 		       timeout_ms); | 		       timeout_ms); | ||||||
| 		timeout_ms = 1000; | 		timeout_ms = 10; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	debug("TFTP blocksize = %i, timeout = %ld ms\n", | 	debug("TFTP blocksize = %i, timeout = %ld ms\n", | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue