TCP Performance tuning of lwIP

This commit is contained in:
Joseph Henry
2019-02-14 18:40:20 -08:00
parent 8b4921432e
commit 0b287dbcab

View File

@@ -78,7 +78,7 @@
/** /**
* Used to compute TCP_MSS * Used to compute TCP_MSS
*/ */
#define MTU 1500 #define MTU 2800
/** /**
* Enable or disable debug, see debug ection near end of file * Enable or disable debug, see debug ection near end of file
@@ -1319,7 +1319,7 @@ happening sooner than they should.
* will be TCP_WND >> TCP_RCV_SCALE * will be TCP_WND >> TCP_RCV_SCALE
*/ */
#if !defined TCP_WND || defined __DOXYGEN__ #if !defined TCP_WND || defined __DOXYGEN__
#define TCP_WND 0xffff // (4 * TCP_MSS) #define TCP_WND 0xFFFF // (4 * TCP_MSS)
#endif #endif
/** /**
@@ -1373,7 +1373,7 @@ happening sooner than they should.
* an upper limit on the MSS advertised by the remote host. * an upper limit on the MSS advertised by the remote host.
*/ */
#if !defined TCP_MSS || defined __DOXYGEN__ #if !defined TCP_MSS || defined __DOXYGEN__
#define TCP_MSS MTU - 40 #define TCP_MSS (MTU - 40)
#endif #endif
/** /**
@@ -1394,7 +1394,7 @@ happening sooner than they should.
* To achieve good performance, this should be at least 2 * TCP_MSS. * To achieve good performance, this should be at least 2 * TCP_MSS.
*/ */
#if !defined TCP_SND_BUF || defined __DOXYGEN__ #if !defined TCP_SND_BUF || defined __DOXYGEN__
#define TCP_SND_BUF 1024 * 32 // (2 * TCP_MSS) #define TCP_SND_BUF (32 * TCP_MSS)
#endif #endif
/** /**
@@ -1402,7 +1402,7 @@ happening sooner than they should.
* as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work.
*/ */
#if !defined TCP_SND_QUEUELEN || defined __DOXYGEN__ #if !defined TCP_SND_QUEUELEN || defined __DOXYGEN__
#define TCP_SND_QUEUELEN 1024 // ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS)) #define TCP_SND_QUEUELEN (64 * (2 * (TCP_SND_BUF/TCP_MSS))) // 1024 // ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS))
#endif #endif
/** /**
@@ -1411,7 +1411,8 @@ happening sooner than they should.
* TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT). * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT).
*/ */
#if !defined TCP_SNDLOWAT || defined __DOXYGEN__ #if !defined TCP_SNDLOWAT || defined __DOXYGEN__
#define TCP_SNDLOWAT LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1) #define TCP_SNDLOWAT (0xffff - (4*TCP_MSS) - 1)
//#define TCP_SNDLOWAT LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1)
#endif #endif
/** /**
@@ -1549,7 +1550,7 @@ happening sooner than they should.
* send window while having a small receive window only. * send window while having a small receive window only.
*/ */
#if !defined LWIP_WND_SCALE || defined __DOXYGEN__ #if !defined LWIP_WND_SCALE || defined __DOXYGEN__
#define LWIP_WND_SCALE 0 #define LWIP_WND_SCALE 1
#define TCP_RCV_SCALE 0 #define TCP_RCV_SCALE 0
#endif #endif
@@ -3333,7 +3334,7 @@ happening sooner than they should.
* @see debugging_levels * @see debugging_levels
*/ */
#if !defined LWIP_DBG_TYPES_ON || defined __DOXYGEN__ #if !defined LWIP_DBG_TYPES_ON || defined __DOXYGEN__
#define LWIP_DBG_TYPES_ON LWIP_DBG_OFF #define LWIP_DBG_TYPES_ON LWIP_DBG_ON
#endif #endif
/** /**
@@ -3375,7 +3376,7 @@ happening sooner than they should.
* SOCKETS_DEBUG: Enable debugging in sockets.c. * SOCKETS_DEBUG: Enable debugging in sockets.c.
*/ */
#if !defined SOCKETS_DEBUG || defined __DOXYGEN__ #if !defined SOCKETS_DEBUG || defined __DOXYGEN__
#define SOCKETS_DEBUG LWIP_DBG_OFF #define SOCKETS_DEBUG LWIP_DBG_ON
#endif #endif
/** /**