aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/pending-5.4/645-netfilter-nf_flow_table-rework-hardware-offload-time.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2020-02-23 13:20:11 +0100
committerKoen Vandeputte <koen.vandeputte@ncentric.com>2020-02-28 17:50:45 +0100
commitc16517d26de30c90dabce1e456615fd7fbdce07c (patch)
treee7371ee12a3c413a064885b634ee4c975ad7f96a /target/linux/generic/pending-5.4/645-netfilter-nf_flow_table-rework-hardware-offload-time.patch
parent955634b473284847e3c8281a6ac85655329d8b06 (diff)
downloadupstream-c16517d26de30c90dabce1e456615fd7fbdce07c.tar.gz
upstream-c16517d26de30c90dabce1e456615fd7fbdce07c.tar.bz2
upstream-c16517d26de30c90dabce1e456615fd7fbdce07c.zip
kernel: copy kernel 4.19 code to 5.4
No changes were done to the patches while coping them. Currently they do not apply on top of kernel 5.4. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'target/linux/generic/pending-5.4/645-netfilter-nf_flow_table-rework-hardware-offload-time.patch')
-rw-r--r--target/linux/generic/pending-5.4/645-netfilter-nf_flow_table-rework-hardware-offload-time.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/target/linux/generic/pending-5.4/645-netfilter-nf_flow_table-rework-hardware-offload-time.patch b/target/linux/generic/pending-5.4/645-netfilter-nf_flow_table-rework-hardware-offload-time.patch
new file mode 100644
index 0000000000..bfb7a9c190
--- /dev/null
+++ b/target/linux/generic/pending-5.4/645-netfilter-nf_flow_table-rework-hardware-offload-time.patch
@@ -0,0 +1,37 @@
+From: Felix Fietkau <nbd@nbd.name>
+Date: Sun, 25 Mar 2018 21:10:55 +0200
+Subject: [PATCH] netfilter: nf_flow_table: rework hardware offload timeout
+ handling
+
+Some offload implementations send keepalive packets + explicit
+notifications of TCP FIN/RST packets. In this case it is more convenient
+to simply let the driver update flow->timeout handling and use the
+regular flow offload gc step.
+
+For drivers that manage their own lifetime, a separate flag can be set
+to avoid gc timeouts.
+
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+---
+
+--- a/include/net/netfilter/nf_flow_table.h
++++ b/include/net/netfilter/nf_flow_table.h
+@@ -76,6 +76,7 @@ struct flow_offload_tuple_rhash {
+ #define FLOW_OFFLOAD_DYING 0x4
+ #define FLOW_OFFLOAD_TEARDOWN 0x8
+ #define FLOW_OFFLOAD_HW 0x10
++#define FLOW_OFFLOAD_KEEP 0x20
+
+ struct flow_offload {
+ struct flow_offload_tuple_rhash tuplehash[FLOW_OFFLOAD_DIR_MAX];
+--- a/net/netfilter/nf_flow_table_core.c
++++ b/net/netfilter/nf_flow_table_core.c
+@@ -368,7 +368,7 @@ static int nf_flow_offload_gc_step(struc
+ if (!teardown)
+ nf_ct_offload_timeout(flow);
+
+- if (nf_flow_in_hw(flow) && !teardown)
++ if ((flow->flags & FLOW_OFFLOAD_KEEP) && !teardown)
+ continue;
+
+ if (nf_flow_has_expired(flow) || teardown)