diff mbox series

[net-next,1/1] netfilter: ctnetlink: Support offloaded conntrack entry deletion

Message ID 1679406604-133128-1-git-send-email-paulb@nvidia.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next,1/1] netfilter: ctnetlink: Support offloaded conntrack entry deletion | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 19 this patch: 19
netdev/cc_maintainers success CCed 10 of 10 maintainers
netdev/build_clang success Errors and warnings before: 18 this patch: 18
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 19 this patch: 19
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 20 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Paul Blakey March 21, 2023, 1:50 p.m. UTC
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(-)

Comments

Jakub Kicinski March 22, 2023, 4:58 a.m. UTC | #1
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.
diff mbox series

Patch

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]);