Quantcast

Ethernet DMA on Tobi Board

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Ethernet DMA on Tobi Board

Quentintin
This post has NOT been accepted by the mailing list yet.
Hi everybody,

I'm working on a project where we use a Gumstix Overo Water COM with a Tobi board as an embedded system.
I need to transfert data (An array of 100 000 points of "double") between Overo/Tobi and an other computer, so I use Ethernet connection.

The main problem is the DMA doesn't seem to be enabled.
Actually, when I send my array, the CPU load is about 80 % (with "top" command).

Do you have any suggest to enable Ethernet DMA ?

This is a big part of my job, and i'm searching for 6 month with no results, that's why I've decided to ask here.
Thanks a lot
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ethernet DMA on Tobi Board

Scott Ellis
Just checked with iperf, AirStorm COM, 3.2 kernel (because that's
what I'm sitting in front of)

The load shown by top/htop stayed around 35% for the
entire 5 minutes.

root@overo:~# iperf -c 192.168.10.8 -t300
------------------------------------------------------------
Client connecting to 192.168.10.8, TCP port 5001
TCP window size: 19.6 KByte (default)
------------------------------------------------------------
[  3] local 192.168.10.111 port 40817 connected with 192.168.10.8 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-300.0 sec  3.27 GBytes  93.7 Mbits/sec

An 80% load sounds like it might have something to do with how you
are sending the data. You aren't likely to beat iperf, but it's provides a
benchmark for what the system is capable of.

If I'm calculating correctly, 100,000 8-byte points of data should transfer
in about 70 msec at 93.7 Mbits/sec.

(64 * 100000) / 93,700,000 = 0.068 sec

Is that what you see?


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ethernet DMA on Tobi Board

Quentintin
This post has NOT been accepted by the mailing list yet.
Thanks for your answer !
Sorry, but can you explain me how to install IPERF tool ?
i've several µSD card with different OS (Angstrom Linux 3.0, Yocto Linux 3.5) but IPERF is not present.
I tried to install it with Package manager (OPKG for Angstrom, SMART for Yocto) but it didn't work because the package doesn't exist in each case.

smart install iperf
opkg install iperf


Didn't work

Moreover, you said your report with htop show 35% of load. If the DMA will be enabled, we should get 0-1% of CPU Load ???!!! (We can just say your CPU is better than mine (WaterCOM))

I really need to know if we can enable the DMA or not ? and if it is possible, how ? (You will be very helpful because it's my main task in my sandwich course  )
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ethernet DMA on Tobi Board

Scott Ellis
I'm using my own O/S image built with Yocto. I  added the iperf
package to my  build.

I took  a look and you are right about DMA not being used.

There is no DMA code at all in the smsc911x.c driver, so it's  not
something you can simply enable.

Maybe it was a design decision since socket packet sizes can vary so
much. Setting up DMA for small transfers might be more expensive
then an assembler 'memcpy' which is effectively how it's done now.

Big block transfers would probably benefit from DMA.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ethernet DMA on Tobi Board

Scott Ellis
>> then an assembler 'memcpy' which is effectively how it's done now.

That's not correct.

smsc911x_tx_writefifo()
  --> writesl()
    --> __raw_writesl()

__raw_writesl() is a port write (outsl) not a memcpy.

I don't know if you can use DMA for that.

Maybe that's the reason.

Someone else on this list might know.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ethernet DMA on Tobi Board

Quentintin
This post has NOT been accepted by the mailing list yet.
Thanks for searching on your side.

I hope other people from this community will come here, to help us in this problem.

@Scott, nothing in sms911x driver permit us to enable DMA or to use it, isn't it ?

I'm very wondered  that no one in this forum ask himself about the DMA (for all Gumstix Board, the problem is the same !?)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ethernet DMA on Tobi Board

Scott Ellis
You didn't say where your data was coming from or how often
you need to transmit those 100K doubles over the network.

I'm working on a system right now where we transmit roughly
93K  samples per second from an Overo over ethernet.

It's 8 x 4-bytes of data per sample. It works out to 3 MB/s or
24 Mb/s.

We run continuously with less then 10% load on the system.
There are plenty of cycles left to monitor and control a number
of  other components connected to this same Overo.

Assuming you need to transmit your 100K x 8 byte array every
second,  that's only 800 kB/s = 6.4 Mb/s.

Considerably less then what we are doing. Maybe your problem
is not the ethernet, but in the way you are collecting or generating
your data?

If you are trying to transmit data continuously and not just once
a second then yes it's still a problem and this doesn't apply.

Have you considered using single-point floats instead of doubles?

The OMAP cpus handle single-point floats more efficiently.

https://wiki.debian.org/ArmHardFloatPort/VfpComparison
https://pixhawk.ethz.ch/omap/optimization/arm_cortex_a8

And going from double -> float would cut your data in half.

Or if you really need more horsepower, the Duoveros cost
about  the same as the Overos. If you are running the cpu
this hard, I'm guessing low power is not your major concern.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ethernet DMA on Tobi Board

Quentintin
This post has NOT been accepted by the mailing list yet.
My data comes from a probe. I don't care about Signal Treatment. I just need to send this 100K double array from memory address to another PC (micro-ATX for details). Currently, I use a little C program to send data (here in this exemple below, I send 100 packet of 1K double at 10 Hz) and in other side, i get my data with LabVIEW program.
double data[1000];
int i;
for (i=0; i < 1000; i++)
    {
        data[i] = i;
    }



int length = sizeof(data);
int k;
while(1){
	for(k=0; k < 100; k++){
		send(conn_s, data, length,NULL);
	}
	nanosleep((struct timespec[]){{0, 100000000}}, NULL);		//10 Hz
}
See attached file to see more details about socket : echoserv.c I made some tries for differents size of packet : In each case, the data rate is the same : 6.4 Mbits at 10Hz => 64 Mbs
CPU load (packet size/number) at 10 Hz
Packets number Packets size (of double) CPU Load (with top)
#1 1 100K 12.4 %
#2 10 10K 7%
#3 100 1K 5.6%
#4 1000 100 7.3 %
As we can see, the best way to send data is to send one hundred packet of 1K double. Any advice about my C program to send data ? Should I send my data with a RAW protocol (and avoid TCP/UDP) to perform data rate ? Bye ;)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ethernet DMA on Tobi Board

Quentintin
UP
Loading...