
I'd like to have a boot cmd which says
"if my test server is there, download uImage from it, otherwise boot from the MMC card."
I can do that by starting with a ping, and waiting for it to fail, but it takes 10 seconds, which is way too much to add to the normal boot process.
The timeout appears to be set by a line in net.h reading
NetSetTimeout (10UL * CFG_HZ, PingTimeout);
Questions then:
Is there a better way to quickly check for the presence of a server? Actually trying TFTP seems to take even longer.
Would it be a good enhancement to u-boot to have an environment variable which changes the ping timeout when it exists?
David Collier
www.dexdyne.com

Dear "David Collier",
In message <memo.20091023095245.2092G@postmaster+dexdyne.com.cix.co.uk> you wrote:
Is there a better way to quickly check for the presence of a server?
Yes.
Actually trying TFTP seems to take even longer.
No, if you configure it correctly.
Would it be a good enhancement to u-boot to have an environment variable which changes the ping timeout when it exists?
Ping is not really useful. It may tell you that some machine is up and running, but it will not tell you if there is any TFTP service running on it. If you want to test for TFTP, then test for TFTP and not for something unrelated.
See envrionment variable "netretry" (README) and variables TftpRRQTimeoutMSecs and TftpRRQTimeoutCountMax (net/tftp.c and common/update.c) for tuning TFTP connection behaviour and timeouts.
Best regards,
Wolfgang Denk

Is there a better way to quickly check for the presence of a server?
Yes.
Actually trying TFTP seems to take even longer.
No, if you configure it correctly.
OK - I see your comments and understand them.
But there's a difference between "is the server there" and "please TFTP from it - and the timeouts for one are not the same as the timeout for another.
If the server is present, I'm happy to use relaxed timeouts for the actual transfer.
But I'd like a quicker way of just checking whether I'm on the "production test network" or in a user site in the field.
So I'm still in favour of a separate time-out for ping.
David
Would it be a good enhancement to u-boot to have an environment variable which changes the ping timeout when it exists?
Ping is not really useful. It may tell you that some machine is up and running, but it will not tell you if there is any TFTP service running on it. If you want to test for TFTP, then test for TFTP and not for something unrelated.
See envrionment variable "netretry" (README) and variables TftpRRQTimeoutMSecs and TftpRRQTimeoutCountMax (net/tftp.c and common/update.c) for tuning TFTP connection behaviour and timeouts.
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@denx.de The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense. - E. W. Dijkstra
David Collier
www.dexdyne.com

Dear "David Collier",
In message <memo.20091023110946.2092M@postmaster+dexdyne.com.cix.co.uk> you wrote:
But there's a difference between "is the server there" and "please TFTP from it - and the timeouts for one are not the same as the timeout for another.
But with a ping you do NOT check if the (TFTP) server is there. All you check if the host is up and running. Eventually there is no TFTP server running on it.
If the server is present, I'm happy to use relaxed timeouts for the actual transfer.
Then test with a short-timeout TFTP request, and if this fails becoause of other reasons than "server not responding" then retry with longer timeouts. Feel free to define your own policy.
But I'd like a quicker way of just checking whether I'm on the "production test network" or in a user site in the field.
I don't see why that would be not possible or even difficult with the current code.
Best regards,
Wolfgang Denk
participants (2)
-
David Collier
-
Wolfgang Denk