8000 renesas-ra: Tune lwip buffers and timing to improve network performance. · micropython/micropython@9d5d2e8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9d5d2e8

Browse files
iabdalkaderdpgeorge
authored andcommitted
renesas-ra: Tune lwip buffers and timing to improve network performance.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
1 parent 5c80990 commit 9d5d2e8

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

ports/renesas-ra/lwip_inc/lwipopts.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@
4242
extern uint32_t rng_read(void);
4343
#define LWIP_RAND() rng_read()
4444

45-
// lwip takes 26700 bytes
46-
#define MEM_SIZE (8000)
47-
#define TCP_MSS (800)
48-
#define TCP_WND (8 * TCP_MSS)
49-
#define TCP_SND_BUF (8 * TCP_MSS)
50-
#define MEMP_NUM_TCP_SEG (32)
45+
#define MEM_SIZE (16 * 1024)
46+
#define TCP_MSS (1460)
47+
#define TCP_OVERSIZE (TCP_MSS)
48+
#define TCP_WND (8 * TCP_MSS)
49+
#define TCP_SND_BUF (8 * TCP_MSS)
50+
#define TCP_SND_QUEUELEN (2 * (TCP_SND_BUF / TCP_MSS))
51+
#define TCP_QUEUE_OOSEQ (1)
52+
#define MEMP_NUM_TCP_SEG (2 * TCP_SND_QUEUELEN)
5153

5254
typedef uint32_t sys_prot_t;
5355

ports/renesas-ra/mpnetworkport.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ void mod_network_lwip_init(void) {
6767
timer_started = false;
6868
}
6969
// Start poll timer.
70-
soft_timer_static_init(&network_timer, SOFT_TIMER_MODE_PERIODIC, 128, network_timer_callback);
71-
soft_timer_reinsert(&network_timer, 128);
70+
soft_timer_static_init(&network_timer, SOFT_TIMER_MODE_PERIODIC, 50, network_timer_callback);
71+
soft_timer_reinsert(&network_timer, 50);
7272
timer_started = true;
7373
}
7474
#endif // MICROPY_PY_LWIP

0 commit comments

Comments
 (0)
0