diff options
author | Jakov Petrina <jakov.petrina@sartura.hr> | 2020-05-25 14:14:40 +0200 |
---|---|---|
committer | Luka Perkov <luka.perkov@sartura.hr> | 2020-05-28 11:43:13 +0200 |
commit | 3dbb658d26062b34e5a540a4477e4a768628c42c (patch) | |
tree | eb3342be7f0e8693c3ae1442668ee4a1ba26b04d /target/linux/mvebu/patches-5.4/020-net-mvneta-fix-build-skb-for-bm-capable-devices.patch | |
parent | 76f9aa6f4bfd12fba34fc44aef890c48d4fb1024 (diff) | |
download | upstream-3dbb658d26062b34e5a540a4477e4a768628c42c.tar.gz upstream-3dbb658d26062b34e5a540a4477e4a768628c42c.tar.bz2 upstream-3dbb658d26062b34e5a540a4477e4a768628c42c.zip |
linux: mvebu: backport mvneta XDP support fixes
This patch backports additional fixes for XDP support in the mvneta driver. These
changes are found upstream as commits:
b37fa92e20ef2 net: mvneta: fix build skb for bm capable devices
f383b2950070c net: mvneta: rely on page_pool_recycle_direct in mvneta_run_xdp
79572c98c554d mvneta driver disallow XDP program on hardware buffer management
44efc78d0e464 net: mvneta: fix XDP support if sw bm is used as fallback
Signed-off-by: Jakov Petrina <jakov.petrina@sartura.hr>
Diffstat (limited to 'target/linux/mvebu/patches-5.4/020-net-mvneta-fix-build-skb-for-bm-capable-devices.patch')
-rw-r--r-- | target/linux/mvebu/patches-5.4/020-net-mvneta-fix-build-skb-for-bm-capable-devices.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/target/linux/mvebu/patches-5.4/020-net-mvneta-fix-build-skb-for-bm-capable-devices.patch b/target/linux/mvebu/patches-5.4/020-net-mvneta-fix-build-skb-for-bm-capable-devices.patch new file mode 100644 index 0000000000..94de008e76 --- /dev/null +++ b/target/linux/mvebu/patches-5.4/020-net-mvneta-fix-build-skb-for-bm-capable-devices.patch @@ -0,0 +1,41 @@ +From b37fa92e20ef28aada852cbf03b368d29a20478c Mon Sep 17 00:00:00 2001 +From: Lorenzo Bianconi <lorenzo@kernel.org> +Date: Thu, 14 Nov 2019 01:25:55 +0200 +Subject: [PATCH] net: mvneta: fix build skb for bm capable devices + +Fix build_skb for bm capable devices when they fall-back using swbm path +(e.g. when bm properties are configured in device tree but +CONFIG_MVNETA_BM_ENABLE is not set). In this case rx_offset_correction is +overwritten so we need to use it building skb instead of +MVNETA_SKB_HEADROOM directly + +Fixes: 8dc9a0888f4c ("net: mvneta: rely on build_skb in mvneta_rx_swbm poll routine") +Fixes: 0db51da7a8e9 ("net: mvneta: add basic XDP support") +Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> +Reported-by: Andrew Lunn <andrew@lunn.ch> +Tested-by: Andrew Lunn <andrew@lunn.ch> +Signed-off-by: David S. Miller <davem@davemloft.net> +--- + drivers/net/ethernet/marvell/mvneta.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/marvell/mvneta.c ++++ b/drivers/net/ethernet/marvell/mvneta.c +@@ -2165,7 +2165,7 @@ mvneta_swbm_rx_frame(struct mvneta_port + prefetch(data); + + xdp->data_hard_start = data; +- xdp->data = data + MVNETA_SKB_HEADROOM + MVNETA_MH_SIZE; ++ xdp->data = data + pp->rx_offset_correction + MVNETA_MH_SIZE; + xdp->data_end = xdp->data + data_len; + xdp_set_data_meta_invalid(xdp); + +@@ -2230,7 +2230,7 @@ mvneta_swbm_add_rx_fragment(struct mvnet + /* refill descriptor with new buffer later */ + skb_add_rx_frag(rxq->skb, + skb_shinfo(rxq->skb)->nr_frags, +- page, MVNETA_SKB_HEADROOM, data_len, ++ page, pp->rx_offset_correction, data_len, + PAGE_SIZE); + } + page_pool_release_page(rxq->page_pool, page); |