From ce93d231e9135b0f83e28b1a2b8d262e75c8a73e Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Thu, 22 Feb 2024 19:21:34 +0800 Subject: [PATCH 1/4] fix(wifi): fixed scan and mesh deinit issues 1. update scan ap number when clear scan ap records 2. wait for child disconnect when mesh deinit --- components/esp_rom/esp32c3/ld/esp32c3.rom.eco7.ld | 2 +- components/esp_wifi/lib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/esp_rom/esp32c3/ld/esp32c3.rom.eco7.ld b/components/esp_rom/esp32c3/ld/esp32c3.rom.eco7.ld index 8556d172cf..a74d65b6ae 100644 --- a/components/esp_rom/esp32c3/ld/esp32c3.rom.eco7.ld +++ b/components/esp_rom/esp32c3/ld/esp32c3.rom.eco7.ld @@ -36,7 +36,7 @@ ppProcTxDone = 0x40001804; pm_tx_data_done_process = 0x40001808; ppMapWaitTxq = 0x40001810; ieee80211_encap_esfbuf = 0x4000185c; -sta_input = 0x40001870; +/*sta_input = 0x40001870;*/ ieee80211_crypto_decap = 0x4000189c; ieee80211_decap = 0x400018a0; coex_core_timer_idx_get = 0x400018d0; diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 4da242a030..3fdca7e317 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 4da242a0302209e048006e4e093b55113b035a1a +Subproject commit 3fdca7e31728cb1f78a973dea929d5d059917626 From 99093b8743c3a6662f0fe713e512178a137285ad Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Thu, 25 Jan 2024 11:05:53 +0800 Subject: [PATCH 2/4] feat(lwip): add fall back dns config in menuconfig --- components/lwip/Kconfig | 27 +++++++++++++++++++ components/lwip/lwip | 2 +- components/lwip/port/esp32/include/lwipopts.h | 13 +++++++-- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/components/lwip/Kconfig b/components/lwip/Kconfig index 73260acdac..a88e3bec8f 100644 --- a/components/lwip/Kconfig +++ b/components/lwip/Kconfig @@ -1001,6 +1001,33 @@ menu "LWIP" help Set maximum number of ports a bridge can consists of. + menu "DNS" + + config LWIP_DNS_MAX_SERVERS + int "Maximum number of DNS servers" + default 3 + range 1 4 + help + Set maximum number of DNS servers. + If fallback DNS servers are supported, + the number of DNS servers needs to be greater than or equal to 3. + + config LWIP_FALLBACK_DNS_SERVER_SUPPORT + bool "Enable DNS fallback server support" + default n + depends on LWIP_DNS_MAX_SERVERS >= 3 + help + Enable this feature to support DNS fallback server. + + config LWIP_FALLBACK_DNS_SERVER_ADDRESS + string "DNS fallback server address" + default "114.114.114.114" + depends on LWIP_FALLBACK_DNS_SERVER_SUPPORT + help + This option allows you to config dns fallback server address. + + endmenu # DNS + config LWIP_ESP_LWIP_ASSERT bool "Enable LWIP ASSERT checks" default y diff --git a/components/lwip/lwip b/components/lwip/lwip index 542ba2997f..f79221431f 160000 --- a/components/lwip/lwip +++ b/components/lwip/lwip @@ -1 +1 @@ -Subproject commit 542ba2997f6cc14fe9c3d781bf9b0d890cd70bb1 +Subproject commit f79221431fa9042b3572d271d687de66da7560c4 diff --git a/components/lwip/port/esp32/include/lwipopts.h b/components/lwip/port/esp32/include/lwipopts.h index 1f876537ec..7b56b519d0 100644 --- a/components/lwip/port/esp32/include/lwipopts.h +++ b/components/lwip/port/esp32/include/lwipopts.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-3-Clause * - * SPDX-FileContributor: 2015-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileContributor: 2015-2024 Espressif Systems (Shanghai) CO LTD */ #ifndef LWIP_HDR_ESP_LWIPOPTS_H #define LWIP_HDR_ESP_LWIPOPTS_H @@ -457,7 +457,7 @@ static inline uint32_t timeout_from_offered(uint32_t lease, uint32_t min) /** The maximum of DNS servers */ -#define DNS_MAX_SERVERS 3 +#define DNS_MAX_SERVERS CONFIG_LWIP_DNS_MAX_SERVERS /** ESP specific option only applicable if ESP_DNS=1 * @@ -476,6 +476,14 @@ static inline uint32_t timeout_from_offered(uint32_t lease, uint32_t min) #define LWIP_DNS_SUPPORT_MDNS_QUERIES 0 #endif +#ifdef CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT +#define FALLBACK_DNS_SERVER_ADDRESS(address) \ + do { ip_addr_t *server_dns = address; \ + char server_ip[] = CONFIG_LWIP_FALLBACK_DNS_SERVER_ADDRESS; \ + ipaddr_aton(server_ip, server_dns); \ + } while (0) +#endif /* CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT */ + /* --------------------------------- ---------- UDP options ---------- @@ -1543,6 +1551,7 @@ static inline uint32_t timeout_from_offered(uint32_t lease, uint32_t min) #define ESP_LWIP_LOCK 1 #define ESP_THREAD_PROTECTION 1 #define LWIP_SUPPORT_CUSTOM_PBUF 1 +#define ESP_LWIP_FALLBACK_DNS_PREFER_IPV4 0 /* ----------------------------------------- From 0e9f7aac871973b82a7efd9a9cd101a05cf658b2 Mon Sep 17 00:00:00 2001 From: Abhik Roy Date: Tue, 14 Nov 2023 22:38:48 +1100 Subject: [PATCH 3/4] fix(lwip): Fixed debug format, added ci test config Detailed description of the changes: - lwip_debug: Fixed string format error in ip6 and napt (espressif/esp-lwip@f5c43549) - dns: fix init with only ipv4 enabled (espressif/esp-lwip@5aab73d7) --- .../lwip/test_apps/sdkconfig.ci.lwip_debug | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 components/lwip/test_apps/sdkconfig.ci.lwip_debug diff --git a/components/lwip/test_apps/sdkconfig.ci.lwip_debug b/components/lwip/test_apps/sdkconfig.ci.lwip_debug new file mode 100644 index 0000000000..a351db0a70 --- /dev/null +++ b/components/lwip/test_apps/sdkconfig.ci.lwip_debug @@ -0,0 +1,25 @@ +# Included for build test with LWIP debug enabled. + +CONFIG_LWIP_IP_FORWARD=y +CONFIG_LWIP_IPV4_NAPT=y +CONFIG_LWIP_DEBUG=y +CONFIG_LWIP_DEBUG_ESP_LOG=y +CONFIG_LWIP_NETIF_DEBUG=y +CONFIG_LWIP_PBUF_DEBUG=y +CONFIG_LWIP_ETHARP_DEBUG=y +CONFIG_LWIP_API_LIB_DEBUG=y +CONFIG_LWIP_SOCKETS_DEBUG=y +CONFIG_LWIP_IP_DEBUG=y +CONFIG_LWIP_ICMP_DEBUG=y +CONFIG_LWIP_DHCP_STATE_DEBUG=y +CONFIG_LWIP_DHCP_DEBUG=y +CONFIG_LWIP_IP6_DEBUG=y +CONFIG_LWIP_ICMP6_DEBUG=y +CONFIG_LWIP_TCP_DEBUG=y +CONFIG_LWIP_UDP_DEBUG=y +CONFIG_LWIP_SNTP_DEBUG=y +CONFIG_LWIP_DNS_DEBUG=y +CONFIG_LWIP_NAPT_DEBUG=y +CONFIG_LWIP_BRIDGEIF_DEBUG=y +CONFIG_LWIP_BRIDGEIF_FDB_DEBUG=y +CONFIG_LWIP_BRIDGEIF_FW_DEBUG=y From f12a5394cce129eb73c72a55fc4b74c0298ad296 Mon Sep 17 00:00:00 2001 From: xuxiao Date: Tue, 16 Jan 2024 10:50:18 +0800 Subject: [PATCH 4/4] feat(example): modify iperf sdkconfig to imporve iperf performance --- examples/wifi/iperf/sdkconfig.defaults | 2 -- examples/wifi/iperf/sdkconfig.defaults.esp32c2 | 3 +++ examples/wifi/iperf/sdkconfig.defaults.esp32c3 | 3 +++ examples/wifi/iperf/sdkconfig.defaults.esp32s2 | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/wifi/iperf/sdkconfig.defaults b/examples/wifi/iperf/sdkconfig.defaults index ddf0e6be20..cc22f7ad2b 100644 --- a/examples/wifi/iperf/sdkconfig.defaults +++ b/examples/wifi/iperf/sdkconfig.defaults @@ -13,6 +13,4 @@ CONFIG_LWIP_IRAM_OPTIMIZATION=y CONFIG_LWIP_TCPIP_TASK_PRIO=23 -CONFIG_LWIP_TCPIP_CORE_LOCKING=y -CONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT=y CONFIG_COMPILER_OPTIMIZATION_PERF=y diff --git a/examples/wifi/iperf/sdkconfig.defaults.esp32c2 b/examples/wifi/iperf/sdkconfig.defaults.esp32c2 index 5cdf29349b..305399e0ce 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.esp32c2 +++ b/examples/wifi/iperf/sdkconfig.defaults.esp32c2 @@ -20,3 +20,6 @@ CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=120 CONFIG_ESPTOOLPY_FLASHMODE_QIO=y CONFIG_ESPTOOLPY_FLASHFREQ_60M=y + +CONFIG_LWIP_TCPIP_CORE_LOCKING=y +CONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT=y diff --git a/examples/wifi/iperf/sdkconfig.defaults.esp32c3 b/examples/wifi/iperf/sdkconfig.defaults.esp32c3 index 42e0f24ffc..7bfa00906d 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.esp32c3 +++ b/examples/wifi/iperf/sdkconfig.defaults.esp32c3 @@ -20,3 +20,6 @@ CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=160 CONFIG_ESPTOOLPY_FLASHMODE_QIO=y CONFIG_ESPTOOLPY_FLASHFREQ_80M=y + +CONFIG_LWIP_TCPIP_CORE_LOCKING=y +CONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT=y diff --git a/examples/wifi/iperf/sdkconfig.defaults.esp32s2 b/examples/wifi/iperf/sdkconfig.defaults.esp32s2 index eca54d0a5f..e4976a0f2c 100644 --- a/examples/wifi/iperf/sdkconfig.defaults.esp32s2 +++ b/examples/wifi/iperf/sdkconfig.defaults.esp32s2 @@ -24,3 +24,6 @@ CONFIG_ESPTOOLPY_FLASHFREQ_80M=y CONFIG_ESP32S2_INSTRUCTION_CACHE_16KB=y CONFIG_ESP32S2_INSTRUCTION_CACHE_LINE_16B=y CONFIG_ESP32S2_INSTRUCTION_CACHE_WRAP=y + +CONFIG_LWIP_TCPIP_CORE_LOCKING=y +CONFIG_LWIP_TCPIP_CORE_LOCKING_INPUT=y