]> git.karo-electronics.de Git - karo-tx-linux.git/commit
net: thunderx: Fix IOMMU translation faults
authorSunil Goutham <sgoutham@cavium.com>
Tue, 7 Mar 2017 12:39:08 +0000 (18:09 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 9 Mar 2017 21:12:41 +0000 (13:12 -0800)
commit83abb7d7c91f4ac20e47c3089a10bb93b2ea8994
treea2ef6414ad6ba01ec33a9c465cf5b8aa8abe7bfc
parent3b12f73a5c2977153f28a224392fd4729b50d1dc
net: thunderx: Fix IOMMU translation faults

ACPI support has been added to ARM IOMMU driver in 4.10 kernel
and that has resulted in VNIC interfaces throwing translation
faults when kernel is booted with ACPI as driver was not using
DMA API. This patch fixes the issue by using DMA API which inturn
will create translation tables when IOMMU is enabled.

Also VNIC doesn't have a seperate receive buffer ring per receive
queue, so there is no 1:1 descriptor index matching between CQE_RX
and the index in buffer ring from where a buffer has been used for
DMA'ing. Unlike other NICs, here it's not possible to maintain dma
address to virt address mappings within the driver. This leaves us
no other choice but to use IOMMU's IOVA address conversion API to
get buffer's virtual address which can be given to network stack
for processing.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/thunder/nic.h
drivers/net/ethernet/cavium/thunder/nicvf_main.c
drivers/net/ethernet/cavium/thunder/nicvf_queues.c
drivers/net/ethernet/cavium/thunder/nicvf_queues.h