* [U-Boot] [PATCH RFC] TFTP: allow for adjustable retransmission timout
@ 2009-10-21 8:57 Wolfgang Denk
2009-11-23 22:31 ` Wolfgang Denk
2010-01-17 22:55 ` [U-Boot] [PATCH] " Wolfgang Denk
0 siblings, 2 replies; 7+ messages in thread
From: Wolfgang Denk @ 2009-10-21 8:57 UTC (permalink / raw)
To: u-boot
So far, TFTP negotiated a fixed retransmission timeout of 5 seconds.
In some cases (busy networks, slow TFTP servers) this caused very
slow transfers. Add new environment variable "tftptimeout" allows to
set this timeout. Lowering this value may make downloads succeed
faster in networks with high packet loss rates or with unreliable
TFTP servers.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Ben Warren <biggerbadderben@gmail.com>
---
I'm not sure if this change is really a good thing. It seems to help
a lot in a test case I had here, but I'm not sure if the previous
timeout settings that also depended on TftpRRQTimeoutMSecs were
simply wrong (and not well tested - in myunderstanding they should
affect only the connection timeout, but not the packet retransmission
timeout), or if these are actually useful or needed in some
configurations. So far, TftpRRQTimeoutMSecs is used in
common/update.c only.
README | 19 ++++++++++++++++---
net/tftp.c | 22 +++++++++++++++++-----
2 files changed, 33 insertions(+), 8 deletions(-)
diff --git a/README b/README
index 744f6bf..18ca11f 100644
--- a/README
+++ b/README
@@ -2989,7 +2989,9 @@ environment. As long as you don't save the environment you are
working with an in-memory copy. In case the Flash area containing the
environment is erased by accident, a default environment is provided.
-Some configuration options can be set using Environment Variables:
+Some configuration options can be set using Environment Variables.
+
+List of environment variables (most likely not complete):
baudrate - see CONFIG_BAUDRATE
@@ -3101,7 +3103,7 @@ Some configuration options can be set using Environment Variables:
available network interfaces.
It just stays at the currently selected interface.
- netretry - When set to "no" each network operation will
+ netretry - When set to "no" each network operation will
either succeed or fail without retrying.
When set to "once" the network operation will
fail when all the available network interfaces
@@ -3117,7 +3119,18 @@ Some configuration options can be set using Environment Variables:
tftpdstport - If this is set, the value is used for TFTP's UDP
destination port instead of the Well Know Port 69.
- vlan - When set to a value < 4095 the traffic over
+ tftpblocksize - Block size to use for TFTP transfers; if not set,
+ we use the TFTP server's default block size
+
+ tftptimeout - Retransmission timeout for TFTP packets (in milli-
+ seconds, minimum value is 1000 = 1 second). Defines
+ when a packet is considered to be lost so it has to
+ be retransmitted. The default is 5000 = 5 seconds.
+ Lowering this value may make downloads succeed
+ faster in networks with high packet loss rates or
+ with unreliable TFTP servers.
+
+ vlan - When set to a value < 4095 the traffic over
Ethernet is encapsulated/received over 802.1q
VLAN tagged frames.
diff --git a/net/tftp.c b/net/tftp.c
index cc60a3b..f3ac54b 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -203,7 +203,7 @@ TftpSend (void)
pkt += 5 /*strlen("octet")*/ + 1;
strcpy ((char *)pkt, "timeout");
pkt += 7 /*strlen("timeout")*/ + 1;
- sprintf((char *)pkt, "%lu", TIMEOUT / 1000);
+ sprintf((char *)pkt, "%lu", TftpTimeoutMSecs / 1000);
debug("send option \"timeout %s\"\n", (char *)pkt);
pkt += strlen((char *)pkt) + 1;
#ifdef CONFIG_TFTP_TSIZE
@@ -405,7 +405,6 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
}
TftpLastBlock = TftpBlock;
- TftpTimeoutMSecs = TIMEOUT;
TftpTimeoutCountMax = TIMEOUT_COUNT;
NetSetTimeout (TftpTimeoutMSecs, TftpTimeout);
@@ -504,10 +503,24 @@ TftpStart (void)
{
char *ep; /* Environment pointer */
- /* Allow the user to choose tftpblocksize */
+ /*
+ * Allow the user to choose TFTP blocksize and timeout.
+ * TFTP protocol has a minimal timeout of 1 second.
+ */
if ((ep = getenv("tftpblocksize")) != NULL)
TftpBlkSizeOption = simple_strtol(ep, NULL, 10);
- debug("tftp block size is %i\n", TftpBlkSizeOption);
+
+ if ((ep = getenv("tftptimeout")) != NULL)
+ TftpTimeoutMSecs = simple_strtol(ep, NULL, 10);
+
+ if (TftpTimeoutMSecs < 1000) {
+ printf("TFTP timeout (%ld ms) too low, "
+ "set minimum = 1000 ms\n);
+ TftpTimeoutMSecs = 1000;
+ }
+
+ debug("TFTP blocksize = %i, timeout = %ld ms\n",
+ TftpBlkSizeOption, TftpTimeoutMSecs);
TftpServerIP = NetServerIP;
if (BootFile[0] == '\0') {
@@ -564,7 +577,6 @@ TftpStart (void)
puts ("Loading: *\b");
- TftpTimeoutMSecs = TftpRRQTimeoutMSecs;
TftpTimeoutCountMax = TftpRRQTimeoutCountMax;
NetSetTimeout (TftpTimeoutMSecs, TftpTimeout);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH RFC] TFTP: allow for adjustable retransmission timout
2009-10-21 8:57 [U-Boot] [PATCH RFC] TFTP: allow for adjustable retransmission timout Wolfgang Denk
@ 2009-11-23 22:31 ` Wolfgang Denk
2009-11-23 22:52 ` Ben Warren
2010-01-17 22:55 ` [U-Boot] [PATCH] " Wolfgang Denk
1 sibling, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2009-11-23 22:31 UTC (permalink / raw)
To: u-boot
Dear Ben,
In message <1256115432-31992-1-git-send-email-wd@denx.de> I wrote:
> So far, TFTP negotiated a fixed retransmission timeout of 5 seconds.
> In some cases (busy networks, slow TFTP servers) this caused very
> slow transfers. Add new environment variable "tftptimeout" allows to
> set this timeout. Lowering this value may make downloads succeed
> faster in networks with high packet loss rates or with unreliable
> TFTP servers.
>
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Ben Warren <biggerbadderben@gmail.com>
> ---
>
> I'm not sure if this change is really a good thing. It seems to help
> a lot in a test case I had here, but I'm not sure if the previous
> timeout settings that also depended on TftpRRQTimeoutMSecs were
> simply wrong (and not well tested - in myunderstanding they should
> affect only the connection timeout, but not the packet retransmission
> timeout), or if these are actually useful or needed in some
> configurations. So far, TftpRRQTimeoutMSecs is used in
> common/update.c only.
>
> README | 19 ++++++++++++++++---
> net/tftp.c | 22 +++++++++++++++++-----
> 2 files changed, 33 insertions(+), 8 deletions(-)
Any comment son that patch? Should I submit it for inclusion?
See http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/70097
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The biggest difference between time and space is that you can't reuse
time. - Merrick Furst
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH RFC] TFTP: allow for adjustable retransmission timout
2009-11-23 22:31 ` Wolfgang Denk
@ 2009-11-23 22:52 ` Ben Warren
0 siblings, 0 replies; 7+ messages in thread
From: Ben Warren @ 2009-11-23 22:52 UTC (permalink / raw)
To: u-boot
Hi Wolfgang,
Wolfgang Denk wrote:
> Dear Ben,
>
> In message <1256115432-31992-1-git-send-email-wd@denx.de> I wrote:
>
>> So far, TFTP negotiated a fixed retransmission timeout of 5 seconds.
>> In some cases (busy networks, slow TFTP servers) this caused very
>> slow transfers. Add new environment variable "tftptimeout" allows to
>> set this timeout. Lowering this value may make downloads succeed
>> faster in networks with high packet loss rates or with unreliable
>> TFTP servers.
>>
>> Signed-off-by: Wolfgang Denk <wd@denx.de>
>> Cc: Ben Warren <biggerbadderben@gmail.com>
>> ---
>>
>> I'm not sure if this change is really a good thing. It seems to help
>> a lot in a test case I had here, but I'm not sure if the previous
>> timeout settings that also depended on TftpRRQTimeoutMSecs were
>> simply wrong (and not well tested - in myunderstanding they should
>> affect only the connection timeout, but not the packet retransmission
>> timeout), or if these are actually useful or needed in some
>> configurations. So far, TftpRRQTimeoutMSecs is used in
>> common/update.c only.
>>
>> README | 19 ++++++++++++++++---
>> net/tftp.c | 22 +++++++++++++++++-----
>> 2 files changed, 33 insertions(+), 8 deletions(-)
>>
>
> Any comment son that patch? Should I submit it for inclusion?
>
> See http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/70097
>
> Best regards,
>
> Wolfgang Denk
>
>
I have a bunch of things in my 'for next' inbox that need to be
processed (as your e-mails indicate). I plan on going through them tonight.
regards,
Ben
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] TFTP: allow for adjustable retransmission timout
2009-10-21 8:57 [U-Boot] [PATCH RFC] TFTP: allow for adjustable retransmission timout Wolfgang Denk
2009-11-23 22:31 ` Wolfgang Denk
@ 2010-01-17 22:55 ` Wolfgang Denk
2010-03-11 22:44 ` Wolfgang Denk
1 sibling, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2010-01-17 22:55 UTC (permalink / raw)
To: u-boot
So far, TFTP negotiated a fixed retransmission timeout of 5 seconds.
In some cases (busy networks, slow TFTP servers) this caused very
slow transfers. Add new environment variable "tftptimeout" allows to
set this timeout. Lowering this value may make downloads succeed
faster in networks with high packet loss rates or with unreliable
TFTP servers.
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Ben Warren <biggerbadderben@gmail.com>
---
I submitted this patch for RFC in October, but never received any
feedback. Let's see if it goes in or gets rejected...
README | 19 ++++++++++++++++---
net/tftp.c | 22 +++++++++++++++++-----
2 files changed, 33 insertions(+), 8 deletions(-)
diff --git a/README b/README
index 22e35c3..13bad41 100644
--- a/README
+++ b/README
@@ -2982,7 +2982,9 @@ environment. As long as you don't save the environment you are
working with an in-memory copy. In case the Flash area containing the
environment is erased by accident, a default environment is provided.
-Some configuration options can be set using Environment Variables:
+Some configuration options can be set using Environment Variables.
+
+List of environment variables (most likely not complete):
baudrate - see CONFIG_BAUDRATE
@@ -3094,7 +3096,7 @@ Some configuration options can be set using Environment Variables:
available network interfaces.
It just stays at the currently selected interface.
- netretry - When set to "no" each network operation will
+ netretry - When set to "no" each network operation will
either succeed or fail without retrying.
When set to "once" the network operation will
fail when all the available network interfaces
@@ -3110,7 +3112,18 @@ Some configuration options can be set using Environment Variables:
tftpdstport - If this is set, the value is used for TFTP's UDP
destination port instead of the Well Know Port 69.
- vlan - When set to a value < 4095 the traffic over
+ tftpblocksize - Block size to use for TFTP transfers; if not set,
+ we use the TFTP server's default block size
+
+ tftptimeout - Retransmission timeout for TFTP packets (in milli-
+ seconds, minimum value is 1000 = 1 second). Defines
+ when a packet is considered to be lost so it has to
+ be retransmitted. The default is 5000 = 5 seconds.
+ Lowering this value may make downloads succeed
+ faster in networks with high packet loss rates or
+ with unreliable TFTP servers.
+
+ vlan - When set to a value < 4095 the traffic over
Ethernet is encapsulated/received over 802.1q
VLAN tagged frames.
diff --git a/net/tftp.c b/net/tftp.c
index a02463b..3f402d1 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -211,7 +211,7 @@ TftpSend (void)
pkt += 5 /*strlen("octet")*/ + 1;
strcpy ((char *)pkt, "timeout");
pkt += 7 /*strlen("timeout")*/ + 1;
- sprintf((char *)pkt, "%lu", TIMEOUT / 1000);
+ sprintf((char *)pkt, "%lu", TftpTimeoutMSecs / 1000);
debug("send option \"timeout %s\"\n", (char *)pkt);
pkt += strlen((char *)pkt) + 1;
#ifdef CONFIG_TFTP_TSIZE
@@ -413,7 +413,6 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
}
TftpLastBlock = TftpBlock;
- TftpTimeoutMSecs = TIMEOUT;
TftpTimeoutCountMax = TIMEOUT_COUNT;
NetSetTimeout (TftpTimeoutMSecs, TftpTimeout);
@@ -528,10 +527,24 @@ TftpStart (void)
{
char *ep; /* Environment pointer */
- /* Allow the user to choose tftpblocksize */
+ /*
+ * Allow the user to choose TFTP blocksize and timeout.
+ * TFTP protocol has a minimal timeout of 1 second.
+ */
if ((ep = getenv("tftpblocksize")) != NULL)
TftpBlkSizeOption = simple_strtol(ep, NULL, 10);
- debug("tftp block size is %i\n", TftpBlkSizeOption);
+
+ if ((ep = getenv("tftptimeout")) != NULL)
+ TftpTimeoutMSecs = simple_strtol(ep, NULL, 10);
+
+ if (TftpTimeoutMSecs < 1000) {
+ printf("TFTP timeout (%ld ms) too low, "
+ "set minimum = 1000 ms\n);
+ TftpTimeoutMSecs = 1000;
+ }
+
+ debug("TFTP blocksize = %i, timeout = %ld ms\n",
+ TftpBlkSizeOption, TftpTimeoutMSecs);
TftpServerIP = NetServerIP;
if (BootFile[0] == '\0') {
@@ -588,7 +601,6 @@ TftpStart (void)
puts ("Loading: *\b");
- TftpTimeoutMSecs = TftpRRQTimeoutMSecs;
TftpTimeoutCountMax = TftpRRQTimeoutCountMax;
NetSetTimeout (TftpTimeoutMSecs, TftpTimeout);
--
1.6.2.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] TFTP: allow for adjustable retransmission timout
2010-01-17 22:55 ` [U-Boot] [PATCH] " Wolfgang Denk
@ 2010-03-11 22:44 ` Wolfgang Denk
2010-03-11 23:08 ` Ben Warren
0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2010-03-11 22:44 UTC (permalink / raw)
To: u-boot
Dear Ben,
In message <1263768953-18819-1-git-send-email-wd@denx.de> I wrote:
> So far, TFTP negotiated a fixed retransmission timeout of 5 seconds.
> In some cases (busy networks, slow TFTP servers) this caused very
> slow transfers. Add new environment variable "tftptimeout" allows to
> set this timeout. Lowering this value may make downloads succeed
> faster in networks with high packet loss rates or with unreliable
> TFTP servers.
>
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Ben Warren <biggerbadderben@gmail.com>
> ---
> I submitted this patch for RFC in October, but never received any
> feedback. Let's see if it goes in or gets rejected...
>
> README | 19 ++++++++++++++++---
> net/tftp.c | 22 +++++++++++++++++-----
> 2 files changed, 33 insertions(+), 8 deletions(-)
>
> diff --git a/README b/README
> index 22e35c3..13bad41 100644
> --- a/README
> +++ b/README
> @@ -2982,7 +2982,9 @@ environment. As long as you don't save the environment you are
> working with an in-memory copy. In case the Flash area containing the
> environment is erased by accident, a default environment is provided.
>
> -Some configuration options can be set using Environment Variables:
> +Some configuration options can be set using Environment Variables.
> +
> +List of environment variables (most likely not complete):
>
> baudrate - see CONFIG_BAUDRATE
>
> @@ -3094,7 +3096,7 @@ Some configuration options can be set using Environment Variables:
> available network interfaces.
> It just stays at the currently selected interface.
>
> - netretry - When set to "no" each network operation will
> + netretry - When set to "no" each network operation will
> either succeed or fail without retrying.
> When set to "once" the network operation will
> fail when all the available network interfaces
> @@ -3110,7 +3112,18 @@ Some configuration options can be set using Environment Variables:
> tftpdstport - If this is set, the value is used for TFTP's UDP
> destination port instead of the Well Know Port 69.
>
> - vlan - When set to a value < 4095 the traffic over
> + tftpblocksize - Block size to use for TFTP transfers; if not set,
> + we use the TFTP server's default block size
> +
> + tftptimeout - Retransmission timeout for TFTP packets (in milli-
> + seconds, minimum value is 1000 = 1 second). Defines
> + when a packet is considered to be lost so it has to
> + be retransmitted. The default is 5000 = 5 seconds.
> + Lowering this value may make downloads succeed
> + faster in networks with high packet loss rates or
> + with unreliable TFTP servers.
> +
> + vlan - When set to a value < 4095 the traffic over
> Ethernet is encapsulated/received over 802.1q
> VLAN tagged frames.
>
> diff --git a/net/tftp.c b/net/tftp.c
> index a02463b..3f402d1 100644
> --- a/net/tftp.c
> +++ b/net/tftp.c
> @@ -211,7 +211,7 @@ TftpSend (void)
> pkt += 5 /*strlen("octet")*/ + 1;
> strcpy ((char *)pkt, "timeout");
> pkt += 7 /*strlen("timeout")*/ + 1;
> - sprintf((char *)pkt, "%lu", TIMEOUT / 1000);
> + sprintf((char *)pkt, "%lu", TftpTimeoutMSecs / 1000);
> debug("send option \"timeout %s\"\n", (char *)pkt);
> pkt += strlen((char *)pkt) + 1;
> #ifdef CONFIG_TFTP_TSIZE
> @@ -413,7 +413,6 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
> }
>
> TftpLastBlock = TftpBlock;
> - TftpTimeoutMSecs = TIMEOUT;
> TftpTimeoutCountMax = TIMEOUT_COUNT;
> NetSetTimeout (TftpTimeoutMSecs, TftpTimeout);
>
> @@ -528,10 +527,24 @@ TftpStart (void)
> {
> char *ep; /* Environment pointer */
>
> - /* Allow the user to choose tftpblocksize */
> + /*
> + * Allow the user to choose TFTP blocksize and timeout.
> + * TFTP protocol has a minimal timeout of 1 second.
> + */
> if ((ep = getenv("tftpblocksize")) != NULL)
> TftpBlkSizeOption = simple_strtol(ep, NULL, 10);
> - debug("tftp block size is %i\n", TftpBlkSizeOption);
> +
> + if ((ep = getenv("tftptimeout")) != NULL)
> + TftpTimeoutMSecs = simple_strtol(ep, NULL, 10);
> +
> + if (TftpTimeoutMSecs < 1000) {
> + printf("TFTP timeout (%ld ms) too low, "
> + "set minimum = 1000 ms\n);
> + TftpTimeoutMSecs = 1000;
> + }
> +
> + debug("TFTP blocksize = %i, timeout = %ld ms\n",
> + TftpBlkSizeOption, TftpTimeoutMSecs);
>
> TftpServerIP = NetServerIP;
> if (BootFile[0] == '\0') {
> @@ -588,7 +601,6 @@ TftpStart (void)
>
> puts ("Loading: *\b");
>
> - TftpTimeoutMSecs = TftpRRQTimeoutMSecs;
> TftpTimeoutCountMax = TftpRRQTimeoutCountMax;
>
> NetSetTimeout (TftpTimeoutMSecs, TftpTimeout);
> --
What's the status of this patch? Is it on your queue?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
They're usually so busy thinking about what happens next that the
only time they ever find out what is happening now is when they come
to look back on it. - Terry Pratchett, _Wyrd Sisters_
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] TFTP: allow for adjustable retransmission timout
2010-03-11 22:44 ` Wolfgang Denk
@ 2010-03-11 23:08 ` Ben Warren
2010-03-21 17:07 ` Wolfgang Denk
0 siblings, 1 reply; 7+ messages in thread
From: Ben Warren @ 2010-03-11 23:08 UTC (permalink / raw)
To: u-boot
Hi Wolfgang,
On 3/11/2010 2:44 PM, Wolfgang Denk wrote:
> Dear Ben,
>
> In message<1263768953-18819-1-git-send-email-wd@denx.de> I wrote:
>
>> So far, TFTP negotiated a fixed retransmission timeout of 5 seconds.
>> In some cases (busy networks, slow TFTP servers) this caused very
>> slow transfers. Add new environment variable "tftptimeout" allows to
>> set this timeout. Lowering this value may make downloads succeed
>> faster in networks with high packet loss rates or with unreliable
>> TFTP servers.
>>
>> Signed-off-by: Wolfgang Denk<wd@denx.de>
>> Cc: Ben Warren<biggerbadderben@gmail.com>
>> ---
>> I submitted this patch for RFC in October, but never received any
>> feedback. Let's see if it goes in or gets rejected...
>>
>> README | 19 ++++++++++++++++---
>> net/tftp.c | 22 +++++++++++++++++-----
>> 2 files changed, 33 insertions(+), 8 deletions(-)
>>
>> diff --git a/README b/README
>> index 22e35c3..13bad41 100644
>> --- a/README
>> +++ b/README
>> @@ -2982,7 +2982,9 @@ environment. As long as you don't save the environment you are
>> working with an in-memory copy. In case the Flash area containing the
>> environment is erased by accident, a default environment is provided.
>>
>> -Some configuration options can be set using Environment Variables:
>> +Some configuration options can be set using Environment Variables.
>> +
>> +List of environment variables (most likely not complete):
>>
>> baudrate - see CONFIG_BAUDRATE
>>
>> @@ -3094,7 +3096,7 @@ Some configuration options can be set using Environment Variables:
>> available network interfaces.
>> It just stays at the currently selected interface.
>>
>> - netretry - When set to "no" each network operation will
>> + netretry - When set to "no" each network operation will
>> either succeed or fail without retrying.
>> When set to "once" the network operation will
>> fail when all the available network interfaces
>> @@ -3110,7 +3112,18 @@ Some configuration options can be set using Environment Variables:
>> tftpdstport - If this is set, the value is used for TFTP's UDP
>> destination port instead of the Well Know Port 69.
>>
>> - vlan - When set to a value< 4095 the traffic over
>> + tftpblocksize - Block size to use for TFTP transfers; if not set,
>> + we use the TFTP server's default block size
>> +
>> + tftptimeout - Retransmission timeout for TFTP packets (in milli-
>> + seconds, minimum value is 1000 = 1 second). Defines
>> + when a packet is considered to be lost so it has to
>> + be retransmitted. The default is 5000 = 5 seconds.
>> + Lowering this value may make downloads succeed
>> + faster in networks with high packet loss rates or
>> + with unreliable TFTP servers.
>> +
>> + vlan - When set to a value< 4095 the traffic over
>> Ethernet is encapsulated/received over 802.1q
>> VLAN tagged frames.
>>
>> diff --git a/net/tftp.c b/net/tftp.c
>> index a02463b..3f402d1 100644
>> --- a/net/tftp.c
>> +++ b/net/tftp.c
>> @@ -211,7 +211,7 @@ TftpSend (void)
>> pkt += 5 /*strlen("octet")*/ + 1;
>> strcpy ((char *)pkt, "timeout");
>> pkt += 7 /*strlen("timeout")*/ + 1;
>> - sprintf((char *)pkt, "%lu", TIMEOUT / 1000);
>> + sprintf((char *)pkt, "%lu", TftpTimeoutMSecs / 1000);
>> debug("send option \"timeout %s\"\n", (char *)pkt);
>> pkt += strlen((char *)pkt) + 1;
>> #ifdef CONFIG_TFTP_TSIZE
>> @@ -413,7 +413,6 @@ TftpHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
>> }
>>
>> TftpLastBlock = TftpBlock;
>> - TftpTimeoutMSecs = TIMEOUT;
>> TftpTimeoutCountMax = TIMEOUT_COUNT;
>> NetSetTimeout (TftpTimeoutMSecs, TftpTimeout);
>>
>> @@ -528,10 +527,24 @@ TftpStart (void)
>> {
>> char *ep; /* Environment pointer */
>>
>> - /* Allow the user to choose tftpblocksize */
>> + /*
>> + * Allow the user to choose TFTP blocksize and timeout.
>> + * TFTP protocol has a minimal timeout of 1 second.
>> + */
>> if ((ep = getenv("tftpblocksize")) != NULL)
>> TftpBlkSizeOption = simple_strtol(ep, NULL, 10);
>> - debug("tftp block size is %i\n", TftpBlkSizeOption);
>> +
>> + if ((ep = getenv("tftptimeout")) != NULL)
>> + TftpTimeoutMSecs = simple_strtol(ep, NULL, 10);
>> +
>> + if (TftpTimeoutMSecs< 1000) {
>> + printf("TFTP timeout (%ld ms) too low, "
>> + "set minimum = 1000 ms\n);
>> + TftpTimeoutMSecs = 1000;
>> + }
>> +
>> + debug("TFTP blocksize = %i, timeout = %ld ms\n",
>> + TftpBlkSizeOption, TftpTimeoutMSecs);
>>
>> TftpServerIP = NetServerIP;
>> if (BootFile[0] == '\0') {
>> @@ -588,7 +601,6 @@ TftpStart (void)
>>
>> puts ("Loading: *\b");
>>
>> - TftpTimeoutMSecs = TftpRRQTimeoutMSecs;
>> TftpTimeoutCountMax = TftpRRQTimeoutCountMax;
>>
>> NetSetTimeout (TftpTimeoutMSecs, TftpTimeout);
>> --
>>
> What's the status of this patch? Is it on your queue?
>
So sorry - I thought I'd already taken care of this. Please feel free
to add my SOB and apply directly.
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
regards,
Ben
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] TFTP: allow for adjustable retransmission timout
2010-03-11 23:08 ` Ben Warren
@ 2010-03-21 17:07 ` Wolfgang Denk
0 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2010-03-21 17:07 UTC (permalink / raw)
To: u-boot
Dear Ben,
In message <4B9977EB.7020702@gmail.com> you wrote:
>
> > What's the status of this patch? Is it on your queue?
> >
> So sorry - I thought I'd already taken care of this. Please feel free
> to add my SOB and apply directly.
>
> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Done, thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Every time history repeats itself the price goes up.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-03-21 17:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-21 8:57 [U-Boot] [PATCH RFC] TFTP: allow for adjustable retransmission timout Wolfgang Denk
2009-11-23 22:31 ` Wolfgang Denk
2009-11-23 22:52 ` Ben Warren
2010-01-17 22:55 ` [U-Boot] [PATCH] " Wolfgang Denk
2010-03-11 22:44 ` Wolfgang Denk
2010-03-11 23:08 ` Ben Warren
2010-03-21 17:07 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox