Skip to content

Commit

Permalink
performance optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrr committed Jul 14, 2023
1 parent d58f71f commit d588ade
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion include/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
/* Memory allocation related definitions. */
#define configSUPPORT_STATIC_ALLOCATION 1
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#define configTOTAL_HEAP_SIZE (150*1024)
#define configTOTAL_HEAP_SIZE (90*1024)
#define configAPPLICATION_ALLOCATED_HEAP 0

/* Hook function related definitions. */
Expand Down
42 changes: 23 additions & 19 deletions include/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,45 +65,49 @@


//--------------------------------------
// performance tuning (do not change without extensive testing, optimized for ECM)
#define TCP_MSS (1500 - 20 - 20) // MTU minus header sizes (best value til now)
#define TCP_SND_BUF (4 * TCP_MSS) // good tuning
// performance tuning (do not change without extensive testing, optimized for ECM/NCM)
#define TCP_MSS (1500 - 20 - 20) // MTU minus header sizes (best value til now)
#define TCP_SND_BUF (8 * TCP_MSS) // good tuning

//#define TCP_WND (2 * TCP_MSS)
//#define TCP_OVERSIZE TCP_MSS // til now no good value found

//#define TCP_TMR_INTERVAL 50 // TODO just a test (default: 250)
//#define TCP_FAST_INTERVAL 250
//#define TCP_SLOW_INTERVAL 100
//#define TCP_WND TCP_SND_BUF // til now no good value found
#define TCP_SND_QUEUELEN 16
#define TCP_SNDQUEUELOWAT (TCP_SND_QUEUELEN / 2)
#define MEMP_NUM_TCP_SEG 32

//--------------------------------------
// memory
#define MEM_SIZE 20000
//#define MEM_LIBC_MALLOC 1
//#define MEMP_MEM_MALLOC 1
#define MEM_SIZE 20000
//#define MEMP_OVERFLOW_CHECK 1
//#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 1


//--------------------------------------
// for freertos mode
#define TCPIP_MBOX_SIZE 64
#define TCPIP_THREAD_STACKSIZE 8192
#define TCPIP_THREAD_PRIO 11
#define TCPIP_MBOX_SIZE 64
#define TCPIP_THREAD_STACKSIZE 8192
#define TCPIP_THREAD_PRIO 11


//--------------------------------------
// trying...
#define LWIP_PROVIDE_ERRNO 1
#if LWIP_SOCKET
#define LWIP_TIMEVAL_PRIVATE 0 // required for LWIP_SOCKET
#define LWIP_TIMEVAL_PRIVATE 0 // required for LWIP_SOCKET
#endif


//--------------------------------------
// statistics
//#define LWIP_STATS 1
//#define LWIP_STATS_DISPLAY 1
//#define LINK_STATS 1
// use stats_display() for display
#define LWIP_STATS 0
#define LWIP_STATS_DISPLAY 0
#define ETHARP_STATS 0 // do not display the topics below
#define ICMP_STATS 0
#define IPFRAG_STATS 0
#define LINK_STATS 0
#define MEMP_STATS 0
#define SYS_STATS 0
#define UDP_STATS 0


//--------------------------------------
Expand Down

0 comments on commit d588ade

Please sign in to comment.