Skip to contentSkip to conversation

Ethernet driver problem

DISCUSSION Jupe 2 participants 3 messages Oct 10, 2007 – Oct 11, 2007

lore
Share & tools
lore

Jupe

author
#0 lore raw

Hi,

I have written an ethernet driver for an ARM based board. Linux version: 2.6.20.1

Ping is working fine.

I have written a test server/client application using socket programming (TCP).
After the connection is setup the server sends a file to the client.

When I run server on PC and client on ARM board it works without any problem.

BUT if I run server on ARM board and client on PC, it works for some time and
then the speed is drastically reduced. (I am sending 4k of data each time.
after 50 sends it reduces its speed. This happens always.)

I did some debugging and found that after 50 sends, tcp_sendmsg() is not being
called at the same frequency before slowdown. Also when my driver ether_tx seems to
be working fine.

But still i am not able to get the reason for this behaviour. Can anyone give hints as to
why this is happening?

Regards
Jupe

Signature · 5 lines
  Jupe
  [email protected]

-- 
http://www.fastmail.fm - mmm... Fastmail...
#1 lore raw
Quoted 26 lines · Jupe

Hi,

I have written an ethernet driver for an ARM based board. Linux version: 2.6.20.1

Ping is working fine.

I have written a test server/client application using socket programming (TCP).
After the connection is setup the server sends a file to the client.

When I run server on PC and client on ARM board it works without any problem.

BUT if I run server on ARM board and client on PC, it works for some time and
then the speed is drastically reduced. (I am sending 4k of data each time.
after 50 sends it reduces its speed. This happens always.)

I did some debugging and found that after 50 sends, tcp_sendmsg() is not being
called at the same frequency before slowdown. Also when my driver ether_tx seems to
be working fine.

Quoted 14 lines

But still i am not able to get the reason for this behaviour. Can anyone give hints as to
why this is happening?

Regards
Jupe

Signature · 5 lines
 Jupe
 [email protected]

-- 
http://www.fastmail.fm - mmm... Fastmail...

First, does your TCP/IP test application work okay on a Linux machine that does not use your new driver?

That's the first thing to test.

Next, is auto-negotiation working correctly in your driver? If you don't have auto-negotiation, have you set the Ethernet parameters correctly so that BOTH the server and the client use either full-duplex, or half-duplex, without mixing them up?

Next, make sure that you are properly handling transmit retries (handling all possible errors) in your driver. The transmitter does not want to drop packets if there is no room in the device, only the receiver should drop packets if there are no buffers. You do not want
the TCP/IP replacement algorithm to request missing packets because this slows everything down. Again, in the transmitter section
of your driver, consider data precious.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.16.24 on an i686 machine (5592.59 BogoMips). My book : http://www.AbominableFirebug.com/
_

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

author
#2 lore raw

Thanks for the reply

I have tested my program on PC and it works without any problem.

I have enabled auto negotiation. The status register shows successful completion of auto-negotiation.
And it shows using full duplex.

I did check whether the packets are getting dropped because of lack of space. But it is not the case. I even created huge number of transmit descriptors enough to fit 1.5 MBytes of data. But still it slows down after about 200 KB. I even have used the setsockopt option available in user program. Nothing seems to increase the speed.

Any pointers on this would be greatly helpful

Thanking you
Jupe

Quoted 85 lines · linux-os (Dick Johnson)
Quoted 26 lines · Jupe

Hi,

I have written an ethernet driver for an ARM based board. Linux version: 2.6.20.1

Ping is working fine.

I have written a test server/client application using socket programming (TCP).
After the connection is setup the server sends a file to the client.

When I run server on PC and client on ARM board it works without any problem.

BUT if I run server on ARM board and client on PC, it works for some time and
then the speed is drastically reduced. (I am sending 4k of data each time.
after 50 sends it reduces its speed. This happens always.)

I did some debugging and found that after 50 sends, tcp_sendmsg() is not being
called at the same frequency before slowdown. Also when my driver ether_tx seems to
be working fine.

Quoted 14 lines

But still i am not able to get the reason for this behaviour. Can anyone give hints as to
why this is happening?

Regards
Jupe

Signature · 5 lines
 Jupe
 [email protected]

-- 
http://www.fastmail.fm - mmm... Fastmail...

First, does your TCP/IP test application work okay on a Linux machine that does not use your new driver?

That's the first thing to test.

Next, is auto-negotiation working correctly in your driver? If you don't have auto-negotiation, have you set the Ethernet parameters correctly so that BOTH the server and the client use either full-duplex, or half-duplex, without mixing them up?

Next, make sure that you are properly handling
transmit retries (handling all possible errors)
in your driver. The transmitter does not want
to drop packets if there is no room in the
device, only the receiver should drop packets
if there are no buffers. You do not want
the TCP/IP replacement algorithm to request
missing packets because this slows everything
down. Again, in the transmitter section
of your driver, consider data precious.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.16.24 on an i686 machine (5592.59 BogoMips). My book : http://www.AbominableFirebug.com/
_

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

Signature · 6 lines
  Jupe
  [email protected]

-- 
http://www.fastmail.fm - Access all of your messages and folders
                          wherever you are