From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Fainelli <florian.fainelli@broadcom.com>
Cc: netdev@vger.kernel.org, Florian Westphal <fw@strlen.de>,
Phil Sutter <phil@nwl.cc>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>,
Toshiaki Makita <toshiaki.makita1@gmail.com>,
open list <linux-kernel@vger.kernel.org>,
"open list:NETFILTER" <netfilter-devel@vger.kernel.org>,
"open list:NETFILTER" <coreteam@netfilter.org>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH net 2/4] netfilter: flowtable: restore the GRE conntrack timeout on teardown
Date: Sun, 22 Nov 2026 00:10:35 +0100 [thread overview]
Message-ID: <awIk65mKn6iBATE0@chamomile> (raw)
In-Reply-To: <20261118201250.2075007-3-florian.fainelli@broadcom.com>
Hi Florian,
On Wed, Nov 18, 2026 at 12:12:48PM -0800, Florian Fainelli wrote:
> flow_offload_add() sets the timeout of the conntrack entry to NF_CT_DAY
> for every offloaded flow, and the GC keeps extending it for GRE too.
> flow_offload_fixup_ct() only restores the conntrack timeout of TCP and
> UDP flows when the flow is torn down, so an offloaded GRE entry which does
> not see any other packet on the slow path stays for up to a day instead
> of expiring after the GRE conntrack timeout.
>
> Restore the GRE timeout, replied or unreplied, as for UDP. GRE has no
> offload timeout of its own, flow_offload_get_timeout() uses the default
> flowtable timeout for it, so use that one when the flow expired.
I think GRE has never worked then. I have been a bit skeptical about
this support, but tc/ct developers wanted to have this in.
I think no crash is going, so let's better route this through
nf-next.git.
> Fixes: 4e8d9584d154 ("netfilter: flowtable: Support GRE")
> Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
> ---
> net/netfilter/nf_flow_table_core.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/net/netfilter/nf_flow_table_core.c b/net/netfilter/nf_flow_table_core.c
> index 2aa2647ed9df..051b15aecd89 100644
> --- a/net/netfilter/nf_flow_table_core.c
> +++ b/net/netfilter/nf_flow_table_core.c
> @@ -237,6 +237,18 @@ static void flow_offload_fixup_ct(struct flow_offload *flow)
> timeout = READ_ONCE(tn->timeouts[state]);
> expired = nf_flow_has_expired(flow);
> offload_timeout = READ_ONCE(tn->offload_timeout);
> +#ifdef CONFIG_NF_CT_PROTO_GRE
> + } else if (l4num == IPPROTO_GRE) {
> + const struct nf_gre_net *tn = nf_gre_pernet(net);
> + enum gre_conntrack state =
> + test_bit(IPS_SEEN_REPLY_BIT, &ct->status) ?
> + GRE_CT_REPLIED : GRE_CT_UNREPLIED;
> +
> + timeout = READ_ONCE(tn->timeouts[state]);
> + expired = nf_flow_has_expired(flow);
> + /* GRE has no offload timeout: see flow_offload_get_timeout(). */
> + offload_timeout = NF_FLOW_TIMEOUT;
> +#endif
> } else {
> return;
> }
> --
> 2.53.0
>
>
next prev parent reply other threads:[~2026-11-21 23:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 20:12 [PATCH net 0/4] netfilter: flowtable: Preliminary fixes Florian Fainelli
2026-11-18 20:12 ` [PATCH net 1/4] netfilter: flowtable: do not queue offload work after DESTROY Florian Fainelli
2026-11-21 23:23 ` Pablo Neira Ayuso
2026-11-18 20:12 ` [PATCH net 2/4] netfilter: flowtable: restore the GRE conntrack timeout on teardown Florian Fainelli
2026-11-21 23:10 ` Pablo Neira Ayuso [this message]
2026-11-18 20:12 ` [PATCH net 3/4] selftests: netfilter: check hardware offload work after DESTROY Florian Fainelli
2026-11-18 20:12 ` [PATCH net 4/4] selftests: netfilter: check the GRE timeout after flowtable teardown Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=awIk65mKn6iBATE0@chamomile \
--to=pablo@netfilter.org \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=fw@strlen.de \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=phil@nwl.cc \
--cc=shuah@kernel.org \
--cc=toshiaki.makita1@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox