lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Re: AW: Problem of tcp_write with more then about 20 kBytes


From: Diego
Subject: [lwip-users] Re: AW: Problem of tcp_write with more then about 20 kBytes
Date: Fri, 10 Dec 2010 20:04:03 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

ops..

that was my httpd.c..

my custom lwipopts.h(without the tips that you said):


#ifndef _LWIPOPTS_H
#define _LWIPOPTS_H

/// No system support
/// (no sys api_msg api_lib)
#define NO_SYS                          1

/// Callback API ? Event API
#define LWIP_CALLBACK_API               1

/// The byte order
#define BYTE_ORDER                      LITTLE_ENDIAN

/* ---------- Memory options ---------- */
#define MEM_LIBC_MALLOC                 0

/* MEM_ALIGNMENT: should be set to the alignment of the CPU for which
   lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
   byte alignment -> define MEM_ALIGNMENT to 2. */
#define MEM_ALIGNMENT                   4

/* MEM_SIZE: the size of the heap memory. If the application will send
a lot of data that needs to be copied, this should be set high. */
#define MEM_SIZE                        1600

#define MEMP_OVERFLOW_CHECK             0
#define MEMP_SANITY_CHECK               0

/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
   sends a lot of data out of ROM (or other static memory), this
   should be set high. */
#define MEMP_NUM_PBUF                   4

/* Number of raw connection PCBs */
#define MEMP_NUM_RAW_PCB                0

/* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
   per active UDP "connection". */
#define MEMP_NUM_UDP_PCB                1

/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
   connections. */
#define MEMP_NUM_TCP_PCB                2

/* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
   connections. */
#define MEMP_NUM_TCP_PCB_LISTEN         2

/* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
   segments. */
#define MEMP_NUM_TCP_SEG                5

/* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
   timeouts. */
#define MEMP_NUM_SYS_TIMEOUT            0

/* The following four are used only with the sequential API and can be
   set to 0 if the application only will use the raw API. */
/* MEMP_NUM_NETBUF: the number of struct netbufs. */
#define MEMP_NUM_NETBUF                 0
/* MEMP_NUM_NETCONN: the number of struct netconns. */
#define MEMP_NUM_NETCONN                0
/* MEMP_NUM_APIMSG: the number of struct api_msg, used for
   communication between the TCP/IP stack and the sequential
   programs. */
#define MEMP_NUM_API_MSG                0
/* MEMP_NUM_TCPIPMSG: the number of struct tcpip_msg, which is used
   for sequential API communication and incoming packets. Used in
   src/api/tcpip.c. */
#define MEMP_NUM_TCPIP_MSG              0

/* ---------- Pbuf options ---------- */
/* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
#define PBUF_POOL_SIZE                  6

/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
#define PBUF_POOL_BUFSIZE               256

/* ---------- ARP options ---------- */
#define LWIP_ARP                        1
/** Number of active hardware address, IP address pairs cached */
#define ARP_TABLE_SIZE                  2

/**
 * If enabled, outgoing packets are queued during hardware address
 * resolution.
 *
 * This feature has not stabilized yet. Single-packet queueing is
 * believed to be stable, multi-packet queueing is believed to
 * clash with the TCP segment queueing.
 * 
 * As multi-packet-queueing is currently disabled, enabling this
 * _should_ work, but we need your testing feedback on lwip-users.
 *
 */
#define ARP_QUEUEING                    0

/* ---------- IP options ---------- */
/* Define IP_FORWARD to 1 if you wish to have the ability to forward
   IP packets across network interfaces. If you are going to run lwIP
   on a device with only one network interface, define this to 0. */
#define IP_FORWARD                      0

/* If defined to 1, IP options are allowed (but not parsed). If
   defined to 0, all packets with IP options are dropped. */
#define IP_OPTIONS                      0

/** IP reassembly and segmentation. Even if they both deal with IP
 *  fragments, note that these are orthogonal, one dealing with incoming
 *  packets, the other with outgoing packets
 */

/** Reassemble incoming fragmented IP packets */
#define IP_REASSEMBLY                   0

/** Fragment outgoing IP packets if their size exceeds MTU */
#define IP_FRAG                         0

/* IP reassemly default age in seconds */
#define IP_REASS_MAXAGE                 3

/* IP reassembly buffer size (minus IP header) */
#define IP_REASS_BUFSIZE                2048

/* Assumed max MTU on any interface for IP frag buffer */
#define IP_FRAG_MAX_MTU                 1500


/* ---------- ICMP options ---------- */
#define LWIP_ICMP                       1
#define ICMP_TTL                        255

/* ---------- RAW options ---------- */
#define LWIP_RAW                        0

/* ---------- DHCP options ---------- */
/* Define LWIP_DHCP to 1 if you want DHCP configuration of
   interfaces. DHCP is not implemented in lwIP 0.5.1, however, so
   turning this on does currently not work. */
static int LWIP_DHCP = 0;

/* 1 if you want to do an ARP check on the offered address
   (recommended). */
#define DHCP_DOES_ARP_CHECK             1

/* ---------- SNMP options ---------- */
/** @note UDP must be available for SNMP transport */
#define LWIP_SNMP                       0

/* ---------- UDP options ---------- */
#define LWIP_UDP                        0

/* ---------- TCP options ---------- */
#define LWIP_TCP                        1

/* TCP receive window. */
#define TCP_WND                         1024

/* Maximum number of retransmissions of SYN segments. */
#define TCP_SYNMAXRTX                   2

/* Controls if TCP should queue segments that arrive out of
   order. Define to 0 if your device is low on memory. */
#define TCP_QUEUE_OOSEQ                 0

/* TCP Maximum segment size. */
#define TCP_MSS                         128

/* TCP sender buffer space (bytes). */
#define TCP_SND_BUF                     1536

/* TCP sender buffer space (pbufs). This must be at least = 2 *
   TCP_SND_BUF/TCP_MSS for things to work. */
#define TCP_SND_QUEUELEN                2 * TCP_SND_BUF/TCP_MSS

/* ---------- LOOPIF options ---------- */
/* Support loop interface (127.0.0.1) and loopif.c */
#define LWIP_HAVE_LOOPIF                0

/* ---------- Sequential layer options ---------- */
/* Enable Netconn API (require to use api_lib.c) */
//#define LWIP_NETCONN                    1

/* ---------- Socket options ---------- */
/* Enable Socket API (require to use sockets.c) */
#define LWIP_SOCKET                     0

/* ---------- Statistics options ---------- */
#define LWIP_STATS                      0







/* ---------- Debug Trace options ---------- */

/// Debug settings
#define LWIP_NOASSERT
//#define LWIP_DEBUG      1

#ifdef LWIP_DEBUG
#define DBG_TYPES_ON        1

#define ICMP_DEBUG          DBG_ON
#define TCP_DEBUG           DBG_ON
#define TCP_INPUT_DEBUG     DBG_ON
#define TCP_OUTPUT_DEBUG    DBG_ON
#endif

#endif





reply via email to

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