[SRU][F:linux-bluefield][PATCH 05/10] netfilter: flowtable: Make sure GC works periodically in idle system

Bodong Wang bodong at nvidia.com
Fri Oct 28 13:57:15 UTC 2022


From: Yinjun Zhang <yinjun.zhang at corigine.com>

BugLink: https://bugs.launchpad.net/bugs/1995004

Currently flowtable's GC work is initialized as deferrable, which
means GC cannot work on time when system is idle. So the hardware
offloaded flow may be deleted for timeout, since its used time is
not timely updated.

Resolve it by initializing the GC work as delayed work instead of
deferrable.

Fixes: c29f74e0df7a ("netfilter: nf_flow_table: hardware offload support")
Change-Id: I99843e5974c9bbb41dfbaf1dc062e538e1938f34
Signed-off-by: Yinjun Zhang <yinjun.zhang at corigine.com>
Signed-off-by: Louis Peens <louis.peens at corigine.com>
Signed-off-by: Simon Horman <simon.horman at netronome.com>
Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
Signed-off-by: Bodong Wang <bodong at nvidia.com>
---
 net/netfilter/nf_flow_table_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nf_flow_table_core.c b/net/netfilter/nf_flow_table_core.c
index dd29f4f..d60a206 100644
--- a/net/netfilter/nf_flow_table_core.c
+++ b/net/netfilter/nf_flow_table_core.c
@@ -522,7 +522,7 @@ int nf_flow_table_init(struct nf_flowtable *flowtable)
 {
 	int err;
 
-	INIT_DEFERRABLE_WORK(&flowtable->gc_work, nf_flow_offload_work_gc);
+	INIT_DELAYED_WORK(&flowtable->gc_work, nf_flow_offload_work_gc);
 	flow_block_init(&flowtable->flow_block);
 	init_rwsem(&flowtable->flow_block_lock);
 
-- 
1.8.3.1




More information about the kernel-team mailing list