diff --git a/boards/arm/c5471/c5471evm/configs/httpd/defconfig b/boards/arm/c5471/c5471evm/configs/httpd/defconfig index b43a7d58eac..66740d662e2 100644 --- a/boards/arm/c5471/c5471evm/configs/httpd/defconfig +++ b/boards/arm/c5471/c5471evm/configs/httpd/defconfig @@ -29,7 +29,7 @@ CONFIG_NET_MAX_LISTENPORTS=8 CONFIG_NET_SOCKOPTS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_PTHREAD_STACK_DEFAULT=4096 CONFIG_RAM_SIZE=285212672 CONFIG_RAM_START=0 diff --git a/boards/arm/lpc17xx_40xx/lincoln60/configs/thttpd-binfs/defconfig b/boards/arm/lpc17xx_40xx/lincoln60/configs/thttpd-binfs/defconfig index 7e0bdebf5da..a1f79926241 100644 --- a/boards/arm/lpc17xx_40xx/lincoln60/configs/thttpd-binfs/defconfig +++ b/boards/arm/lpc17xx_40xx/lincoln60/configs/thttpd-binfs/defconfig @@ -48,7 +48,7 @@ CONFIG_NET_NACTIVESOCKETS=12 CONFIG_NET_SOCKOPTS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=12 +CONFIG_NET_TCP_PREALLOC_CONNS=12 CONFIG_NET_TCP_WRITE_BUFFERS=y CONFIG_NUNGET_CHARS=0 CONFIG_PIPES=y diff --git a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/configs/thttpd/defconfig b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/configs/thttpd/defconfig index 22b441e171a..86eeac0d188 100644 --- a/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/configs/thttpd/defconfig +++ b/boards/arm/lpc17xx_40xx/lpcxpresso-lpc1768/configs/thttpd/defconfig @@ -37,7 +37,7 @@ CONFIG_NET_MAX_LISTENPORTS=8 CONFIG_NET_SOCKOPTS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NUNGET_CHARS=0 CONFIG_NXFLAT=y CONFIG_PIPES=y diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/configs/ftpc/defconfig b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/configs/ftpc/defconfig index a8fc9195c21..f2726561764 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/configs/ftpc/defconfig +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/configs/ftpc/defconfig @@ -45,7 +45,7 @@ CONFIG_NET_ICMP_SOCKET=y CONFIG_NET_MAX_LISTENPORTS=8 CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_ARCHINIT=y diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/configs/slip-httpd/defconfig b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/configs/slip-httpd/defconfig index d8b0c31d6de..f2b1645b0a5 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/configs/slip-httpd/defconfig +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/configs/slip-httpd/defconfig @@ -36,7 +36,7 @@ CONFIG_NET_SLIP=y CONFIG_NET_SOCKOPTS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NUNGET_CHARS=0 CONFIG_NXFLAT=y CONFIG_PIPES=y diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/configs/thttpd-binfs/defconfig b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/configs/thttpd-binfs/defconfig index 5f501b8e902..788f09d5fb7 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/configs/thttpd-binfs/defconfig +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/configs/thttpd-binfs/defconfig @@ -41,7 +41,7 @@ CONFIG_NET_MAX_LISTENPORTS=8 CONFIG_NET_SOCKOPTS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NUNGET_CHARS=0 CONFIG_PIPES=y CONFIG_RAM_SIZE=32768 diff --git a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/configs/thttpd-nxflat/defconfig b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/configs/thttpd-nxflat/defconfig index 3678528bed2..d52666745d3 100644 --- a/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/configs/thttpd-nxflat/defconfig +++ b/boards/arm/lpc17xx_40xx/olimex-lpc1766stk/configs/thttpd-nxflat/defconfig @@ -38,7 +38,7 @@ CONFIG_NET_MAX_LISTENPORTS=8 CONFIG_NET_SOCKOPTS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NUNGET_CHARS=0 CONFIG_NXFLAT=y CONFIG_PIPES=y diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/configs/hello/defconfig b/boards/arm/lpc17xx_40xx/zkit-arm-1769/configs/hello/defconfig index 7fd413782bc..df15f119daf 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/configs/hello/defconfig +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/configs/hello/defconfig @@ -35,7 +35,7 @@ CONFIG_NET_MAX_LISTENPORTS=8 CONFIG_NET_SOCKOPTS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NUNGET_CHARS=0 CONFIG_NXFLAT=y CONFIG_RAM_SIZE=32768 diff --git a/boards/arm/lpc17xx_40xx/zkit-arm-1769/configs/thttpd/defconfig b/boards/arm/lpc17xx_40xx/zkit-arm-1769/configs/thttpd/defconfig index 7374e372fa6..9dc91ac32f1 100644 --- a/boards/arm/lpc17xx_40xx/zkit-arm-1769/configs/thttpd/defconfig +++ b/boards/arm/lpc17xx_40xx/zkit-arm-1769/configs/thttpd/defconfig @@ -40,7 +40,7 @@ CONFIG_NET_MAX_LISTENPORTS=8 CONFIG_NET_SOCKOPTS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NUNGET_CHARS=0 CONFIG_NXFLAT=y CONFIG_PIPES=y diff --git a/boards/arm/lpc43xx/bambino-200e/configs/netnsh/defconfig b/boards/arm/lpc43xx/bambino-200e/configs/netnsh/defconfig index e0eeec8cd0d..8a07b2527c2 100644 --- a/boards/arm/lpc43xx/bambino-200e/configs/netnsh/defconfig +++ b/boards/arm/lpc43xx/bambino-200e/configs/netnsh/defconfig @@ -59,7 +59,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_ARCHINIT=y diff --git a/boards/arm/sam34/sam4e-ek/configs/nsh/defconfig b/boards/arm/sam34/sam4e-ek/configs/nsh/defconfig index 0aed921c2ff..4776c8c52bd 100644 --- a/boards/arm/sam34/sam4e-ek/configs/nsh/defconfig +++ b/boards/arm/sam34/sam4e-ek/configs/nsh/defconfig @@ -43,7 +43,7 @@ CONFIG_NET_ICMP_SOCKET=y CONFIG_NET_MAX_LISTENPORTS=16 CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NET_TCP_WRITE_BUFFERS=y CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y diff --git a/boards/arm/sam34/sam4e-ek/configs/nxwm/defconfig b/boards/arm/sam34/sam4e-ek/configs/nxwm/defconfig index d1fbf78e32c..71b1032981d 100644 --- a/boards/arm/sam34/sam4e-ek/configs/nxwm/defconfig +++ b/boards/arm/sam34/sam4e-ek/configs/nxwm/defconfig @@ -61,7 +61,7 @@ CONFIG_NET_ICMP_SOCKET=y CONFIG_NET_MAX_LISTENPORTS=16 CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_ARCHINIT=y diff --git a/boards/arm/sam34/sam4e-ek/configs/usbnsh/defconfig b/boards/arm/sam34/sam4e-ek/configs/usbnsh/defconfig index ba40da82ead..82f1189e394 100644 --- a/boards/arm/sam34/sam4e-ek/configs/usbnsh/defconfig +++ b/boards/arm/sam34/sam4e-ek/configs/usbnsh/defconfig @@ -51,7 +51,7 @@ CONFIG_NET_ICMP_SOCKET=y CONFIG_NET_MAX_LISTENPORTS=16 CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_ARCHINIT=y diff --git a/boards/arm/stm32/cloudctrl/configs/nsh/defconfig b/boards/arm/stm32/cloudctrl/configs/nsh/defconfig index 5cd72b7a98c..7f311a346aa 100644 --- a/boards/arm/stm32/cloudctrl/configs/nsh/defconfig +++ b/boards/arm/stm32/cloudctrl/configs/nsh/defconfig @@ -40,7 +40,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_ARCHINIT=y diff --git a/boards/arm/stm32/fire-stm32v2/configs/nsh/defconfig b/boards/arm/stm32/fire-stm32v2/configs/nsh/defconfig index 1bb005f364c..ef74b86197a 100644 --- a/boards/arm/stm32/fire-stm32v2/configs/nsh/defconfig +++ b/boards/arm/stm32/fire-stm32v2/configs/nsh/defconfig @@ -46,7 +46,7 @@ CONFIG_NET_ICMP_SOCKET=y CONFIG_NET_MAX_LISTENPORTS=16 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_ARCHINIT=y diff --git a/boards/arm/stm32/olimex-stm32-e407/configs/discover/defconfig b/boards/arm/stm32/olimex-stm32-e407/configs/discover/defconfig index eaee0aa150b..57f01c36568 100644 --- a/boards/arm/stm32/olimex-stm32-e407/configs/discover/defconfig +++ b/boards/arm/stm32/olimex-stm32-e407/configs/discover/defconfig @@ -38,7 +38,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_PREALLOC_TIMERS=4 diff --git a/boards/arm/stm32/olimex-stm32-e407/configs/netnsh/defconfig b/boards/arm/stm32/olimex-stm32-e407/configs/netnsh/defconfig index e76a8652675..a28eec4dd34 100644 --- a/boards/arm/stm32/olimex-stm32-e407/configs/netnsh/defconfig +++ b/boards/arm/stm32/olimex-stm32-e407/configs/netnsh/defconfig @@ -41,7 +41,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_BUILTIN_APPS=y diff --git a/boards/arm/stm32/olimex-stm32-e407/configs/telnetd/defconfig b/boards/arm/stm32/olimex-stm32-e407/configs/telnetd/defconfig index 8bd778e9a15..618fc0d513e 100644 --- a/boards/arm/stm32/olimex-stm32-e407/configs/telnetd/defconfig +++ b/boards/arm/stm32/olimex-stm32-e407/configs/telnetd/defconfig @@ -44,7 +44,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_PREALLOC_TIMERS=4 diff --git a/boards/arm/stm32/olimex-stm32-e407/configs/webserver/defconfig b/boards/arm/stm32/olimex-stm32-e407/configs/webserver/defconfig index 2d489b88320..8fcb418f928 100644 --- a/boards/arm/stm32/olimex-stm32-e407/configs/webserver/defconfig +++ b/boards/arm/stm32/olimex-stm32-e407/configs/webserver/defconfig @@ -40,7 +40,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_PREALLOC_TIMERS=4 diff --git a/boards/arm/stm32/olimex-stm32-p107/configs/nsh/defconfig b/boards/arm/stm32/olimex-stm32-p107/configs/nsh/defconfig index 9c9d8811d5f..0c2215bad86 100644 --- a/boards/arm/stm32/olimex-stm32-p107/configs/nsh/defconfig +++ b/boards/arm/stm32/olimex-stm32-p107/configs/nsh/defconfig @@ -37,7 +37,7 @@ CONFIG_NET_ICMP=y CONFIG_NET_ICMP_SOCKET=y CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_TCP=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NSH_BUILTIN_APPS=y CONFIG_NSH_READLINE=y diff --git a/boards/arm/stm32/shenzhou/configs/nsh/defconfig b/boards/arm/stm32/shenzhou/configs/nsh/defconfig index b0193bda35d..b8e9ee196a4 100644 --- a/boards/arm/stm32/shenzhou/configs/nsh/defconfig +++ b/boards/arm/stm32/shenzhou/configs/nsh/defconfig @@ -39,7 +39,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_ARCHINIT=y diff --git a/boards/arm/stm32/shenzhou/configs/nxwm/defconfig b/boards/arm/stm32/shenzhou/configs/nxwm/defconfig index 2d88512d762..8e80c6f95ab 100644 --- a/boards/arm/stm32/shenzhou/configs/nxwm/defconfig +++ b/boards/arm/stm32/shenzhou/configs/nxwm/defconfig @@ -53,7 +53,7 @@ CONFIG_NET_MAX_LISTENPORTS=16 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_ARCHINIT=y diff --git a/boards/arm/stm32/shenzhou/configs/thttpd/defconfig b/boards/arm/stm32/shenzhou/configs/thttpd/defconfig index 70414c06bb9..2df9a74f5e5 100644 --- a/boards/arm/stm32/shenzhou/configs/thttpd/defconfig +++ b/boards/arm/stm32/shenzhou/configs/thttpd/defconfig @@ -46,7 +46,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_ARCHINIT=y diff --git a/boards/arm/stm32/stm3220g-eval/configs/nettest/defconfig b/boards/arm/stm32/stm3220g-eval/configs/nettest/defconfig index 06254e4bb25..dd5f3d9790a 100644 --- a/boards/arm/stm32/stm3220g-eval/configs/nettest/defconfig +++ b/boards/arm/stm32/stm3220g-eval/configs/nettest/defconfig @@ -33,7 +33,7 @@ CONFIG_NET_ICMP=y CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_SOCKOPTS=y CONFIG_NET_TCP=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NUNGET_CHARS=0 CONFIG_RAM_SIZE=196608 CONFIG_RAM_START=0x20000000 diff --git a/boards/arm/stm32/stm3220g-eval/configs/nsh/defconfig b/boards/arm/stm32/stm3220g-eval/configs/nsh/defconfig index 5cfce6c8dad..c2f3c17ef18 100644 --- a/boards/arm/stm32/stm3220g-eval/configs/nsh/defconfig +++ b/boards/arm/stm32/stm3220g-eval/configs/nsh/defconfig @@ -42,7 +42,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_BUILTIN_APPS=y diff --git a/boards/arm/stm32/stm3220g-eval/configs/nsh2/defconfig b/boards/arm/stm32/stm3220g-eval/configs/nsh2/defconfig index e71af6c3a8e..1078fb44fef 100644 --- a/boards/arm/stm32/stm3220g-eval/configs/nsh2/defconfig +++ b/boards/arm/stm32/stm3220g-eval/configs/nsh2/defconfig @@ -52,7 +52,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_ARCHINIT=y diff --git a/boards/arm/stm32/stm3220g-eval/configs/nxwm/defconfig b/boards/arm/stm32/stm3220g-eval/configs/nxwm/defconfig index fb1ce1a428b..1eb3b205b7b 100644 --- a/boards/arm/stm32/stm3220g-eval/configs/nxwm/defconfig +++ b/boards/arm/stm32/stm3220g-eval/configs/nxwm/defconfig @@ -52,7 +52,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_FILEIOSIZE=512 diff --git a/boards/arm/stm32/stm3220g-eval/configs/telnetd/defconfig b/boards/arm/stm32/stm3220g-eval/configs/telnetd/defconfig index cf1cbed82b7..f37f078a502 100644 --- a/boards/arm/stm32/stm3220g-eval/configs/telnetd/defconfig +++ b/boards/arm/stm32/stm3220g-eval/configs/telnetd/defconfig @@ -36,7 +36,7 @@ CONFIG_NET_ICMP=y CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_SOCKOPTS=y CONFIG_NET_TCP=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NUNGET_CHARS=0 CONFIG_RAM_SIZE=196608 CONFIG_RAM_START=0x20000000 diff --git a/boards/arm/stm32/stm3240g-eval/configs/discover/defconfig b/boards/arm/stm32/stm3240g-eval/configs/discover/defconfig index c91b073c9c1..4f50a036cee 100644 --- a/boards/arm/stm32/stm3240g-eval/configs/discover/defconfig +++ b/boards/arm/stm32/stm3240g-eval/configs/discover/defconfig @@ -40,7 +40,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_PREALLOC_TIMERS=4 diff --git a/boards/arm/stm32/stm3240g-eval/configs/nettest/defconfig b/boards/arm/stm32/stm3240g-eval/configs/nettest/defconfig index 377286c799e..507834a9a59 100644 --- a/boards/arm/stm32/stm3240g-eval/configs/nettest/defconfig +++ b/boards/arm/stm32/stm3240g-eval/configs/nettest/defconfig @@ -35,7 +35,7 @@ CONFIG_NET_ICMP=y CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_SOCKOPTS=y CONFIG_NET_TCP=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NUNGET_CHARS=0 CONFIG_RAM_SIZE=196608 CONFIG_RAM_START=0x20000000 diff --git a/boards/arm/stm32/stm3240g-eval/configs/nsh/defconfig b/boards/arm/stm32/stm3240g-eval/configs/nsh/defconfig index f2b16548e81..a5421e4fa89 100644 --- a/boards/arm/stm32/stm3240g-eval/configs/nsh/defconfig +++ b/boards/arm/stm32/stm3240g-eval/configs/nsh/defconfig @@ -46,7 +46,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_BUILTIN_APPS=y diff --git a/boards/arm/stm32/stm3240g-eval/configs/nsh2/defconfig b/boards/arm/stm32/stm3240g-eval/configs/nsh2/defconfig index e0a0c734dac..1296ac118a6 100644 --- a/boards/arm/stm32/stm3240g-eval/configs/nsh2/defconfig +++ b/boards/arm/stm32/stm3240g-eval/configs/nsh2/defconfig @@ -53,7 +53,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_ARCHINIT=y diff --git a/boards/arm/stm32/stm3240g-eval/configs/nxterm/defconfig b/boards/arm/stm32/stm3240g-eval/configs/nxterm/defconfig index 4b1f17f303f..43ec247269c 100644 --- a/boards/arm/stm32/stm3240g-eval/configs/nxterm/defconfig +++ b/boards/arm/stm32/stm3240g-eval/configs/nxterm/defconfig @@ -55,7 +55,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_BUILTIN_APPS=y diff --git a/boards/arm/stm32/stm3240g-eval/configs/nxwm/defconfig b/boards/arm/stm32/stm3240g-eval/configs/nxwm/defconfig index 271233fb6f9..1f0cb716242 100644 --- a/boards/arm/stm32/stm3240g-eval/configs/nxwm/defconfig +++ b/boards/arm/stm32/stm3240g-eval/configs/nxwm/defconfig @@ -52,7 +52,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_FILEIOSIZE=512 diff --git a/boards/arm/stm32/stm3240g-eval/configs/telnetd/defconfig b/boards/arm/stm32/stm3240g-eval/configs/telnetd/defconfig index 11b4d672f95..5c2429c4910 100644 --- a/boards/arm/stm32/stm3240g-eval/configs/telnetd/defconfig +++ b/boards/arm/stm32/stm3240g-eval/configs/telnetd/defconfig @@ -37,7 +37,7 @@ CONFIG_NET_ICMP=y CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_SOCKOPTS=y CONFIG_NET_TCP=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NUNGET_CHARS=0 CONFIG_RAM_SIZE=196608 CONFIG_RAM_START=0x20000000 diff --git a/boards/arm/stm32/stm3240g-eval/configs/webserver/defconfig b/boards/arm/stm32/stm3240g-eval/configs/webserver/defconfig index 478006924cf..ba3d6964d6d 100644 --- a/boards/arm/stm32/stm3240g-eval/configs/webserver/defconfig +++ b/boards/arm/stm32/stm3240g-eval/configs/webserver/defconfig @@ -41,7 +41,7 @@ CONFIG_NET_SOCKOPTS=y CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_FILEIOSIZE=512 diff --git a/boards/arm/stm32/stm3240g-eval/configs/xmlrpc/defconfig b/boards/arm/stm32/stm3240g-eval/configs/xmlrpc/defconfig index e1703134b7f..73473c20cc1 100644 --- a/boards/arm/stm32/stm3240g-eval/configs/xmlrpc/defconfig +++ b/boards/arm/stm32/stm3240g-eval/configs/xmlrpc/defconfig @@ -40,7 +40,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_PREALLOC_TIMERS=4 diff --git a/boards/arm/stm32/stm32f4discovery/configs/ether_w5500/defconfig b/boards/arm/stm32/stm32f4discovery/configs/ether_w5500/defconfig index 5daa1d19ee6..ecca5b2c5f6 100644 --- a/boards/arm/stm32/stm32f4discovery/configs/ether_w5500/defconfig +++ b/boards/arm/stm32/stm32f4discovery/configs/ether_w5500/defconfig @@ -42,7 +42,7 @@ CONFIG_NET_ICMP_SOCKET=y CONFIG_NET_MAX_LISTENPORTS=16 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NET_W5500=y diff --git a/boards/arm/stm32/viewtool-stm32f107/configs/netnsh/defconfig b/boards/arm/stm32/viewtool-stm32f107/configs/netnsh/defconfig index 4dfbe472be7..03d5b72c9ee 100644 --- a/boards/arm/stm32/viewtool-stm32f107/configs/netnsh/defconfig +++ b/boards/arm/stm32/viewtool-stm32f107/configs/netnsh/defconfig @@ -43,7 +43,7 @@ CONFIG_NET_IPv6=y CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_ROUTE=y CONFIG_NET_TCP=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_TCP_WRITE_BUFFERS=y CONFIG_NET_UDP=y CONFIG_NSH_ARCHINIT=y diff --git a/boards/arm/stm32/viewtool-stm32f107/configs/tcpblaster/defconfig b/boards/arm/stm32/viewtool-stm32f107/configs/tcpblaster/defconfig index caa2c442a0b..d5c556005ce 100644 --- a/boards/arm/stm32/viewtool-stm32f107/configs/tcpblaster/defconfig +++ b/boards/arm/stm32/viewtool-stm32f107/configs/tcpblaster/defconfig @@ -38,7 +38,7 @@ CONFIG_NET_SOCKOPTS=y CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_TCP_WRITE_BUFFERS=y CONFIG_NSH_ARCHINIT=y CONFIG_NSH_BUILTIN_APPS=y diff --git a/boards/arm/tiva/eagle100/configs/httpd/defconfig b/boards/arm/tiva/eagle100/configs/httpd/defconfig index 8993b172acb..3888433b9b9 100644 --- a/boards/arm/tiva/eagle100/configs/httpd/defconfig +++ b/boards/arm/tiva/eagle100/configs/httpd/defconfig @@ -30,7 +30,7 @@ CONFIG_NET_SOCKOPTS=y CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NUNGET_CHARS=0 CONFIG_RAM_SIZE=65536 CONFIG_RAM_START=0x20000000 diff --git a/boards/arm/tiva/eagle100/configs/thttpd/defconfig b/boards/arm/tiva/eagle100/configs/thttpd/defconfig index b724af6798d..531b8e7b64f 100644 --- a/boards/arm/tiva/eagle100/configs/thttpd/defconfig +++ b/boards/arm/tiva/eagle100/configs/thttpd/defconfig @@ -31,7 +31,7 @@ CONFIG_NET_MAX_LISTENPORTS=8 CONFIG_NET_SOCKOPTS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NUNGET_CHARS=0 CONFIG_NXFLAT=y CONFIG_PIPES=y diff --git a/boards/arm/tiva/lm3s6965-ek/configs/tcpecho/defconfig b/boards/arm/tiva/lm3s6965-ek/configs/tcpecho/defconfig index c63aecafeb3..c0c55edb036 100644 --- a/boards/arm/tiva/lm3s6965-ek/configs/tcpecho/defconfig +++ b/boards/arm/tiva/lm3s6965-ek/configs/tcpecho/defconfig @@ -38,7 +38,7 @@ CONFIG_NET_MAX_LISTENPORTS=8 CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_PREALLOC_TIMERS=4 diff --git a/boards/mips/pic32mx/pic32mx-starterkit/configs/nsh2/defconfig b/boards/mips/pic32mx/pic32mx-starterkit/configs/nsh2/defconfig index 412ac92ce69..51f63ed9a31 100644 --- a/boards/mips/pic32mx/pic32mx-starterkit/configs/nsh2/defconfig +++ b/boards/mips/pic32mx/pic32mx-starterkit/configs/nsh2/defconfig @@ -45,7 +45,7 @@ CONFIG_NET_ICMP_SOCKET=y CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_ARCHINIT=y diff --git a/boards/mips/pic32mx/pic32mx7mmb/configs/nsh/defconfig b/boards/mips/pic32mx/pic32mx7mmb/configs/nsh/defconfig index f4650acc55c..59196ad95d1 100644 --- a/boards/mips/pic32mx/pic32mx7mmb/configs/nsh/defconfig +++ b/boards/mips/pic32mx/pic32mx7mmb/configs/nsh/defconfig @@ -47,7 +47,7 @@ CONFIG_NET_ICMP_SOCKET=y CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NSH_ARCHINIT=y diff --git a/boards/misoc/lm32/misoc/configs/hello/defconfig b/boards/misoc/lm32/misoc/configs/hello/defconfig index af50b096d43..98fefeb1892 100644 --- a/boards/misoc/lm32/misoc/configs/hello/defconfig +++ b/boards/misoc/lm32/misoc/configs/hello/defconfig @@ -59,7 +59,7 @@ CONFIG_NET_ICMP=y CONFIG_NET_ICMP_SOCKET=y CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_TCP=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_NET_TCP_WRITE_BUFFERS=y CONFIG_NET_UDP=y CONFIG_NET_UDP_CHECKSUMS=y diff --git a/boards/sim/sim/sim/configs/nettest/defconfig b/boards/sim/sim/sim/configs/nettest/defconfig index d19c646b6c6..e40363dc78b 100644 --- a/boards/sim/sim/sim/configs/nettest/defconfig +++ b/boards/sim/sim/sim/configs/nettest/defconfig @@ -23,7 +23,7 @@ CONFIG_NET_MAX_LISTENPORTS=40 CONFIG_NET_SOCKOPTS=y CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y -CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_TCP_PREALLOC_CONNS=40 CONFIG_SCHED_LPWORK=y CONFIG_START_DAY=16 CONFIG_START_MONTH=8 diff --git a/boards/z80/ez80/ez80f910200zco/configs/httpd/defconfig b/boards/z80/ez80/ez80f910200zco/configs/httpd/defconfig index 4fe7bd471da..5fe1851e797 100644 --- a/boards/z80/ez80/ez80f910200zco/configs/httpd/defconfig +++ b/boards/z80/ez80/ez80f910200zco/configs/httpd/defconfig @@ -35,7 +35,7 @@ CONFIG_NET_SOCKOPTS=y CONFIG_NET_STATISTICS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y -CONFIG_NET_TCP_CONNS=16 +CONFIG_NET_TCP_PREALLOC_CONNS=16 CONFIG_NUNGET_CHARS=0 CONFIG_RAM_SIZE=65536 CONFIG_RR_INTERVAL=200 diff --git a/include/nuttx/net/netconfig.h b/include/nuttx/net/netconfig.h index b2e1b072d24..93e8e80cb8e 100644 --- a/include/nuttx/net/netconfig.h +++ b/include/nuttx/net/netconfig.h @@ -416,21 +416,6 @@ /* TCP configuration options */ -/* The maximum number of simultaneously open TCP connections. - * - * Since the TCP connections are statically allocated, turning this - * configuration knob down results in less RAM used. Each TCP - * connection requires approximately 30 bytes of memory. - */ - -#ifndef CONFIG_NET_TCP_CONNS -# ifdef CONFIG_NET_TCP -# define CONFIG_NET_TCP_CONNS 10 -# else -# define CONFIG_NET_TCP_CONNS 0 -# endif -#endif - /* The maximum number of simultaneously listening TCP ports. * * Each listening TCP port requires 2 bytes of memory. @@ -446,7 +431,8 @@ */ #ifndef CONFIG_NET_NACTIVESOCKETS -# define CONFIG_NET_NACTIVESOCKETS (CONFIG_NET_TCP_CONNS + CONFIG_NET_UDP_CONNS) +# define CONFIG_NET_NACTIVESOCKETS (CONFIG_NET_TCP_PREALLOC_CONNS + \ + CONFIG_NET_UDP_CONNS) #endif /* The initial retransmission timeout counted in timer pulses. diff --git a/net/tcp/Kconfig b/net/tcp/Kconfig index b53c20da74a..900fea25b25 100644 --- a/net/tcp/Kconfig +++ b/net/tcp/Kconfig @@ -50,11 +50,46 @@ config NET_TCPURGDATA compiled in. Urgent data (out-of-band data) is a rarely used TCP feature that is very seldom would be required. -config NET_TCP_CONNS - int "Number of TCP/IP connections" +config NET_TCP_PREALLOC_CONNS + int "Preallocated TCP/IP connections" default 8 ---help--- - Maximum number of TCP/IP connections (all tasks) + Number of TCP/IP connections (all tasks). + + This number of connections will be pre-allocated during system boot. + If dynamic connections allocation is enabled, more connections may + be allocated at a later time, as the system needs them. Else this + will be the maximum number of connections available to the system + at all times. + + Set to 0 to disable (and rely only on dynamic allocations). + +config NET_TCP_ALLOC_CONNS + int "Dynamic TCP/IP connections allocation" + default 0 + ---help--- + Dynamic memory allocations for TCP/IP. + + When set to 0 all dynamic allocations are disabled. + + When set to 1 a new connection will be allocated every time, + and it will be free'd when no longer needed. + + Setting this to 2 or more will allocate the connections in + batches (with batch size equal to this config). When a + connection is no longer needed, it will be returned to the + free connections pool, and it will never be deallocated! + +config NET_TCP_MAX_CONNS + int "Maximum number of TCP/IP connections" + default 0 + depends on NET_TCP_ALLOC_CONNS > 0 + ---help--- + If dynamic connections allocation is selected (NET_TCP_ALLOC_CONNS > 0) + this will limit the number of connections that can be allocated. + + This is useful in case the system is under very heavy load (or + under attack), ensuring that the heap will not be exhausted. config NET_TCP_NPOLLWAITERS int "Number of TCP poll waiters" diff --git a/net/tcp/tcp_conn.c b/net/tcp/tcp_conn.c index 28b2d9c7493..e71592b78b2 100644 --- a/net/tcp/tcp_conn.c +++ b/net/tcp/tcp_conn.c @@ -76,8 +76,8 @@ /* The array containing all TCP connections. */ -#ifndef CONFIG_NET_ALLOC_CONNS -static struct tcp_conn_s g_tcp_connections[CONFIG_NET_TCP_CONNS]; +#if CONFIG_NET_TCP_PREALLOC_CONNS > 0 +static struct tcp_conn_s g_tcp_connections[CONFIG_NET_TCP_PREALLOC_CONNS]; #endif /* A list of all free TCP connections */ @@ -439,7 +439,7 @@ static inline int tcp_ipv6_bind(FAR struct tcp_conn_s *conn, * ****************************************************************************/ -#ifdef CONFIG_NET_ALLOC_CONNS +#if CONFIG_NET_TCP_ALLOC_CONNS > 0 FAR struct tcp_conn_s *tcp_alloc_conn(void) { FAR struct tcp_conn_s *conn; @@ -449,8 +449,16 @@ FAR struct tcp_conn_s *tcp_alloc_conn(void) if (dq_peek(&g_free_tcp_connections) == NULL) { +#if CONFIG_NET_TCP_MAX_CONNS > 0 + if (dq_count(&g_active_tcp_connections) + CONFIG_NET_TCP_ALLOC_CONNS + >= CONFIG_NET_TCP_MAX_CONNS) + { + return NULL; + } +#endif + conn = kmm_zalloc(sizeof(struct tcp_conn_s) * - CONFIG_NET_TCP_CONNS); + CONFIG_NET_TCP_ALLOC_CONNS); if (conn == NULL) { return conn; @@ -458,7 +466,7 @@ FAR struct tcp_conn_s *tcp_alloc_conn(void) /* Now initialize each connection structure */ - for (i = 0; i < CONFIG_NET_TCP_CONNS; i++) + for (i = 0; i < CONFIG_NET_TCP_ALLOC_CONNS; i++) { /* Mark the connection closed and move it to the free list */ @@ -597,10 +605,10 @@ int tcp_selectport(uint8_t domain, void tcp_initialize(void) { -#ifndef CONFIG_NET_ALLOC_CONNS +#if CONFIG_NET_TCP_PREALLOC_CONNS > 0 int i; - for (i = 0; i < CONFIG_NET_TCP_CONNS; i++) + for (i = 0; i < CONFIG_NET_TCP_PREALLOC_CONNS; i++) { /* Mark the connection closed and move it to the free list */ @@ -700,7 +708,12 @@ FAR struct tcp_conn_s *tcp_alloc(uint8_t domain) tcp_free(conn); - /* Now there is guaranteed to be one free connection. Get it! */ + /* Now there should be one free connection. If dynamic connections + * allocation is disabled, it is guaranteed so. In case that + * dynamic connections are used, it may be already in the free + * list, or at least there should be enough space in the heap for + * a new connection. + */ conn = (FAR struct tcp_conn_s *) dq_remfirst(&g_free_tcp_connections); @@ -710,7 +723,7 @@ FAR struct tcp_conn_s *tcp_alloc(uint8_t domain) /* Allocate the connect entry from heap */ -#ifdef CONFIG_NET_ALLOC_CONNS +#if CONFIG_NET_TCP_ALLOC_CONNS > 0 if (conn == NULL) { conn = tcp_alloc_conn(); @@ -876,10 +889,26 @@ void tcp_free(FAR struct tcp_conn_s *conn) } #endif - /* Mark the connection available and put it into the free list */ + /* Mark the connection available. */ conn->tcpstateflags = TCP_CLOSED; - dq_addlast(&conn->sconn.node, &g_free_tcp_connections); + + /* If this is a preallocated or a batch allocated connection store it in + * the free connections list. Else free it. + */ + +#if CONFIG_NET_TCP_ALLOC_CONNS == 1 + if (conn < g_tcp_connections || conn >= (g_tcp_connections + + CONFIG_NET_TCP_PREALLOC_CONNS)) + { + kmm_free(conn); + } + else +#endif + { + dq_addlast(&conn->sconn.node, &g_free_tcp_connections); + } + net_unlock(); }