net: netsec: Correct dma sync for XDP_TX frames
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Wed, 16 Oct 2019 11:40:32 +0000 (14:40 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 26 Jan 2020 09:01:04 +0000 (10:01 +0100)
commitc99f4a8c666dbfd69b05c2321b43de46b0e8dfe7
tree9130a23f1623786f632580f1713f8a00e760907d
parent238ca6417eec3b82a812964d5f98561b22614c7d
net: netsec: Correct dma sync for XDP_TX frames

[ Upstream commit d9496f3ecfe4823c1e12aecbcc29220147fa012c ]

bpf_xdp_adjust_head() can change the frame boundaries. Account for the
potential shift properly by calculating the new offset before
syncing the buffer to the device for XDP_TX

Fixes: ba2b232108d3 ("net: netsec: add XDP support")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/socionext/netsec.c