netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roi Dayan <roid@mellanox.com>
To: netdev@vger.kernel.org
Cc: pablo@netfilter.org, Paul Blakey <paulb@mellanox.com>,
	Oz Shlomo <ozsh@mellanox.com>, Roi Dayan <roid@mellanox.com>,
	Marcelo Ricardo Leitner <mleitner@redhat.com>
Subject: [PATCH net v2 2/2] netfilter: flowtable: Set offload timeout when adding flow
Date: Mon,  3 Aug 2020 10:33:05 +0300	[thread overview]
Message-ID: <20200803073305.702079-3-roid@mellanox.com> (raw)
In-Reply-To: <20200803073305.702079-1-roid@mellanox.com>

On heavily loaded systems the GC can take time to go over all existing
conns and reset their timeout. At that time other calls like from
nf_conntrack_in() can call of nf_ct_is_expired() and see the conn as
expired. To fix this when we set the offload bit we should also reset
the timeout instead of counting on GC to finish first iteration over
all conns before the initial timeout.

Fixes: 90964016e5d3 ("netfilter: nf_conntrack: add IPS_OFFLOAD status bit")
Signed-off-by: Roi Dayan <roid@mellanox.com>
---

Notes:
    v2
    - timeout fix from flow_offload_add() instead of act_ct

 net/netfilter/nf_flow_table_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/netfilter/nf_flow_table_core.c b/net/netfilter/nf_flow_table_core.c
index b1eb5272b379..4f7a567c536e 100644
--- a/net/netfilter/nf_flow_table_core.c
+++ b/net/netfilter/nf_flow_table_core.c
@@ -243,6 +243,8 @@ int flow_offload_add(struct nf_flowtable *flow_table, struct flow_offload *flow)
 		return err;
 	}
 
+	nf_ct_offload_timeout(flow->ct);
+
 	if (nf_flowtable_hw_offload(flow_table)) {
 		__set_bit(NF_FLOW_HW, &flow->flags);
 		nf_flow_offload_add(flow_table, flow);
-- 
2.8.4


  parent reply	other threads:[~2020-08-03  7:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-03  7:33 [PATCH net v2 0/2] netfilter: conntrack: Fix CT offload timeout on heavily loaded systems Roi Dayan
2020-08-03  7:33 ` [PATCH net v2 1/2] netfilter: conntrack: Move nf_ct_offload_timeout to header file Roi Dayan
2020-08-03 11:03   ` Pablo Neira Ayuso
2020-08-03 13:15     ` Roi Dayan
2020-08-03  7:33 ` Roi Dayan [this message]
2020-08-03 10:33 ` [PATCH net v2 0/2] netfilter: conntrack: Fix CT offload timeout on heavily loaded systems Pablo Neira Ayuso

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=20200803073305.702079-3-roid@mellanox.com \
    --to=roid@mellanox.com \
    --cc=mleitner@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=ozsh@mellanox.com \
    --cc=pablo@netfilter.org \
    --cc=paulb@mellanox.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;
as well as URLs for NNTP newsgroup(s).