lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [lwip-users] LWIP configuration to maximize TCP throughputgivenRAM c


From: Bruce Sutherland
Subject: RE: [lwip-users] LWIP configuration to maximize TCP throughputgivenRAM constraints
Date: Tue, 21 Oct 2008 13:17:52 +0800

Thanks Piero and Kieran.

I've done some experimentation, but I am a bit stuck. My configuration
appears below.

I would like to change PBUF_POOL_BUFSIZE from the default of TCP_MSS + 40 +
14, to Piero's value of 128, then increase PBUF_POOL_SIZE as appropriate.
However, when I do this, I find that incoming TCP packets are being
truncated to 74 bytes of data (128 - (40 + 14)).

In my stream receive callback function:

err_t StreamRecvCallback(void *arg, struct tcp_pcb *tpcb, struct pbuf* p,
err_t err);

I always receive only a single buffer in variable p. The p->next field is
always null, although it should point to the next portion of the data. Do I
have an issue in my configuration, or is it likely in my code? Configuration
pasted below.

Thank you,

Bruce.


/* Align memory on 4 byte boundery (32-bit) */
#define MEM_ALIGNMENT                   4

/* No operating system present */
#define NO_SYS                          1
#define LWIP_SOCKET                     0
#define LWIP_NETCONN                    0
#define LWIP_CALLBACK_API               1

/* LWIP's self-managed heap size, used for malloc defined in mem.c */
#define MEM_SIZE                        2048
// used if doing tcp_write with TCP_WRITE_FLAG_COPY flag

/* LWIP's pool memory, used for structures defined in memp.c */
//#define MEM_USE_POOLS                   1
#define MEMP_SANITY_CHECK               1
#define MEMP_OVERFLOW_CHECK             2

#define LWIP_STATS                      1
#define IP_STATS                        1

#define LWIP_ARP                        1
//#define LWIP_UDP                        1
#define LWIP_UDP                        0

/* Changes to reduce memory usage */
#define MEMP_NUM_PBUF                   10  // default 16
//#define MEMP_NUM_UDP_PCB                2   // default 4
#define MEMP_NUM_TCP_PCB                3   // default 6
#define MEMP_NUM_TCP_PCB_LISTEN         4   // default 8
//#define PBUF_POOL_BUFSIZE               LWIP_MEM_ALIGN_SIZE(128)    //
default TCP_MSS + 40 + 14
#define IP_FRAG                         0

/* Changes to improve TCP performance */
//#define TCP_MSS                         1460  // default 128
#define TCP_MSS                         768  // default 128
#define TCP_SND_BUF                     (TCP_MSS<<1)  // default 256





reply via email to

[Prev in Thread] Current Thread [Next in Thread]