From 4ce68f61637c15e04acea378729b324b038edb34 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Fri, 20 Oct 2017 14:51:17 +0800 Subject: [PATCH] lwip: Expose number of active socket limits in menuconfig --- components/lwip/Kconfig | 54 +++++++++++++++++++- components/lwip/include/lwip/port/lwipopts.h | 10 ++-- 2 files changed, 57 insertions(+), 7 deletions(-) diff --git a/components/lwip/Kconfig b/components/lwip/Kconfig index c0cf54304..8c52706f2 100644 --- a/components/lwip/Kconfig +++ b/components/lwip/Kconfig @@ -97,11 +97,11 @@ config LWIP_ETHARP_TRUST_IP_MAC Also notice that this slows down input processing of every IP packet! config TCPIP_RECVMBOX_SIZE - int "TCPIP receive mail box size" + int "TCPIP task receive mail box size" default 32 range 6 64 help - Set TCPIP receive mail box size. Generally bigger value means higher throughput + Set TCPIP task receive mail box size. Generally bigger value means higher throughput but more memory. The value should be bigger than UDP/TCP mail box size. config LWIP_DHCP_DOES_ARP_CHECK @@ -172,6 +172,33 @@ config LWIP_LOOPBACK_MAX_PBUFS menu "TCP" +config LWIP_MAX_ACTIVE_TCP + int "Maximum active TCP Connections" + range 1 1024 + default 16 + help + The maximum number of simultaneously active TCP + connections. The practical maximum limit is + determined by available heap memory at runtime. + + Changing this value by itself does not substantially + change the memory usage of LWIP, except for preventing + new TCP connections after the limit is reached. + +config LWIP_MAX_LISTENING_TCP + int "Maximum listening TCP Connections" + range 1 1024 + default 16 + help + The maximum number of simultaneously listening TCP + connections. The practical maximum limit is + determined by available heap memory at runtime. + + Changing this value by itself does not substantially + change the memory usage of LWIP, except for preventing + new listening TCP connections after the limit is reached. + + config TCP_MAXRTX int "Maximum number of retransmissions of data segments" default 12 @@ -287,6 +314,16 @@ endmenu # TCP menu "UDP" +config LWIP_MAX_UDP_PCBS + int "Maximum active UDP control blocks" + range 1 1024 + default 16 + help + The maximum number of active UDP "connections" (ie + UDP sockets sending/receiving data). + The practical maximum limit is determined by available + heap memory at runtime. + config UDP_RECVMBOX_SIZE int "Default UDP receive mail box size" default 6 @@ -372,4 +409,17 @@ config LWIP_BROADCAST_PING endmenu # ICMP +menu "LWIP RAW API" + +config LWIP_MAX_RAW_PCBS + int "Maximum LWIP RAW PCBs" + range 1 1024 + default 16 + help + The maximum number of simultaneously active LWIP + RAW protocol control blocks. The practical maximum + limit is determined by available heap memory at runtime. + +endmenu # LWIP RAW API + endmenu diff --git a/components/lwip/include/lwip/port/lwipopts.h b/components/lwip/include/lwip/port/lwipopts.h index 6f56f263e..4652c6d4a 100644 --- a/components/lwip/include/lwip/port/lwipopts.h +++ b/components/lwip/include/lwip/port/lwipopts.h @@ -112,26 +112,26 @@ * MEMP_NUM_RAW_PCB: Number of raw connection PCBs * (requires the LWIP_RAW option) */ -#define MEMP_NUM_RAW_PCB 16 +#define MEMP_NUM_RAW_PCB CONFIG_LWIP_MAX_RAW_PCBS /** - * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections. + * MEMP_NUM_TCP_PCB: the number of simultaneously active TCP connections. * (requires the LWIP_TCP option) */ -#define MEMP_NUM_TCP_PCB 16 +#define MEMP_NUM_TCP_PCB CONFIG_LWIP_MAX_ACTIVE_TCP /** * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. * (requires the LWIP_TCP option) */ -#define MEMP_NUM_TCP_PCB_LISTEN 16 +#define MEMP_NUM_TCP_PCB_LISTEN CONFIG_LWIP_MAX_LISTENING_TCP /** * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One * per active UDP "connection". * (requires the LWIP_UDP option) */ -#define MEMP_NUM_UDP_PCB 16 +#define MEMP_NUM_UDP_PCB CONFIG_LWIP_MAX_UDP_PCBS /* --------------------------------