Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/busybox: speed up DHCP lease acquisition
@ 2022-08-13 20:53 Edgar Bonet
  2022-08-13 21:36 ` Angelo Compagnucci
  2022-08-14 17:49 ` Yann E. MORIN
  0 siblings, 2 replies; 5+ messages in thread
From: Edgar Bonet @ 2022-08-13 20:53 UTC (permalink / raw)
  To: buildroot; +Cc: Angelo Compagnucci

Commit c343e01ac4908f76520cf9a405ed87650e78dc62 made udhcpc send a
single DHCP request (instead of 3) before going to the background, thus
speeding up the boot process if the DHCP lease is not obtained
immediately. Unfortunately, this can also slow down the acquisition of
the lease as, after going to the background, udhcpc waits for 20 seconds
(instead of 3) before retrying.

Speed up the lease acquisition by setting the retry timeout to 3
seconds.

Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
---
Hello!

While testing 2022.08-rc1 with acmesystems_acqua_a5_512mb_defconfig on a
real Acqua board (and Ubuntu 20.04 host), I noticed that my board became
very slow in getting a DHCP lease, which was a fast process on 2022.05.
Wireshark showed the following DHCP traffic ("<" = received from the
board, ">" = sent to the board):

    time (s)  packet
    ---------------------
    03.24 < DHCP Discover
    06.24 > DHCP Offer
    26.28 < DHCP Discover
    26.28 > DHCP Offer
    26.28 < DHCP Request
    26.28 > DHCP ACK

Looking at the log 2022.05..2022.08-rc1, I identified the regression to
be in commit c343e01ac4908f76520cf9a405ed87650e78dc62. This commit adds
the option -t1 to the udhcpc command, which makes it go to the
background after only one try, and has the unfortunate side effect of
introducing a 20-second delay.

With this patch applied, the lease is acquired much faster:

    03.26 < DHCP Discover
    06.26 > DHCP Offer
    09.28 < DHCP Discover
    09.29 > DHCP Offer
    09.29 < DHCP Request
    09.29 > DHCP ACK

Regards,

Edgar.

 package/busybox/busybox.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/busybox/busybox.config b/package/busybox/busybox.config
index 2409cbcce1..137e44c870 100644
--- a/package/busybox/busybox.config
+++ b/package/busybox/busybox.config
@@ -1022,7 +1022,7 @@ CONFIG_UDHCP_DEBUG=0
 CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
 CONFIG_FEATURE_UDHCP_RFC3397=y
 CONFIG_FEATURE_UDHCP_8021Q=y
-CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-t1 -b -R -O search"
+CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-t1 -A3 -b -R -O search"
 
 #
 # Print Utilities
-- 
2.25.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-14 17:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-13 20:53 [Buildroot] [PATCH 1/1] package/busybox: speed up DHCP lease acquisition Edgar Bonet
2022-08-13 21:36 ` Angelo Compagnucci
2022-08-13 22:25   ` Edgar Bonet
2022-08-14 17:51     ` Yann E. MORIN
2022-08-14 17:49 ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox