From f3bbd2b4ddf8fbf8a8f007868a7cf12310b9b757 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Fri, 21 Dec 2018 15:35:05 +0200 Subject: [PATCH] Allow LwIP TCP retransmissions to be configured and tune those smaller. Currently, LwIP segment retransmission time is 12, which is very long time as each timeout doubles the retransmission timeout. Make that to 6 as that is same what we use in Nanostack. --- features/lwipstack/lwipopts.h | 8 ++++++++ features/lwipstack/mbed_lib.json | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/features/lwipstack/lwipopts.h b/features/lwipstack/lwipopts.h index 3a3ce6c85e..326d2b0ba3 100644 --- a/features/lwipstack/lwipopts.h +++ b/features/lwipstack/lwipopts.h @@ -159,6 +159,14 @@ #define TCP_WND MBED_CONF_LWIP_TCP_WND #endif +#ifdef MBED_CONF_LWIP_TCP_MAXRTX +#define TCP_MAXRTX MBED_CONF_LWIP_TCP_MAXRTX +#endif + +#ifdef MBED_CONF_LWIP_TCP_SYNMAXRTX +#define TCP_SYNMAXRTX MBED_CONF_LWIP_TCP_SYNMAXRTX +#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 f9edca1620..245203f60f 100644 --- a/features/lwipstack/mbed_lib.json +++ b/features/lwipstack/mbed_lib.json @@ -88,6 +88,14 @@ "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 }, + "tcp-maxrtx": { + "help": "Maximum number of retransmissions of data segments.", + "value": 6 + }, + "tcp-synmaxrtx": { + "help": "Maximum number of retransmissions of SYN segments. Current default (used if null here) is set to 6 in opt.h", + "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 @@ -125,7 +133,7 @@ "mem-size": 25600 }, "Freescale": { - "mem-size": 36560 + "mem-size": 16384 }, "LPC1768": { "mem-size": 16362