From 1334448c167ae76dea6a632a56f6ae16eb4abd4a Mon Sep 17 00:00:00 2001 From: TomoYamanaka Date: Fri, 3 Aug 2018 15:04:43 +0900 Subject: [PATCH 1/2] Improve LWIP for Renesas For speeding up of LWIP in RZ/A1, I added four new config processes in mbed_lib.json and lwipopts.h, overriden those values. Since RZ/A1 incorporates a large memory, can actualize speeding up by running with the override value. Also those new config processes will be helpful for more customize. --- features/lwipstack/lwipopts.h | 20 ++++++++++++++++++++ features/lwipstack/mbed_lib.json | 21 +++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/features/lwipstack/lwipopts.h b/features/lwipstack/lwipopts.h index a9a1dd5476..e21b11d60e 100644 --- a/features/lwipstack/lwipopts.h +++ b/features/lwipstack/lwipopts.h @@ -139,6 +139,26 @@ #define LWIP_RAM_HEAP_POINTER lwip_ram_heap +// Number of simultaneously queued TCP segments. +#ifdef MBED_CONF_LWIP_MEMP_NUM_TCP_SEG +#define MEMP_NUM_TCP_SEG MBED_CONF_LWIP_MEMP_NUM_TCP_SEG +#endif + +// TCP Maximum segment size. +#ifdef MBED_CONF_LWIP_TCP_MSS +#define TCP_MSS MBED_CONF_LWIP_TCP_MSS +#endif + +// TCP sender buffer space (bytes). +#ifdef MBED_CONF_LWIP_TCP_SND_BUF +#define TCP_SND_BUF MBED_CONF_LWIP_TCP_SND_BUF +#endif + +// TCP sender buffer space (bytes). +#ifdef MBED_CONF_LWIP_TCP_WND +#define TCP_WND MBED_CONF_LWIP_TCP_WND +#endif + // Number of pool pbufs. // Each requires 684 bytes of RAM (if MSS=536 and PBUF_POOL_BUFSIZE defaulting to be based on MSS) #ifdef MBED_CONF_LWIP_PBUF_POOL_SIZE diff --git a/features/lwipstack/mbed_lib.json b/features/lwipstack/mbed_lib.json index 610de76827..e8ee6909e6 100644 --- a/features/lwipstack/mbed_lib.json +++ b/features/lwipstack/mbed_lib.json @@ -72,6 +72,22 @@ "help": "Maximum number of open UDPSocket instances allowed, including one used internally for DNS. Each requires 84 bytes of pre-allocated RAM", "value": 4 }, + "memp-num-tcp-seg": { + "help": "Number of simultaneously queued TCP segments. Current default (used if null here) is set to 16 in opt.h, unless overridden by target Ethernet drivers.", + "value": null + }, + "tcp-mss": { + "help": "TCP Maximum segment size. Current default (used if null here) is set to 536 in opt.h, unless overridden by target Ethernet drivers.", + "value": null + }, + "tcp-snd-buf": { + "help": "TCP sender buffer space (bytes). Current default (used if null here) is set to (2 * TCP_MSS) in opt.h, unless overridden by target Ethernet drivers.", + "value": null + }, + "tcp-wnd": { + "help": "TCP sender buffer space (bytes). Current default (used if null here) is set to (4 * TCP_MSS) in opt.h, unless overridden by target Ethernet drivers.", + "value": null + }, "pbuf-pool-size": { "help": "Number of pbufs in pool - usually used for received packets, so this determines how much data can be buffered between reception and the application reading. If a driver uses PBUF_RAM for reception, less pool may be needed. Current default (used if null here) is set to 5 in lwipopts.h, unless overridden by target Ethernet drivers.", "value": null @@ -132,6 +148,11 @@ "tcpip-thread-stacksize": 1328, "default-thread-stacksize": 640, "ppp-thread-stacksize": 896, + "memp-num-tcp-seg": 32, + "tcp-mss": 1460, + "tcp-snd-buf": "(8 * TCP_MSS)", + "tcp-wnd": "(TCP_MSS * 8)", + "pbuf-pool-size": 16, "mem-size": 51200 } } From e080561c9e054b847bc02426b0e9e1507c54eca3 Mon Sep 17 00:00:00 2001 From: TomoYamanaka Date: Mon, 6 Aug 2018 18:12:37 +0900 Subject: [PATCH 2/2] Change override value of "tcp-mss" to max 1440 byte for IPV6 header size. --- features/lwipstack/mbed_lib.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/lwipstack/mbed_lib.json b/features/lwipstack/mbed_lib.json index e8ee6909e6..031a36f132 100644 --- a/features/lwipstack/mbed_lib.json +++ b/features/lwipstack/mbed_lib.json @@ -149,7 +149,7 @@ "default-thread-stacksize": 640, "ppp-thread-stacksize": 896, "memp-num-tcp-seg": 32, - "tcp-mss": 1460, + "tcp-mss": 1440, "tcp-snd-buf": "(8 * TCP_MSS)", "tcp-wnd": "(TCP_MSS * 8)", "pbuf-pool-size": 16,