Hello, I've ported lwip 1.4.0 to an ST7105 dev set-top box (450 MHz SH-4 core, Fast Ethernet port).
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATA_BRIEF/CD00209329.pdf The STB is connected directly to my PC (no switch or router). I've written code on the STB to receive a TCP stream on port 44044, and code on the PC to send a TCP stream to that port. I send 58,400,000 bytes from the PC to the STB. This takes 14.25 seconds, i.e. an average of 33 Mbit/s I was expecting to reach 80+ Mbit/s, so I captured the conversation with Wireshark, and I noticed that the sender is being throttled because the receiver (the STB running lwip) is not sending ACKs fast enough. cf. STB_TCP_RX_2.pcap (6 MB -- I truncated payloads to 100 bytes) http://dl.free.fr/tKDBuYTrc (I've also attached a copy of my current lwipopts.h) Can someone nudge me in the right direction to optimize my build of lwip? Here's the code I run on the STB (it runs in a dedicated thread with priority MIN_PRIO+4, same as tcpip_thread) int sock = socket(PF_INET, SOCK_STREAM, 0); if (sock < 0) { perror("socket"); return -1; } struct sockaddr_in addr = { 0, AF_INET, htons(44044), }; err = bind(sock, (struct sockaddr *)&addr, sizeof addr); if (err) { perror("bind"); return -2; } err = listen(sock, 10); if (err) { perror("listen"); return -3; } struct sockaddr_in from = { 0 }; socklen_t len = sizeof from; int sock2 = accept(sock, (struct sockaddr *)&from, &len); if (sock2 < 0) { perror("accept"); return -4; } #define BUF_LEN (4*1460) u8_t *buf = malloc(BUF_LEN); while ( 1 ) { int res = read(sock2, buf, BUF_LEN); if (res <= 0) break; } free(buf); -- Regards.
#define SYS_LIGHTWEIGHT_PROT 1 #define MEM_LIBC_MALLOC 1 /*** POUR TESTER !!! ***/ #define MEMP_MEM_MALLOC 1 /*** POUR TESTER !!! ***/ #define MEM_ALIGNMENT 4 #define MEMP_NUM_UDP_PCB 10 #define MEMP_NUM_TCP_PCB 10 #define MEMP_NUM_TCP_SEG 40 #define MEMP_NUM_SYS_TIMEOUT 8 #define PBUF_POOL_SIZE 40 //#define ETH_PAD_SIZE 2 #define IP_REASSEMBLY 0 /*** JE TESTE SANS DEFRAG ***/ #define IP_DEFAULT_TTL 240 /*** POUR TESTER ***/ #if 0 #define IP_SOF_BROADCAST 1 #define IP_SOF_BROADCAST_RECV 1 #endif #define LWIP_BROADCAST_PING 1 #define LWIP_RAW 0 #define LWIP_DHCP 1 #define LWIP_DNS 1 #define DNS_TABLE_SIZE 40 /*** A REGARDER DE TRES PRES !!! ***/ #define TCP_MSS 1460 #define TCP_WND (40*TCP_MSS) #define TCP_SND_BUF (8*TCP_MSS) #define TCP_SND_QUEUELEN 16 //#define LWIP_NETIF_LOOPBACK 1 #if 0 #define TCPIP_THREAD_STACKSIZE OS21_DEF_MIN_STACK_SIZE #define TCPIP_THREAD_PRIO MIN_USER_PRIORITY #endif #define TCPIP_MBOX_SIZE 200 #define LWIP_STATS 0 //#define SOCKETS_DEBUG LWIP_DBG_ON /*** TEST ***/ #define LWIP_TIMEVAL_PRIVATE 0
_______________________________________________ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users