linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/1] netfilter: ctnetlink: Support offloaded conntrack entry deletion
@ 2023-03-21 13:50 Paul Blakey
  2023-03-22  4:58 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Blakey @ 2023-03-21 13:50 UTC (permalink / raw)
  To: Paul Blakey, netdev, Saeed Mahameed, Pablo Neira Ayuso,
	Jozsef Kadlecsik, Florian Westphal, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netfilter-devel,
	coreteam, linux-kernel
  Cc: Oz Shlomo, Roi Dayan, Vlad Buslov

Currently, offloaded conntrack entries (flows) can only be deleted
after they are removed from offload, which is either by timeout,
tcp state change or tc ct rule deletion. This can cause issues for
users wishing to manually delete or flush existing entries.

Support deletion of offloaded conntrack entries.

Example usage:
 # Delete all offloaded (and non offloaded) conntrack entries
 # whose source address is 1.2.3.4
 $ conntrack -D -s 1.2.3.4
 # Delete all entries
 $ conntrack -F

Signed-off-by: Paul Blakey <paulb@nvidia.com>
---
 net/netfilter/nf_conntrack_netlink.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index bfc3aaa2c872..fbc47e4b7bc3 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -1554,9 +1554,6 @@ static const struct nla_policy ct_nla_policy[CTA_MAX+1] = {
 
 static int ctnetlink_flush_iterate(struct nf_conn *ct, void *data)
 {
-	if (test_bit(IPS_OFFLOAD_BIT, &ct->status))
-		return 0;
-
 	return ctnetlink_filter_match(ct, data);
 }
 
@@ -1626,11 +1623,6 @@ static int ctnetlink_del_conntrack(struct sk_buff *skb,
 
 	ct = nf_ct_tuplehash_to_ctrack(h);
 
-	if (test_bit(IPS_OFFLOAD_BIT, &ct->status)) {
-		nf_ct_put(ct);
-		return -EBUSY;
-	}
-
 	if (cda[CTA_ID]) {
 		__be32 id = nla_get_be32(cda[CTA_ID]);
 
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next 1/1] netfilter: ctnetlink: Support offloaded conntrack entry deletion
  2023-03-21 13:50 [PATCH net-next 1/1] netfilter: ctnetlink: Support offloaded conntrack entry deletion Paul Blakey
@ 2023-03-22  4:58 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2023-03-22  4:58 UTC (permalink / raw)
  To: Paul Blakey
  Cc: netdev, Saeed Mahameed, Pablo Neira Ayuso, Jozsef Kadlecsik,
	Florian Westphal, David S. Miller, Eric Dumazet, Paolo Abeni,
	netfilter-devel, coreteam, linux-kernel, Oz Shlomo, Roi Dayan,
	Vlad Buslov

On Tue, 21 Mar 2023 15:50:04 +0200 Paul Blakey wrote:
> To: Paul Blakey <paulb@nvidia.com>, <netdev@vger.kernel.org>, Saeed Mahameed  <saeedm@nvidia.com>, Pablo Neira Ayuso <pablo@netfilter.org>, "Jozsef  Kadlecsik" <kadlec@netfilter.org>, Florian Westphal <fw@strlen.de>, "David S.  Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, "Jakub  Kicinski" <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,  <netfilter-devel@vger.kernel.org>, <coreteam@netfilter.org>,  <linux-kernel@vger.kernel.org>
> CC: Oz Shlomo <ozsh@nvidia.com>, Roi Dayan <roid@nvidia.com>, Vlad Buslov  <vladbu@nvidia.com>

Please put the maintainers you expect to take the patch on To:
And the rest of the people on CC:

> Subject: [PATCH net-next 1/1] netfilter: ctnetlink: Support offloaded conntrack entry deletion

git log --no-merges \
	--format='%<(20)%cn %cs  %<(47,trunc)%s' \
	-- \
	net/netfilter/nf_conntrack_netlink.c

clearly not net-next, we don't take patches to this file.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-22  4:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-21 13:50 [PATCH net-next 1/1] netfilter: ctnetlink: Support offloaded conntrack entry deletion Paul Blakey
2023-03-22  4:58 ` Jakub Kicinski

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).