net: mvneta: fix XDP support if sw bm is used as fallback
authorLorenzo Bianconi <lorenzo@kernel.org>
Wed, 29 Jan 2020 11:50:53 +0000 (12:50 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Jan 2020 12:57:59 +0000 (13:57 +0100)
commit44efc78d0e464ce70b45b165c005f8bedc17952e
tree25d14ccd1e57eb35488cf5865e487c7003aeebaa
parent793da4bfba7b8a785d38662f57fbcb2252b6f904
net: mvneta: fix XDP support if sw bm is used as fallback

In order to fix XDP support if sw buffer management is used as fallback
for hw bm devices, define MVNETA_SKB_HEADROOM as maximum between
XDP_PACKET_HEADROOM and NET_SKB_PAD and let the hw aligns the IP header
to 4-byte boundary.
Fix rx_offset_correction initialization if mvneta_bm_port_init fails in
mvneta_resume routine

Fixes: 0db51da7a8e9 ("net: mvneta: add basic XDP support")
Tested-by: Sven Auhagen <sven.auhagen@voleatech.de>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvneta.c