From 4d46e8205ae2483c51a50e34f41329c71ccb79c7 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Wed, 2 Nov 2022 14:50:34 +0800 Subject: [PATCH 1/3] lwip: fix the bug that long time to get IP --- components/lwip/lwip | 2 +- components/lwip/port/esp32/include/lwipopts.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/lwip/lwip b/components/lwip/lwip index 9bad641bc7..705dd71d46 160000 --- a/components/lwip/lwip +++ b/components/lwip/lwip @@ -1 +1 @@ -Subproject commit 9bad641bc7378d2eb1ba84834baafaf119135206 +Subproject commit 705dd71d46779bf29653f1f1d7b1af5a09fb2aa7 diff --git a/components/lwip/port/esp32/include/lwipopts.h b/components/lwip/port/esp32/include/lwipopts.h index 32b66b5eda..a4baa0c863 100644 --- a/components/lwip/port/esp32/include/lwipopts.h +++ b/components/lwip/port/esp32/include/lwipopts.h @@ -344,7 +344,9 @@ extern "C" { /* Since for embedded devices it's not that hard to miss a discover packet, so lower * the discover retry backoff time from (2,4,8,16,32,60,60)s to (500m,1,2,4,8,15,15)s. */ -#define DHCP_REQUEST_TIMEOUT_SEQUENCE(tries) (( (tries) < 6 ? 1 << (tries) : 60) * 250) +#define DHCP_REQUEST_TIMEOUT_SEQUENCE(state, tries) (state == DHCP_STATE_REQUESTING ? \ + (uint16_t)(1 * 1000) : \ + (uint16_t)(((tries) < 6 ? 1 << (tries) : 60) * 250)) static inline uint32_t timeout_from_offered(uint32_t lease, uint32_t min) { From ebd1609073c10e38ffaf46fd1f0f7c6aaf4ab14a Mon Sep 17 00:00:00 2001 From: xueyunfei Date: Wed, 28 Sep 2022 17:57:04 +0800 Subject: [PATCH 2/3] lwip timer:optimization dhcp fine timer --- components/lwip/port/esp32/include/lwipopts.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/lwip/port/esp32/include/lwipopts.h b/components/lwip/port/esp32/include/lwipopts.h index a4baa0c863..f30838cb1a 100644 --- a/components/lwip/port/esp32/include/lwipopts.h +++ b/components/lwip/port/esp32/include/lwipopts.h @@ -1424,9 +1424,11 @@ static inline uint32_t timeout_from_offered(uint32_t lease, uint32_t min) #ifdef CONFIG_LWIP_TIMERS_ONDEMAND #define ESP_LWIP_IGMP_TIMERS_ONDEMAND 1 #define ESP_LWIP_MLD6_TIMERS_ONDEMAND 1 +#define ESP_LWIP_DHCP_FINE_TIMERS_ONDEMAND 1 #else #define ESP_LWIP_IGMP_TIMERS_ONDEMAND 0 #define ESP_LWIP_MLD6_TIMERS_ONDEMAND 0 +#define ESP_LWIP_DHCP_FINE_TIMERS_ONDEMAND 0 #endif /** From 651db95177ae795c73884de9a3d7ed307a431c63 Mon Sep 17 00:00:00 2001 From: xueyunfei Date: Mon, 7 Nov 2022 16:16:31 +0800 Subject: [PATCH 3/3] lwip:optimization dns ipv4 ipv6 timeir * Update submodule: git log --oneline 33912690ea005e8ff05b2c579ebbf0a4189c3b00..705dd71d46779bf29653f1f1d7b1af5a09fb2aa7 Detailed description of the changes: - dhcp: init fine timer when dhcp start(esp-lwip@705dd71d) - ip6 timer: optimization lwip ip6 reassembly timer (esp-lwip@9813ea9a) - ip4 timer: optimization lwip ip4 reassembly timer (esp-lwip@ce1a7099) - dns timer: optimization lwip dns timer (esp-lwip@6b0bfc2e) --- components/lwip/port/esp32/include/lwipopts.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/components/lwip/port/esp32/include/lwipopts.h b/components/lwip/port/esp32/include/lwipopts.h index f30838cb1a..2a9d29fedc 100644 --- a/components/lwip/port/esp32/include/lwipopts.h +++ b/components/lwip/port/esp32/include/lwipopts.h @@ -1425,10 +1425,24 @@ static inline uint32_t timeout_from_offered(uint32_t lease, uint32_t min) #define ESP_LWIP_IGMP_TIMERS_ONDEMAND 1 #define ESP_LWIP_MLD6_TIMERS_ONDEMAND 1 #define ESP_LWIP_DHCP_FINE_TIMERS_ONDEMAND 1 +#define ESP_LWIP_DNS_TIMERS_ONDEMAND 1 +#if IP_REASSEMBLY +#define ESP_LWIP_IP4_REASSEMBLY_TIMERS_ONDEMAND 1 +#endif /* IP_REASSEMBLY */ +#if LWIP_IPV6_REASS +#define ESP_LWIP_IP6_REASSEMBLY_TIMERS_ONDEMAND 1 +#endif /* LWIP_IPV6_REASS */ #else #define ESP_LWIP_IGMP_TIMERS_ONDEMAND 0 #define ESP_LWIP_MLD6_TIMERS_ONDEMAND 0 #define ESP_LWIP_DHCP_FINE_TIMERS_ONDEMAND 0 +#define ESP_LWIP_DNS_TIMERS_ONDEMAND 0 +#if IP_REASSEMBLY +#define ESP_LWIP_IP4_REASSEMBLY_TIMERS_ONDEMAND 0 +#endif /* IP_REASSEMBLY */ +#if LWIP_IPV6_REASS +#define ESP_LWIP_IP6_REASSEMBLY_TIMERS_ONDEMAND 0 +#endif /* LWIP_IPV6_REASS */ #endif /**