]> granicus.if.org Git - esp-idf/commitdiff
lwip: Expose number of active socket limits in menuconfig
authorAngus Gratton <angus@espressif.com>
Fri, 20 Oct 2017 06:51:17 +0000 (14:51 +0800)
committerAngus Gratton <gus@projectgus.com>
Wed, 22 Nov 2017 03:10:08 +0000 (14:10 +1100)
components/lwip/Kconfig
components/lwip/include/lwip/port/lwipopts.h

index c0cf5430498e44c1f04ea3f388a6b04afa513367..8c52706f23887965736562aa8ccd1cc4e7bf1ef1 100644 (file)
@@ -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
index 6f56f263e76ee03a93f50c1ef38d9cf8ac82da74..4652c6d4a86f4cf8c1292a4cfd69c8957fd943ed 100644 (file)
  * 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
 
 /*
    --------------------------------