[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] message api bug and throughput problem
From: |
kuschel |
Subject: |
[lwip-users] message api bug and throughput problem |
Date: |
Mon, 22 Mar 2004 12:27:46 +0100 |
Hi all!
I have two problems:
1. Possible mailbox bug in the message api
2. Throughput problem
1. Possible mailbox bug in the message api
------------------------------------------
I believe I have found a bug in the message api. When a connection is closed by
a remote host, sys_mbox_free() is called while just one mail is present in the
box. sys_arch.txt says:
" - void sys_mbox_free(sys_mbox_t mbox)
Deallocates a mailbox. If there are messages still present in the
mailbox when the mailbox is deallocated, it is an indication of a
programming error in lwIP and the developer should be notified. "
I have debugged this using the socket based chargen test program. The client is
a Windows machine running a special testprogram that connects to port 19 and
measures the throughput. The error happens when I close the Windows program.
Here is a list of mailbox calls affecting the mailbox conn->mbox that does the
error:
A new connection comes in:
accept_function(): calls conn->mbox = sys_mbox_new()
chargen writes data using the socket function
lwip_write() several times:
do_write() : calls sys_mbox_post(conn->mbox)
netconn_write() : calls sys_mbox_fetch(conn->mbox)
do_write() : calls sys_mbox_post(conn->mbox)
netconn_write() : calls sys_mbox_fetch(conn->mbox)
do_write() : calls sys_mbox_post(conn->mbox)
netconn_write() : calls sys_mbox_fetch(conn->mbox)
... and so on ...
The Windows host closes the connection. lwIP does now:
do_write() : calls sys_mbox_post(conn->mbox)
err_tcp() : calls sys_mbox_post(conn->mbox)
netconn_write() : calls sys_mbox_fetch(conn->mbox)
The mailbox contains now the mail sent by err_tcp().
netconn_delete(): calls sys_mbox_fetch(conn->mbox)
do_delconn() : calls sys_mbox_post(conn->mbox)
netconn_delete(): calls sys_mbox_free(conn->mbox)
As you can see, netconn_delete() gets the mail sent by err_tcp() just before
do_delconn() sends the mail destined for netconn_delete(). The call to
sys_mbox_free() fails now since the mailbox contains yet one mail.
Is there any reason why err_tcp() posts a mail to conn->mbox? Which function is
normally waiting for this mail?
2. Throughput problem
---------------------
I am running lwIP on a PowerPC 440GP at 400MHz with uCOS-II. For our
application I need a throughput of at least 35 MBit/s. The throughput I get is
only 7.6 kB/s per connection. I can open multiple connections each running at
7.6 kB/s while the PowerPC is still lazy at 3% CPU usage. Has anybody observed
the same behaviour? I have tried to increase the tcp timer rate but without
luck. I am using chargen.c from the lwIP contribution package for my test.
Help is welcome.
Dennis
- [lwip-users] message api bug and throughput problem,
kuschel <=