McSPI high CPU load

Hi all,

I use Beagleboard C4 with Zippy2 expansion board (KSZ8851SNL Ethernet
controller with SPI interface), linux kernel 2.6.35. When I run my
network application I see that CPU load for [omap2_mcspi] driver = 25%
and for [events/0] process = 10%. Network application produces a lot
of network traffic (avg. bytes/sec = 160.000, avg. packets/sec = 2200,
avg. packet size = 74 bytes). At some moment I see that tx buffer for
KSZ8851SNL chip is full, linux driver (drivers/net/ks8851.c) stops
network interface for a short time (netif_stop_queue) and my
application drops a call during this period.

I understand that SPI interface is a bottleneck in this situation, but
is it possible to do some optimization for McSPI (drivers/spi/
omap2_mcspi.c) or KSZ8851SNL (drivers/net/ks8851.c) drivers? I tried
to use DMA for smaller packets (DMA_MIN_BYTES macro), I tried to add
separate kernel thread in ks8851.c for receiving the packets from the
Ethernet chip but I still have an issue with buffer overflow. McSPI
driver is quite complicated and unfortunately I don't have enough time
to implement my own SPI driver for OMAP.

Cheers,
Max.

Max,

I met the same problem, CPU load is too high with KSZ8851SNL, have you fixed this problem? I did some work around about this chip’s driver. Most of the problem was triggered by the RX packets too long. I optimized the SPI host driver, short the SPI read/write time cost, but CPU load was not optimized obviously.
Thanks a lot.

BR
Fei Xia Duan

在 2011年1月27日星期四UTC+8上午8时32分01秒,Max Galemin写道:

Hey guys!

I also use ks8851-snl and see that the speed is rather low:
1) in 2.6.32 - it is around 1MB/sec
2) in 3.0.17 it is 750kB/sec

I don't know if it's CPU overload or something else. I just did not dig to deep.

I wrote to the kernel mail-list reporting the regression between
kernel versions but nothing tangible happened. Can we consolidate our
efforts to make this driver work better? I'm ready to contribute my
time.