aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-5.15/609-v5.18-veth-Allow-jumbo-frames-in-xdp-mode.patch
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2022-08-29 08:54:41 +0200
committerDaniel Golle <daniel@makrotopia.org>2022-09-22 23:55:02 +0100
commitc93c5365c0eb78ba8b479a9fe0cc5ec96f773978 (patch)
treeb250435d0f0e8e66c56d0486d1151d4eb1fc827e /target/linux/generic/backport-5.15/609-v5.18-veth-Allow-jumbo-frames-in-xdp-mode.patch
parent524f52a471495d2c4e764539e000cb699610de1f (diff)
downloadupstream-c93c5365c0eb78ba8b479a9fe0cc5ec96f773978.tar.gz
upstream-c93c5365c0eb78ba8b479a9fe0cc5ec96f773978.tar.bz2
upstream-c93c5365c0eb78ba8b479a9fe0cc5ec96f773978.zip
kernel: pick patches for MediaTek Ethernet from linux-next
Pick patches with several fixes and improvements, preparation for upcoming WED (TX) [1] as well as basic XDP support [2] with MediaTek's Filogic SoCs to the mtk_eth_soc driver. Also pick follow-up patch fixing Ethernet on MT7621 [3]. Tested on Bananapi BPi-R3 (MT7986), Bananapi BPi-R64 (MT7622), Bananapi BPi-R2 (MT7623), MikroTik RouterBoard M11G (MT7621). [1]: https://patchwork.kernel.org/project/netdevbpf/list/?series=662108&state=* [2]: https://patchwork.kernel.org/project/netdevbpf/list/?series=675368&state=* (the first part of the series adding wed nodes to mt7986a.dtsi was applied to the copy of mt7986a.dtsi in our tree) [3]: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=5e69163d3b9931098922b3fc2f8e786af8c1f37e Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/generic/backport-5.15/609-v5.18-veth-Allow-jumbo-frames-in-xdp-mode.patch')
-rw-r--r--target/linux/generic/backport-5.15/609-v5.18-veth-Allow-jumbo-frames-in-xdp-mode.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.15/609-v5.18-veth-Allow-jumbo-frames-in-xdp-mode.patch b/target/linux/generic/backport-5.15/609-v5.18-veth-Allow-jumbo-frames-in-xdp-mode.patch
new file mode 100644
index 0000000000..8080d621da
--- /dev/null
+++ b/target/linux/generic/backport-5.15/609-v5.18-veth-Allow-jumbo-frames-in-xdp-mode.patch
@@ -0,0 +1,35 @@
+commit 7cda76d858a4e71ac4a04066c093679a12e1312c
+Author: Lorenzo Bianconi <lorenzo@kernel.org>
+Date: Fri Mar 11 10:14:20 2022 +0100
+
+ veth: Allow jumbo frames in xdp mode
+
+ Allow increasing the MTU over page boundaries on veth devices
+ if the attached xdp program declares to support xdp fragments.
+
+ Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
+ Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
+ Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
+ Acked-by: John Fastabend <john.fastabend@gmail.com>
+ Link: https://lore.kernel.org/bpf/d5dc039c3d4123426e7023a488c449181a7bc57f.1646989407.git.lorenzo@kernel.org
+
+--- a/drivers/net/veth.c
++++ b/drivers/net/veth.c
+@@ -1470,9 +1470,14 @@ static int veth_xdp_set(struct net_devic
+ goto err;
+ }
+
+- max_mtu = PAGE_SIZE - VETH_XDP_HEADROOM -
+- peer->hard_header_len -
+- SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
++ max_mtu = SKB_WITH_OVERHEAD(PAGE_SIZE - VETH_XDP_HEADROOM) -
++ peer->hard_header_len;
++ /* Allow increasing the max_mtu if the program supports
++ * XDP fragments.
++ */
++ //if (prog->aux->xdp_has_frags)
++ max_mtu += PAGE_SIZE * MAX_SKB_FRAGS;
++
+ if (peer->mtu > max_mtu) {
+ NL_SET_ERR_MSG_MOD(extack, "Peer MTU is too large to set XDP");
+ err = -ERANGE;