netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org, paulb@mellanox.com,
	ozsh@mellanox.com, vladbu@mellanox.com, jiri@resnulli.us,
	kuba@kernel.org, saeedm@mellanox.com, michael.chan@broadcom.com,
	sriharsha.basavapatna@broadcom.com
Subject: [PATCH net-next 1/8] netfilter: nf_flowtable: expose nf_flow_table_gc_cleanup()
Date: Fri, 29 May 2020 02:25:34 +0200	[thread overview]
Message-ID: <20200529002541.19743-2-pablo@netfilter.org> (raw)
In-Reply-To: <20200529002541.19743-1-pablo@netfilter.org>

This function schedules the flow teardown state and it forces a gc run.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 include/net/netfilter/nf_flow_table.h | 2 ++
 net/netfilter/nf_flow_table_core.c    | 6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/net/netfilter/nf_flow_table.h b/include/net/netfilter/nf_flow_table.h
index c54a7f707e50..d7338bfd7b0f 100644
--- a/include/net/netfilter/nf_flow_table.h
+++ b/include/net/netfilter/nf_flow_table.h
@@ -175,6 +175,8 @@ void flow_offload_refresh(struct nf_flowtable *flow_table,
 
 struct flow_offload_tuple_rhash *flow_offload_lookup(struct nf_flowtable *flow_table,
 						     struct flow_offload_tuple *tuple);
+void nf_flow_table_gc_cleanup(struct nf_flowtable *flowtable,
+			      struct net_device *dev);
 void nf_flow_table_cleanup(struct net_device *dev);
 
 int nf_flow_table_init(struct nf_flowtable *flow_table);
diff --git a/net/netfilter/nf_flow_table_core.c b/net/netfilter/nf_flow_table_core.c
index 42da6e337276..6a3034f84ab6 100644
--- a/net/netfilter/nf_flow_table_core.c
+++ b/net/netfilter/nf_flow_table_core.c
@@ -588,8 +588,8 @@ static void nf_flow_table_do_cleanup(struct flow_offload *flow, void *data)
 		flow_offload_teardown(flow);
 }
 
-static void nf_flow_table_iterate_cleanup(struct nf_flowtable *flowtable,
-					  struct net_device *dev)
+void nf_flow_table_gc_cleanup(struct nf_flowtable *flowtable,
+			      struct net_device *dev)
 {
 	nf_flow_table_iterate(flowtable, nf_flow_table_do_cleanup, dev);
 	flush_delayed_work(&flowtable->gc_work);
@@ -602,7 +602,7 @@ void nf_flow_table_cleanup(struct net_device *dev)
 
 	mutex_lock(&flowtable_lock);
 	list_for_each_entry(flowtable, &flowtables, list)
-		nf_flow_table_iterate_cleanup(flowtable, dev);
+		nf_flow_table_gc_cleanup(flowtable, dev);
 	mutex_unlock(&flowtable_lock);
 }
 EXPORT_SYMBOL_GPL(nf_flow_table_cleanup);
-- 
2.20.1


  reply	other threads:[~2020-05-29  0:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29  0:25 [PATCH net-next 0/8] the indirect flow_block infrastructure, revisited Pablo Neira Ayuso
2020-05-29  0:25 ` Pablo Neira Ayuso [this message]
2020-05-29  0:25 ` [PATCH net-next 2/8] net: flow_offload: consolidate indirect flow_block infrastructure Pablo Neira Ayuso
2020-05-29  0:25 ` [PATCH net-next 3/8] net: cls_api: add tcf_block_offload_init() Pablo Neira Ayuso
2020-05-29  0:25 ` [PATCH net-next 4/8] net: use flow_indr_dev_setup_offload() Pablo Neira Ayuso
2020-05-29  0:25 ` [PATCH net-next 5/8] mlx5: update indirect block support Pablo Neira Ayuso
2020-05-29  0:25 ` [PATCH net-next 6/8] nfp: " Pablo Neira Ayuso
2020-05-29  0:25 ` [PATCH net-next 7/8] bnxt_tc: " Pablo Neira Ayuso
2020-05-29  0:25 ` [PATCH net-next 8/8] net: remove indirect block netdev event registration Pablo Neira Ayuso
2020-06-01 18:42 ` [PATCH net-next 0/8] the indirect flow_block infrastructure, revisited David Miller

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=20200529002541.19743-2-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=ozsh@mellanox.com \
    --cc=paulb@mellanox.com \
    --cc=saeedm@mellanox.com \
    --cc=sriharsha.basavapatna@broadcom.com \
    --cc=vladbu@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).