2009-03-03 14:02:08     SMSC9215 RX scheduling

Document created by Aaronwu Employee on Aug 14, 2013
Version 1Show Document
  • View in full screen mode

2009-03-03 14:02:08     SMSC9215 RX scheduling

Hans Waldmann (UNITED STATES)

Message: 70300   

 

HI PTG

 

I am having some trouble running the SMSC9215 driver at higher speeds. I am losing packets when I receive udp data from a Windows PC at around 10 Mbps. From the SMSC driver I can see that there are dropped packets. I have done some benchmarking to see that the smsc911x_poll function is executing sometimes up to 8 milliseconds after the smsc911x_irqhandler ISR runs with a packet RX interrupt. This would explain why I am losing RX data since if we wait for this long to read the data out from the SMSC device, the devices RX FIFO which is configured to around 10 Kbytes, would fill up and overflow.

 

So the question is why is the smsc911x_poll being delayed by 8 milliseconds. I see that this function is running in interrupt 14. And it looks like smsc911x_irqhandler is running in interrupt 11 on our board.

 

I am also seeing in the code that the smsc911x_poll function has been deferred to a soft_irq. What I need some help with is to understand how the soft irq is being scheduled and what I can do to make sure it does not get delayed by several milliseconds.

 

The application running on the board is just a simple UDP packet receive thread which read packets in from the socket when they arrive. From the profiler I can see there are plenty of CPU mips available (at least 80%).

 

Thanks,

 

Hans

QuoteReplyEditDelete

 

 

2009-03-03 14:58:40     RE: SMSC9215 RX scheduling

Michael Hennerich (GERMANY)

Message: 70301   

 

Hans,

 

I think you have different problem here.

I tested this driver on BF548 with netperf doing TCP_STREAM and UDP_STREAM tests and achieved throughput results somewhere close to 94Mbps.

 

Soft_irqs and other deferrable functions run in the lowest interrupt (14) on Blackfin - like on all other CPUs.

 

The Network RX softirq typically runs in the shadow of the MAC interrupt, if no higher priority interrupt is latched.

 

 

eduunix.jlbtc.edu.cn/index/html/linux/OReilly.Understanding.the.Linux.Kernel.3rd.Edition.Nov.2005.HAPPY.NEW.YEAR/0596005652/understandlk-CHP-4-SECT-7.html

 

 

Can you explain the environment you are using?

Kernel SVN rev., board, processor, etc.

 

-Michael

QuoteReplyEditDelete

 

 

2009-03-03 15:13:38     RE: SMSC9215 RX scheduling

Hans Waldmann (UNITED STATES)

Message: 70302   

 

I just changed the kernel timer from 100Hz to 1000Hz. Now it is much better. From the benchmark I can see that the RX poll function is only 1 millisecond behind the ISR. I was guessing that the kernel timer would affect to soft_irq scheduling and that seems to be the case.

 

I am running on a custom board with a BF561. I am using 2008r1 release.

 

I am still seeing some packet loss. I am guessing this is having to do with the data being delivered in a busty fashion. On the Windows PC, we are sending out 10 1400 byte UDP packets every 10 milliseconds. It looks like I am still not able to handle this kind of burst of data. I will try to rewrite the test program to send out the data at shorter intervals instead so it is less bursty.

 

Hans

QuoteReplyEditDelete

 

 

2009-03-05 11:32:01     RE: SMSC9215 RX scheduling

Hans Waldmann (UNITED STATES)

Message: 70452   

 

Hi Michael

 

It turns out that we are having an ISR which is not calling do_softirq() on exit. That seems to be the main problem.

 

Now I am noticing that it is taking us around 200 microseconds to read out a 1450 byte packet from the 9215 device. This would limit our bandwidth to around 58Mbit/s. You mentioned that you were getting 96 Mbit/s. Is that with the 9215 device which is 16 bit bus or the 9218 which is 32 bit bus.

 

If that was with the 9215 device, can you tell me the EBIU settings that are used for that device.

 

Thanks,

 

Hans

QuoteReplyEditDelete

 

 

2009-03-05 11:43:54     RE: SMSC9215 RX scheduling

Michael Hennerich (GERMANY)

Message: 70453    Hans,

 

It was 9218 with an 16-bit interface.

EBIU settings are 0x5554 with SCLK @ 131.25MHz.

 

For reading and writing the FIFOs make sure the driver uses the insX()

and outsX() functions.

 

-Michael

 

QuoteReplyEditDelete

 

 

2009-03-05 17:01:53     RE: SMSC9215 RX scheduling

Hans Waldmann (UNITED STATES)

Message: 70477   

 

With the read/write cycles set to 5, I am now able to get about 70 Mbit/s. Thanks!

QuoteReplyEditDelete

 

 

2009-03-05 17:16:33     RE: SMSC9215 RX scheduling

Michael Hennerich (GERMANY)

Message: 70478    Well, the 94+ Mbit/s is with netperf.

Doing FTP or other real world apps always involves a bit more than

sending arbitrary data.

 

I would suggest that you try netperf on your target just to see where

you are. I have to admit the 94 Mbps was measured on BF548 having a much

higher memory bandwidth, compared to 52x/53x derivates.

 

-Michael

Attachments

    Outcomes