aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2020-09-17 19:14:13 +0200
committerFelix Fietkau <nbd@nbd.name>2020-09-17 21:08:32 +0200
commit4fb58813f94ac6cc8167138e23a92189fe50b258 (patch)
treef18f793361bebd9f945e4dce3eccd88b012241c3 /target/linux/mediatek
parent520074e57ef3eacf85ab58995d1bb39b6c8c7180 (diff)
downloadupstream-4fb58813f94ac6cc8167138e23a92189fe50b258.tar.gz
upstream-4fb58813f94ac6cc8167138e23a92189fe50b258.tar.bz2
upstream-4fb58813f94ac6cc8167138e23a92189fe50b258.zip
mediatek: fix hardware flow offload
Add support for dealing with DSA ports Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/mediatek')
-rw-r--r--target/linux/mediatek/patches-5.4/0999-hnat.patch18
1 files changed, 17 insertions, 1 deletions
diff --git a/target/linux/mediatek/patches-5.4/0999-hnat.patch b/target/linux/mediatek/patches-5.4/0999-hnat.patch
index 685c741043..f86c882eb2 100644
--- a/target/linux/mediatek/patches-5.4/0999-hnat.patch
+++ b/target/linux/mediatek/patches-5.4/0999-hnat.patch
@@ -321,7 +321,7 @@
#endif /* MTK_ETH_H */
--- /dev/null
+++ b/drivers/net/ethernet/mediatek/mtk_offload.c
-@@ -0,0 +1,593 @@
+@@ -0,0 +1,609 @@
+/* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License
@@ -430,6 +430,22 @@
+ }
+ }
+
++ if (dest->flags & FLOW_OFFLOAD_PATH_DSA) {
++ entry->bfib1.vlan_layer = 1;
++
++ entry->ipv4_hnapt.bfib1.vpm = 0;
++ entry->ipv4_hnapt.etype = BIT(dest->dsa_port);
++
++ if (dest->flags & FLOW_OFFLOAD_PATH_VLAN) {
++ if (dest->vlan_proto != htons(ETH_P_8021Q))
++ return -EINVAL;
++
++ entry->ipv4_hnapt.etype |= BIT(8);
++ } else {
++ entry->ipv4_hnapt.vlan1 = 0;
++ }
++ }
++
+ return 0;
+}
+