tweak lwip config to get better iperf throughput

This commit is contained in:
hathach
2026-04-23 15:27:05 +07:00
parent 8513c50231
commit f9ffb94f3d
2 changed files with 9 additions and 10 deletions

View File

@ -48,8 +48,8 @@
#define LWIP_IP_ACCEPT_UDP_PORT(p) ((p) == PP_NTOHS(67))
#define TCP_MSS (1500 /*mtu*/ - 20 /*iphdr*/ - 20 /*tcphhr*/)
#define TCP_SND_BUF (4 * TCP_MSS)
#define TCP_WND (4 * TCP_MSS)
#define TCP_SND_BUF (8 * TCP_MSS)
#define TCP_WND (8 * TCP_MSS)
#define ETHARP_SUPPORT_STATIC_ENTRIES 1
@ -60,7 +60,9 @@
#define LWIP_SINGLE_NETIF 1
#define LWIP_NETIF_LINK_CALLBACK 1
#define PBUF_POOL_SIZE 4
#define PBUF_POOL_SIZE 8
// Must grow in step with TCP_SND_BUF (default MEMP_NUM_TCP_SEG=16 caps TCP_SND_BUF at 4*MSS).
#define MEMP_NUM_TCP_SEG 32
#define HTTPD_USE_CUSTOM_FSDATA 0

View File

@ -92,8 +92,6 @@ extern "C" {
#define USE_ECM 1
#elif TU_CHECK_MCU(OPT_MCU_STM32F0, OPT_MCU_STM32F1)
#define USE_ECM 1
#elif TU_CHECK_MCU(OPT_MCU_MAX32690, OPT_MCU_MAX32650, OPT_MCU_MAX32666, OPT_MCU_MAX78002)
#define USE_ECM 1
#else
#define USE_ECM 0
#endif
@ -109,20 +107,19 @@ extern "C" {
// Must be >> MTU
// Can be set to 2048 without impact
#define CFG_TUD_NCM_IN_NTB_MAX_SIZE (2 * TCP_MSS + 100)
#define CFG_TUD_NCM_IN_NTB_MAX_SIZE (3 * TCP_MSS + 100)
// Must be >> MTU
// Can be set to smaller values if wNtbOutMaxDatagrams==1
#define CFG_TUD_NCM_OUT_NTB_MAX_SIZE (2 * TCP_MSS + 100)
#define CFG_TUD_NCM_OUT_NTB_MAX_SIZE (3 * TCP_MSS + 100)
// Number of NCM transfer blocks for reception side
#ifndef CFG_TUD_NCM_OUT_NTB_N
#define CFG_TUD_NCM_OUT_NTB_N 1
#define CFG_TUD_NCM_OUT_NTB_N 2
#endif
// Number of NCM transfer blocks for transmission side
#ifndef CFG_TUD_NCM_IN_NTB_N
#define CFG_TUD_NCM_IN_NTB_N 1
#define CFG_TUD_NCM_IN_NTB_N 2
#endif
//--------------------------------------------------------------------