u-boot/net
Stephen Warren f59be6e850 net: BOOTP retry timeout improvements
Currently, the BOOTP code sends out its initial request as soon as the
Ethernet driver indicates "link up". If this packet is lost or not
replied to for some reason, the code waits for a 1s timeout before
retrying. For some reason, such early packets are often lost on my
system, so this causes an annoying delay.

To optimize this, modify the BOOTP code to have very short timeouts for
the first packet transmitted, but gradually increase the timeout each
time a timeout occurs. This way, if the first packet is lost, the second
packet is transmitted quite quickly and hence the overall delay is low.
However, if there's still no response, we don't keep spewing out packets
at an insane speed.

It's arguably more correct to try and find out why the first packet is
lost. However, it seems to disappear inside my Ethenet chip; the TX chip
indicates no error during TX (not that it has much in the way of
reporting...), yet wireshark on the RX side doesn't see any packet.
FWIW, I'm using an ASIX USB Ethernet adapter. Perhaps "link up" is
reported too early or based on the wrong condition in HW, and we should
add some fixed extra delay into the driver. However, this would slow down
every link up event even if it ends up not being needed in some cases.
Having BOOTP retry quickly applies the fix/WAR to every possible
Ethernet device, and is quite simple to implement, so seems a better
solution.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2014-08-09 11:17:03 -04:00
..
arp.c net/: sparse fixes 2012-11-04 11:00:36 -07:00
arp.h net: Separate ArpRequest() into lower-level func 2012-05-23 17:53:07 -05:00
bootp.c net: BOOTP retry timeout improvements 2014-08-09 11:17:03 -04:00
bootp.h net: BOOTP retry timeout improvements 2014-08-09 11:17:03 -04:00
cdp.c net: Refactor to separate the UDP handler from the ARP handler 2012-05-23 17:52:53 -05:00
cdp.h net: cosmetic: Rename CDPHandler to cdp_receive 2012-05-23 17:46:16 -05:00
dns.c net: Refactor to separate the UDP handler from the ARP handler 2012-05-23 17:52:53 -05:00
dns.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
eth.c Ethernet: let user know if there is no valid ethernet address 2014-07-22 07:44:28 -04:00
link_local.c net: Correct check for link-local target IP conflict 2013-06-24 19:11:13 -05:00
link_local.h net: Add link-local addressing support 2012-05-23 17:53:08 -05:00
Makefile kbuild: use Linux Kernel build scripts 2014-02-19 11:07:50 -05:00
net.c net: BOOTP retry timeout improvements 2014-08-09 11:17:03 -04:00
net_rand.h net: use common rand()/srand() functions 2012-07-07 14:07:32 +02:00
nfs.c net: nfs: add dynamic wait period 2013-06-24 19:10:15 -05:00
nfs.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
ping.c net: Allow filtering on debug traces in the net subsystem 2012-05-23 17:53:08 -05:00
ping.h net/: sparse fixes 2012-11-04 11:00:36 -07:00
rarp.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
rarp.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
sntp.c net: Refactor to separate the UDP handler from the ARP handler 2012-05-23 17:52:53 -05:00
sntp.h Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
tftp.c net: tftpsrv: Get correct client MAC address 2013-11-22 17:03:18 -06:00
tftp.h net/: sparse fixes 2012-11-04 11:00:36 -07:00