mirror of https://github.com/ARMmbed/mbed-os.git
lwip: Expose principal socket limits as configuration parameters.
Allow the limits on numbers of sockets to be changed via the configuration system. The help texts show the RAM penalty from increasing each value.pull/3078/head
parent
55485ae61e
commit
b516503fcb
|
@ -105,36 +105,52 @@
|
|||
|
||||
#define LWIP_RAM_HEAP_POINTER lwip_ram_heap
|
||||
|
||||
// Number of pool pbufs.
|
||||
// Each requires 684 bytes of RAM.
|
||||
#ifndef PBUF_POOL_SIZE
|
||||
/// Each requires 684 bytes of RAM.
|
||||
#define PBUF_POOL_SIZE 5
|
||||
#endif
|
||||
#ifndef MEMP_NUM_TCP_PCB_LISTEN
|
||||
/// One is needed for each TCPServer.
|
||||
/// Each requires 72 bytes of RAM.
|
||||
|
||||
// One tcp_pcb_listen is needed for each TCPServer.
|
||||
// Each requires 72 bytes of RAM.
|
||||
#ifdef MBED_CONF_LWIP_TCP_SERVER_MAX
|
||||
#define MEMP_NUM_TCP_PCB_LISTEN MBED_CONF_LWIP_TCP_SERVER_MAX
|
||||
#else
|
||||
#define MEMP_NUM_TCP_PCB_LISTEN 4
|
||||
#endif
|
||||
#ifndef MEMP_NUM_TCP_PCB
|
||||
/// One is needed for each TCPSocket.
|
||||
/// Each requires 196 bytes of RAM.
|
||||
|
||||
// One is tcp_pcb needed for each TCPSocket.
|
||||
// Each requires 196 bytes of RAM.
|
||||
#ifdef MBED_CONF_LWIP_TCP_SOCKET_MAX
|
||||
#define MEMP_NUM_TCP_PCB MBED_CONF_LWIP_TCP_SOCKET_MAX
|
||||
#else
|
||||
#define MEMP_NUM_TCP_PCB 4
|
||||
#endif
|
||||
#ifndef MEMP_NUM_UDP_PCB
|
||||
/// One is needed for each UDPSocket.
|
||||
/// Each requires 84 bytes of RAM (rounded to multiple of 512).
|
||||
|
||||
// One udp_pcb is needed for each UDPSocket.
|
||||
// Each requires 84 bytes of RAM (total rounded to multiple of 512).
|
||||
#ifdef MBED_CONF_LWIP_UDP_SOCKET_MAX
|
||||
#define MEMP_NUM_UDP_PCB MBED_CONF_LWIP_UDP_SOCKET_MAX
|
||||
#else
|
||||
#define MEMP_NUM_UDP_PCB 4
|
||||
#endif
|
||||
|
||||
// Number of non-pool pbufs.
|
||||
// Each requires 92 bytes of RAM.
|
||||
#ifndef MEMP_NUM_PBUF
|
||||
/// Each requires 92 bytes of RAM.
|
||||
#define MEMP_NUM_PBUF 8
|
||||
#endif
|
||||
|
||||
// Each netbuf requires 64 bytes of RAM.
|
||||
#ifndef MEMP_NUM_NETBUF
|
||||
/// Each requires 64 bytes of RAM.
|
||||
#define MEMP_NUM_NETBUF 8
|
||||
#endif
|
||||
#ifndef MEMP_NUM_NETCONN
|
||||
/// One netconn is needed for each UDPSocket, TCPSocket or TCPServer.
|
||||
/// Each requires 236 bytes of RAM (rounded to multiple of 512).
|
||||
|
||||
// One netconn is needed for each UDPSocket, TCPSocket or TCPServer.
|
||||
// Each requires 236 bytes of RAM (total rounded to multiple of 512).
|
||||
#ifdef MBED_CONF_LWIP_SOCKET_MAX
|
||||
#define MEMP_NUM_NETCONN MBED_CONF_LWIP_SOCKET_MAX
|
||||
#else
|
||||
#define MEMP_NUM_NETCONN 4
|
||||
#endif
|
||||
|
||||
|
|
|
@ -16,6 +16,22 @@
|
|||
"addr-timeout": {
|
||||
"help": "On dual stack system how long to wait preferred stack's address in seconds",
|
||||
"value": 5
|
||||
},
|
||||
"socket-max": {
|
||||
"help": "Maximum number of open TCPServer, TCPSocket and UDPSocket instances allowed, including one used internally for DNS. Each requires 236 bytes of pre-allocated RAM",
|
||||
"value": 4
|
||||
},
|
||||
"tcp-server-max": {
|
||||
"help": "Maximum number of open TCPServer instances allowed. Each requires 72 bytes of pre-allocated RAM",
|
||||
"value": 4
|
||||
},
|
||||
"tcp-socket-max": {
|
||||
"help": "Maximum number of open TCPSocket instances allowed. Each requires 196 bytes of pre-allocated RAM",
|
||||
"value": 4
|
||||
},
|
||||
"udp-socket-max": {
|
||||
"help": "Maximum number of open UDPSocket instances allowed, including one used internally for DNS. Each requires 84 bytes of pre-allocated RAM",
|
||||
"value": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue