aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/pending-5.10/704-00-netfilter-flowtable-fix-excessive-hw-offload-attempt.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2022-05-06 15:49:58 +0200
committerFelix Fietkau <nbd@nbd.name>2022-05-06 20:11:01 +0200
commit53fc6e9edeae7364847bd1a7a81a331feeb56172 (patch)
tree5db1e05f2ac8693330d703f842a2694cf715e26e /target/linux/generic/pending-5.10/704-00-netfilter-flowtable-fix-excessive-hw-offload-attempt.patch
parent77e123340f0b5490905e27ddc92f0dff8ed017a5 (diff)
downloadupstream-53fc6e9edeae7364847bd1a7a81a331feeb56172.tar.gz
upstream-53fc6e9edeae7364847bd1a7a81a331feeb56172.tar.bz2
upstream-53fc6e9edeae7364847bd1a7a81a331feeb56172.zip
kernel: fix flow offload issues with pppoe
sync xt_FLOWOFFLOAD code with latest version of nft_flow_offload Signed-off-by: Felix Fietkau <nbd@nbd.name> (cherry-picked from commit 726ef8ba2dbe4d4a693c4d9300bc69e234e6d67d)
Diffstat (limited to 'target/linux/generic/pending-5.10/704-00-netfilter-flowtable-fix-excessive-hw-offload-attempt.patch')
-rw-r--r--target/linux/generic/pending-5.10/704-00-netfilter-flowtable-fix-excessive-hw-offload-attempt.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/target/linux/generic/pending-5.10/704-00-netfilter-flowtable-fix-excessive-hw-offload-attempt.patch b/target/linux/generic/pending-5.10/704-00-netfilter-flowtable-fix-excessive-hw-offload-attempt.patch
new file mode 100644
index 0000000000..c15f090f71
--- /dev/null
+++ b/target/linux/generic/pending-5.10/704-00-netfilter-flowtable-fix-excessive-hw-offload-attempt.patch
@@ -0,0 +1,27 @@
+From: Felix Fietkau <nbd@nbd.name>
+Date: Fri, 6 May 2022 12:37:23 +0200
+Subject: [PATCH] netfilter: flowtable: fix excessive hw offload attempts
+ after failure
+
+If a flow cannot be offloaded, the code currently repeatedly tries again as
+quickly as possible, which can significantly increase system load.
+Fix this by limiting flow timeout update and hardware offload retry to once
+per second.
+
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+---
+
+--- a/net/netfilter/nf_flow_table_core.c
++++ b/net/netfilter/nf_flow_table_core.c
+@@ -331,8 +331,10 @@ void flow_offload_refresh(struct nf_flow
+ u32 timeout;
+
+ timeout = nf_flowtable_time_stamp + flow_offload_get_timeout(flow);
+- if (READ_ONCE(flow->timeout) != timeout)
++ if (timeout - READ_ONCE(flow->timeout) > HZ)
+ WRITE_ONCE(flow->timeout, timeout);
++ else
++ return;
+
+ if (likely(!nf_flowtable_hw_offload(flow_table)))
+ return;