netfilter: flowtable: fix excessive hw offload attempts after failure
authorFelix Fietkau <nbd@nbd.name>
Mon, 9 May 2022 12:26:13 +0000 (14:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 May 2022 07:57:30 +0000 (09:57 +0200)
commit5f4197a020c049a59ea7907c31f9ab037dcefefe
treec054fd582c34b2509126c609736d3f987c6f0622
parentc22ee3a0674ca15dfc6dab625b8bc095d1c3b217
netfilter: flowtable: fix excessive hw offload attempts after failure

[ Upstream commit 396ef64113a8ba01c46315d67a99db8dde3eef51 ]

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.

Fixes: c07531c01d82 ("netfilter: flowtable: Remove redundant hw refresh bit")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_flow_table_core.c