diff options
| author | iabdalkader <i.abdalkader@gmail.com> | 2023-09-20 15:03:44 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2023-10-03 10:17:51 +1100 |
| commit | 9d5d2e8cf71321b4ba41bad127bf0ea0ff24ccbf (patch) | |
| tree | 91367c85d58f27d8f3a6bd09aa14986f6a95d8b5 | |
| parent | 5c8099003c5db6c398efa611f041f8280e7a32e3 (diff) | |
renesas-ra: Tune lwip buffers and timing to improve network performance.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
| -rw-r--r-- | ports/renesas-ra/lwip_inc/lwipopts.h | 14 | ||||
| -rw-r--r-- | ports/renesas-ra/mpnetworkport.c | 4 |
2 files changed, 10 insertions, 8 deletions
diff --git a/ports/renesas-ra/lwip_inc/lwipopts.h b/ports/renesas-ra/lwip_inc/lwipopts.h index 036da9bce..f7dc80cc3 100644 --- a/ports/renesas-ra/lwip_inc/lwipopts.h +++ b/ports/renesas-ra/lwip_inc/lwipopts.h @@ -42,12 +42,14 @@ extern uint32_t rng_read(void); #define LWIP_RAND() rng_read() -// lwip takes 26700 bytes -#define MEM_SIZE (8000) -#define TCP_MSS (800) -#define TCP_WND (8 * TCP_MSS) -#define TCP_SND_BUF (8 * TCP_MSS) -#define MEMP_NUM_TCP_SEG (32) +#define MEM_SIZE (16 * 1024) +#define TCP_MSS (1460) +#define TCP_OVERSIZE (TCP_MSS) +#define TCP_WND (8 * TCP_MSS) +#define TCP_SND_BUF (8 * TCP_MSS) +#define TCP_SND_QUEUELEN (2 * (TCP_SND_BUF / TCP_MSS)) +#define TCP_QUEUE_OOSEQ (1) +#define MEMP_NUM_TCP_SEG (2 * TCP_SND_QUEUELEN) typedef uint32_t sys_prot_t; diff --git a/ports/renesas-ra/mpnetworkport.c b/ports/renesas-ra/mpnetworkport.c index 2bc6bf439..8e16c2b1b 100644 --- a/ports/renesas-ra/mpnetworkport.c +++ b/ports/renesas-ra/mpnetworkport.c @@ -67,8 +67,8 @@ void mod_network_lwip_init(void) { timer_started = false; } // Start poll timer. - soft_timer_static_init(&network_timer, SOFT_TIMER_MODE_PERIODIC, 128, network_timer_callback); - soft_timer_reinsert(&network_timer, 128); + soft_timer_static_init(&network_timer, SOFT_TIMER_MODE_PERIODIC, 50, network_timer_callback); + soft_timer_reinsert(&network_timer, 50); timer_started = true; } #endif // MICROPY_PY_LWIP |
