Skip to contentSkip to conversation

TCP/IP send, sendfile, RAW

DISCUSSION Roy Rietveld 2 participants 3 messages May 5, 2006 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

the platform is a netsilicon NS9360 witch include an 100MBit ethernet device. The driver came with the software(LxNETES) for the development board. CPU load is 100% when running sender program.

cat /proc/interrupts; sleep 10; cat /proc/interrupts doen't work anymore because cpu is to busy.

Does sendto give other processes time when the hardware is transmitting data? Is this bad hardware or is the cost of sendto that high.

Quoted 46 lines

From: Pádraig Brady <[email protected]>
To: Roy Rietveld <[email protected]>
Subject: Re: TCP/IP send, sendfile, RAW
Date: Fri, 05 May 2006 10:09:49 +0100

Quoted 13 lines · Roy Rietveld

Can somebody help me with this.

I'am new to Linux normaly i do programming for RTOS.

I would like to send ethernet packets with 1400 bytes payload. I wrote a small program witch sends a buffer of 1400 bytes in a endless loop.
The problem is that a would like 100Mbits throughtput but when i check this with ethereal.
I only get 40 MBits. I tried sending with an UDP socket and RAW socket. I also tried sendfile.
The RAW socket gives the best result till now 50 MBits throughtput.

Quoted 3 lines

Is there something faster then send or am i doing something wrong.

I'm running kernel 2.6 on a ARM9 core at 177Mhz 32RAM 32Flash.

Is this the platform for both sender and receiver?

What you have to consider is processing required per packet. At 50Mb/s you are getting for following number of packets per second:

$ echo "(50*10^6)/8/(12+8+14+20+8+1400+4)" | bc
4263

I'm guessing that the receiver or sender is running out of CPU at this rate? Also maybe this number of interrupts/s may be an issue on this platform? You can check the interrupt rate easilty enough with:
cat /proc/interrupts; sleep 10; cat /proc/interrupts

Note by default ethereal (libpcap) will use 3 syscalls per packet to copy and timestamp each packet. Have a look at PACKET_MMAP to alleviate this.

At the interrupt level you could use NAPI or interrupt coalescing etc. What driver are you using?

Pádraig.

#2 lore raw
Quoted 8 lines · Roy Rietveld

the platform is a netsilicon NS9360 witch include an 100MBit ethernet device. The driver came with the software(LxNETES) for the development board. CPU load is 100% when running sender program.

cat /proc/interrupts; sleep 10; cat /proc/interrupts doen't work anymore because cpu is to busy.

Does sendto give other processes time when the hardware is transmitting data? Is this bad hardware or is the cost of sendto that high.

Try sending UDP over loopback and see.

Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
#3 lore raw

Thanks now i know, the stack is slow 40MBit on loopback.

Quoted 26 lines

From: Avi Kivity <[email protected]>
To: Roy Rietveld <[email protected]>
CC: [email protected], [email protected]
Subject: Re: TCP/IP send, sendfile, RAW
Date: Fri, 05 May 2006 15:39:56 +0300

Quoted 8 lines · Roy Rietveld

the platform is a netsilicon NS9360 witch include an 100MBit ethernet device. The driver came with the software(LxNETES) for the development board. CPU load is 100% when running sender program.

cat /proc/interrupts; sleep 10; cat /proc/interrupts doen't work anymore because cpu is to busy.

Does sendto give other processes time when the hardware is transmitting data? Is this bad hardware or is the cost of sendto that high.

Try sending UDP over loopback and see.

--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/