cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dargaud
Adventurer
Adventurer
3,275 Views
Registered: ‎02-26-2008

Low network speed on ML405 at 1Gbps... and full CPU use

Hello all,

I'm using a derivative of the ML405 with the Xilinx linux tree. CPU speed is 300MHz, bus at 100MHz. The driver is currently:

$ grep -i "MII\|temac" .config
# CONFIG_XILINX_LL_TEMAC is not set
# CONFIG_XILINX_TEMAC is not set
CONFIG_XILINX_LLTEMAC=y
# CONFIG_XILINX_LLTEMAC_MARVELL_88E1111_RGMII is not set
CONFIG_XILINX_LLTEMAC_MARVELL_88E1111_GMII=y
# CONFIG_XILINX_LLTEMAC_MARVELL_88E1111_MII is not set
# CONFIG_XILINX_LLTEMAC_NATIONAL_DP83865_GMII is not set
The device boots in 1000FD:
# dmesg | grep -i dma
[    0.000000]   DMA      0x00000000 -> 0x00007000
[    0.000000]   DMA zone: 224 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 28448 pages, LIFO batch:7
[   43.625940] xilinx_lltemac 81c00000.ethernet: XLlTemac: using DMA mode.
[   43.632487] XLlTemac: Dma base address: phy: 0x84600100, virt: 0xc8020100
[   43.644705] XLlTemac: Allocating DMA descriptors with kmalloc
[   44.207644] eth0: XLlTemac: allocating interrupt 20 for dma mode tx.
[   44.213831] eth0: XLlTemac: allocating interrupt 19 for dma mode rx.
0;~ root@gandalf ~ 0 # dmesg | grep -i "dma\|eth\|net"
[    0.000000]   DMA      0x00000000 -> 0x00007000
[    0.000000]   DMA zone: 224 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 28448 pages, LIFO batch:7
[   42.963000] NET: Registered protocol family 16
[   43.040296] NET: Registered protocol family 2
[   43.046144] NET: Registered protocol family 1
[   43.615332] Device Tree Probing 'ethernet'
[   43.619338] xilinx_lltemac 81c00000.ethernet: MAC address is now  0: a:35:72:43: 0
[   43.625940] xilinx_lltemac 81c00000.ethernet: XLlTemac: using DMA mode.
[   43.632487] XLlTemac: Dma base address: phy: 0x84600100, virt: 0xc8020100
[   43.644705] XLlTemac: Allocating DMA descriptors with kmalloc
[   43.670400] xilinx_lltemac 81c00000.ethernet: eth0: Xilinx TEMAC at 0x81C00000 mapped to 0xC801A000, irq=18
[   43.692372] NET: Registered protocol family 17
[   44.204484] eth0: XLlTemac: Options: 0x3fa
[   44.207644] eth0: XLlTemac: allocating interrupt 20 for dma mode tx.
[   44.213831] eth0: XLlTemac: allocating interrupt 19 for dma mode rx.
[   46.230374] eth0: XLlTemac: speed set to 1000Mb/s
[   46.233932] eth0: XLlTemac: Send Threshold = 24, Receive Threshold = 4
[   46.240423] eth0: XLlTemac: Send Wait bound = 254, Receive Wait bound = 254
[   47.269600]      device=eth0, addr=192.168.1.233, mask=255.255.255.0, gw=192.168.1.185,
But the speeds I get are very low: 84Mbps (only 8% of full 1Gbps potential):
# netperf -H f -H controller -c
TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to master (192.168.1.185) port 0 AF_INET
Recv   Send    Send                          Utilization       Service Demand
Socket Socket  Message  Elapsed              Send     Recv     Send    Recv
Size   Size    Size     Time     Throughput  local    remote   local   remote
bytes  bytes   bytes    secs.    10^6bits/s  % S      % U      us/KB   us/KB
 87380  16384  16384    10.01        84.28   100.00   -1.00    97.195  -1.000
More interesting is the fact that the CPU is at 100% during network transfer. Is that normal ? Is that really the limiting factor ? Is there anything I can do about it ?!? I see DMA interrupts during the transfer. A little bit more info:
# ethtool eth0
Settings for eth0:
        Supported ports: [ MII ]
        Supported link modes:   10baseT/Full
                                100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  Not reported
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on

# mii-diag
Using the default interface 'eth0'.
Basic registers of MII PHY #7:  1140 796d 0141 0cc2 01e1 c5e1 000d 2001.
 The autonegotiated capability is 01e0.
The autonegotiated media type is 100baseTx-FD.
 Basic mode control register 0x1140: Auto-negotiation enabled.
 You have link beat, and everything is working OK.
 Your link partner advertised c5e1: Flow-control 100baseTx-FD 100baseTx 10baseT-FD 10baseT, w/ 802.3X flow control.
Thanks for any pointer. I really need to improve the performance, and the Xilinx note XAPP1043 is not at all relevant.
0 Kudos
2 Replies
marel069
Visitor
Visitor
3,260 Views
Registered: ‎01-18-2011

This might be a stupid question, but have you configured the MAC to use DMA in XPS? We started out without DMA and obtained much better performance switching to DMA.

 

Anyway, I have had a hard time reaching 100 Mbps on the ML507.

0 Kudos
dargaud
Adventurer
Adventurer
3,230 Views
Registered: ‎02-26-2008

I see the DMA TX/RX interrupts increase steadily in /proc/interrupts, so it must mean that the DMA is being used, right ?

0 Kudos