How can we make the lantiq xrx200 devices faster

Hi guys, I think I found some speedup tips, they requires kernel changes though.

First you can try my irq balancing from here. That should decrease irq load.

Changing file arch/mips/lantiq/xway/dma.c , function ltq_dma_init_port , case DMA_PORT_ETOP to this:

ltq_dma_w32_mask(0, DMA_ETOP_ENDIANNESS | DMA_PDEN,
                    LTQ_DMA_PCTRL);

//burst
ltq_dma_w32_mask(0x3c, (2<<4) | (2<<2), LTQ_DMA_PCTRL);

seems to increase DMA speed by about 10% (ethernet netcat pipe). It is the same burst setting as in case bellow (DMA_2W_BURST). More words during burst -> speedup. There is a value 3, but the packets were damaged (a comment in vendor's kernel notes that burst mode is broken).

Finally it seems the openwrt snapshot about 2-3 weeks old with kernel 4.14.93 has somewhat broken ethernet driver. It seems to be only under 100Mbit/s speed of communication. When I use the code (RX, TX, irq, napi...) from vanilla kernel v5 I can get following raw speeds: 100 MiBytes/s into xrx200 (so basically a gigabit), 17 MiBytes/s from xrx200 (roughly about 150 Mbit/s). The tx fifo (from xrx200) was the one which caused slowdowns in the original openwrt driver.

If there is no openwrt kernel/patches maintaner in the forum I will send reports to the mailing list tomorrow. But I was able to speed up the network just by changing the file drivers/net/ethernet/lantiq_xrx200.c , function xrx200_poll_rx to this:

if (complete || !rx) {
        if (napi_complete(&ch->napi))
                ltq_dma_enable_irq(&ch->dma);
}
1 Like