lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] performance in sending / receiving


From: Robert Goeffringmann
Subject: Re: [lwip-users] performance in sending / receiving
Date: Thu, 15 Feb 2007 16:03:02 +0100

Hi Kieran,
I'm sorry for the delay in getting back to you, I've been busy with exams lately. :/

Having had a look at your ethereal captures I see it advertising up to
around 42KB.  A full capture (from the start of a connection) in pcap
rather than txt format would enable me to look at this more precisely.

Actually, in this case (with the benefit of looking at your packet
capture) it looks like the stack is processing the packets at a
reasonable rate (the ACK numbers are increasing) but the window is still
decreasing.  This suggests that the packets are being buffered in the
sockets API layer, and the application is not reading them fast enough.
ie. This could be a scheduling issue.

That'd make sense.
The PS2 kernel doesn't do any automatic scheduling, it'll simply execute the thread with the highest priority which is not waiting for a semaphore or messagebox at the moment.

right now I have the threads structured like this (highest to lowest priority):

- highest priority is the thread for the HW interface, it takes lwip's packets from a queue and passes them to the HW (or reads them from the HW and passes them to lwip...) - the next thread is the timer thread, which only calls tcp_tmr and etharp_tmr periodically
- then there's lwip's tcp/ip thread
- and the lowest thread is the application doing the the send/recv calls.

This structure has worked pretty well for sending data, but indeed it did seem to cause those zero-windows. I've changed it and made the tcp/ip thread the one with the lowest priority and it fixed that... but unfortunately it has rather little influence on the receive speed. With the application having the lowest priority, I had transfer rates of ~1,6MB/s (average), with the actual transmission speed varying between 1,3 and 2,0 MB/s. If the tcp/ip thread has the lowest priority, the average speed is ~1,8MB/s, varying between 1,0 and 1,9 MB/s.

I uploaded the pcap files and lwip's statistics here:
http://www.goeffringmann.de/lwip/thprio.zip

the prio1 file is the one with the application having the lowest priority, in prio50 it's the tcp/ip thread.

Is there anything like a suggested model for those thread priorities?

I also wrote a checksum routine in assembly, but no matter if I use that one or lwip's most basic one doesn't have any difference at all on either sending- or receiving speed. So I suppose I can assume that cpu power is not the bottleneck... right?

Thanks a lot for your help,

Robert.







reply via email to

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