]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
net: ethernet: ftgmac100: Fix DMA coherency issue with SW checksum
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 25 Oct 2019 02:47:24 +0000 (13:47 +1100)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 12 Nov 2019 17:47:37 +0000 (18:47 +0100)
commit988357255d37931c9f467a4c0e70c325aa3ac0c1
tree0eceaa6220a9027ab98b0a63c8d630edf9d263a6
parent2d49c54032b8f28ada1b2d86fcff3b13d36fb504
net: ethernet: ftgmac100: Fix DMA coherency issue with SW checksum

BugLink: https://bugs.launchpad.net/bugs/1852111
[ Upstream commit 88824e3bf29a2fcacfd9ebbfe03063649f0f3254 ]

We are calling the checksum helper after the dma_map_single()
call to map the packet. This is incorrect as the checksumming
code will touch the packet from the CPU. This means the cache
won't be properly flushes (or the bounce buffering will leave
us with the unmodified packet to DMA).

This moves the calculation of the checksum & vlan tags to
before the DMA mapping.

This also has the side effect of fixing another bug: If the
checksum helper fails, we goto "drop" to drop the packet, which
will not unmap the DMA mapping.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Fixes: 05690d633f30 ("ftgmac100: Upgrade to NETIF_F_HW_CSUM")
Reviewed-by: Vijay Khemka <vijaykhemka@fb.com>
Tested-by: Vijay Khemka <vijaykhemka@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/faraday/ftgmac100.c