1
0
Fork 0
remarkable-uboot/net
Thierry Reding 92ac8acc01 net: More BOOTP retry timeout improvements
It's not unusual for DHCP servers to take a couple hundred milliseconds
to respond to DHCP discover messages. One possible reason for the delay
can be that the server checks (typically using an ARP request) that the
IP it's about to hand out isn't in use yet. To make matters worse, some
servers may also queue up requests and process them sequentially, which
can cause excessively long delays if clients retry too fast.

Commit f59be6e850 ("net: BOOTP retry timeout improvements") shortened
the retry timeouts significantly, but the BOOTP/DHCP implementation in
U-Boot doesn't handle that well because it will ignore incoming replies
to earlier requests. In one particular setup this increases the time it
takes to obtain a DHCP lease from 630 ms to 8313 ms.

This commit attempts to fix this in two ways. First it increases the
initial retry timeout from 10 ms to 250 ms to give DHCP servers some
more time to respond. At the same time a cache of outstanding DHCP
request IDs is kept so that the implementation will know to continue
transactions even after a retransmission of the DISCOVER message. The
maximum retry timeout is also increased from 1 second to 2 seconds. An
ID cache of size 4 will keep DHCP requests around for 8 seconds (once
the maximum retry timeout has been reached) before dropping them. This
should give servers plenty of time to respond. If it ever turns out
that this isn't enough, the size of the cache can easily be increased.

With this commit the DHCP lease on the above-mentioned setup still takes
longer (1230 ms) than originally, but that's an acceptable compromise to
improve DHCP lease acquisition time for a broader range of setups.

To make it easier to benchmark DHCP in the future, this commit also adds
the time it took to obtain a lease to the final "DHCP client bound to
address x.x.x.x" message.

Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-08-21 12:01:30 -04:00
..
Makefile kbuild: use Linux Kernel build scripts 2014-02-19 11:07:50 -05: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: More BOOTP retry timeout improvements 2014-08-21 12:01:30 -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
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