diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2019-10-25 13:47:24 +1100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-28 16:22:50 -0700 |
commit | 88824e3bf29a2fcacfd9ebbfe03063649f0f3254 (patch) | |
tree | 5d65689d64319c79df82aea5a35d8c058481ecf3 /drivers/sh/maple | |
parent | 20eb4f29b60286e0d6dc01d9c260b4bd383c58fb (diff) | |
download | linux-stable-88824e3bf29a2fcacfd9ebbfe03063649f0f3254.tar.gz linux-stable-88824e3bf29a2fcacfd9ebbfe03063649f0f3254.tar.bz2 linux-stable-88824e3bf29a2fcacfd9ebbfe03063649f0f3254.zip |
net: ethernet: ftgmac100: Fix DMA coherency issue with SW checksum
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>
Diffstat (limited to 'drivers/sh/maple')
0 files changed, 0 insertions, 0 deletions