feat(lwip): make tcp fast timer to 125ms and make rto to 250ms

This commit is contained in:
Zhang Jun Hao
2018-07-31 11:06:25 +08:00
parent c1a6b556b4
commit c966dd04da
3 changed files with 10 additions and 0 deletions

View File

@ -108,8 +108,13 @@ static u16_t tcp_port = TCP_LOCAL_PORT_RANGE_START;
/* Incremented every coarse grained timer shot (typically every 500 ms). */ /* Incremented every coarse grained timer shot (typically every 500 ms). */
u32_t tcp_ticks; u32_t tcp_ticks;
#if TCP_HIGH_SPEED_RETRANSMISSION
static const u8_t tcp_backoff[13] =
{ 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7};
#else
static const u8_t tcp_backoff[13] = static const u8_t tcp_backoff[13] =
{ 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7}; { 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7};
#endif
/* Times per slowtmr hits */ /* Times per slowtmr hits */
static const u8_t tcp_persist_backoff[7] = { 3, 6, 12, 24, 48, 96, 120 }; static const u8_t tcp_persist_backoff[7] = { 3, 6, 12, 24, 48, 96, 120 };

View File

@ -114,7 +114,11 @@ err_t tcp_process_refused_data(struct tcp_pcb *pcb);
#define TCP_SEQ_BETWEEN(a,b,c) (TCP_SEQ_GEQ(a,b) && TCP_SEQ_LEQ(a,c)) #define TCP_SEQ_BETWEEN(a,b,c) (TCP_SEQ_GEQ(a,b) && TCP_SEQ_LEQ(a,c))
#ifndef TCP_TMR_INTERVAL #ifndef TCP_TMR_INTERVAL
#if TCP_HIGH_SPEED_RETRANSMISSION
#define TCP_TMR_INTERVAL 125 /* The TCP timer interval in milliseconds. */
#else
#define TCP_TMR_INTERVAL 250 /* The TCP timer interval in milliseconds. */ #define TCP_TMR_INTERVAL 250 /* The TCP timer interval in milliseconds. */
#endif
#endif /* TCP_TMR_INTERVAL */ #endif /* TCP_TMR_INTERVAL */
#ifndef TCP_FAST_INTERVAL #ifndef TCP_FAST_INTERVAL

View File

@ -62,6 +62,7 @@
//#define SOCKETS_TCP_TRACE //#define SOCKETS_TCP_TRACE
#define TCP_HIGH_SPEED_RETRANSMISSION CONFIG_TCP_HIGH_SPEED_RETRANSMISSION
/* /*
------------------------------------ ------------------------------------