]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
net: thunderx: Fix IOMMU translation faults
authorSunil Goutham <sgoutham@cavium.com>
Tue, 30 May 2017 18:15:35 +0000 (12:15 -0600)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 20 Jun 2017 08:49:54 +0000 (10:49 +0200)
commit9832565d92e5eb37f6f4afb990e59b8fef08998f
treeada9ebd4d1d9536b132301f6e6bae34049cb6b67
parent02148fc4ef63fe2f5eb4cbf459bfa5f572090b8b
net: thunderx: Fix IOMMU translation faults

BugLink: https://bugs.launchpad.net/bugs/1694506
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>
(cherry picked from commit 83abb7d7c91f4ac20e47c3089a10bb93b2ea8994)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Colin King <colin.king@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
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