SWIOTLB buffer runs full

From: Bjørn Damstedt Rasmussen
Date: Thu May 03 2018 - 04:53:04 EST


After a long and bloody battle I managed to port Xilinx's Temac ethernet driver (drivers/net/ethernet/xilinx/ll_temac_main.c) to Intel x86_64 platform.

The Temac driver tries to allocate up to 512 DMA buffers of 9018 bytes using dma_map_single() during high load. But when there's high load I start getting this message:
xilinx_temac xilinx_temac.0: swiotlb buffer is full (sz: 9018 bytes)


When the SWIOTLB buffer reports full then performance drops significantly and the kernel log is being blasted with the above message.

If I reduce the DMA buffer size to 2000 bytes then I don't get the above error, so I guess the problem is because there's only very few DMA buffers greater than 2K bytes. I tried appending swiotlb=131072 to kernel parameter (i.e. 256MB, default is 64MB) but the SWIOTLB buffer is still being depleted.

So my question is how do I increase the amount of DMA buffers that can hold 9018 bytes? Is it a soft or hardware setting? I run Linux kernel v4.4.97 on Intel(R) Core(TM) i7-2610UE CPU @ 1.50GHz (family: 0x6, model: 0x2a, stepping: 0x7).

Bjørn Damstedt Rasmussen