feat(lwip): Add kconfig to congigure initial RTO time and set default value to 1000

This commit is contained in:
yuanjm
2020-03-26 11:58:18 +08:00
parent 76af8bdbff
commit 417a6078a8
4 changed files with 21 additions and 2 deletions

View File

@@ -479,6 +479,13 @@ config LWIP_TCP_TIMESTAMPS
really used locally. Therefore, it is only enabled when a TS option is
received in the initial SYN packet from a remote host.
config LWIP_TCP_RTO_TIME
int "Default TCP RTO TIME"
default 1000
help
Set default TCP RTO time for a reasonable initial RTO.
Advise to set initial RTO to 1 second
endmenu # TCP
menu "UDP"

View File

@@ -1630,8 +1630,9 @@ tcp_alloc(u8_t prio)
/* As initial send MSS, we use TCP_MSS but limit it to 536.
The send MSS is updated when an MSS option is received. */
pcb->mss = INITIAL_MSS;
pcb->rto = 3000 / TCP_SLOW_INTERVAL;
pcb->sv = 3000 / TCP_SLOW_INTERVAL;
/* make TCP's retransmission time to be configurable */
pcb->rto = LWIP_TCP_RTO_TIME / TCP_SLOW_INTERVAL;
pcb->sv = LWIP_TCP_RTO_TIME / TCP_SLOW_INTERVAL;
pcb->rtime = -1;
pcb->cwnd = 1;
pcb->tmr = tcp_ticks;

View File

@@ -1350,6 +1350,11 @@
#define LWIP_WND_SCALE 0
#define TCP_RCV_SCALE 0
#endif
#if !defined LWIP_TCP_RTO_TIME || defined __DOXYGEN__
#define LWIP_TCP_RTO_TIME 3000
#endif
/**
* @}
*/

View File

@@ -1097,6 +1097,12 @@ size_t memp_malloc_get_size(size_t type);
*/
#define LWIP_WND_SCALE 0
#define TCP_RCV_SCALE 0
/**
* LWIP_TCP_RTO_TIME: make TCP RTO time configurable.
* Default is 1 second.
*/
#define LWIP_TCP_RTO_TIME CONFIG_LWIP_TCP_RTO_TIME
/**
* @}
*/