diff mbox series

[net-next] inet: remove (struct uncached_list)->quarantine

Message ID 20240604165150.726382-1-edumazet@google.com (mailing list archive)
State Accepted
Commit 98aa546af5e4f180439c82da403cc77926d3953b
Delegated to: Netdev Maintainers
Headers show
Series [net-next] inet: remove (struct uncached_list)->quarantine | 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/ynl success Generated files up to date; no warnings/errors; no diff in generated;
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: 904 this patch: 904
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 1 maintainers not CCed: dsahern@kernel.org
netdev/build_clang success Errors and warnings before: 905 this patch: 905
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: 908 this patch: 908
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 45 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-06-04--18-00 (tests: 1045)

Commit Message

Eric Dumazet June 4, 2024, 4:51 p.m. UTC
This list is used to tranfert dst that are handled by
rt_flush_dev() and rt6_uncached_list_flush_dev() out
of the per-cpu lists.

But quarantine list is not used later.

If we simply use list_del_init(&rt->dst.rt_uncached),
this also removes the dst from per-cpu list.

This patch also makes the future calls to rt_del_uncached_list()
and rt6_uncached_list_del() faster, because no spinlock
acquisition is needed anymore.

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/route.c | 4 +---
 net/ipv6/route.c | 5 +----
 2 files changed, 2 insertions(+), 7 deletions(-)

Comments

Simon Horman June 5, 2024, 6:54 p.m. UTC | #1
On Tue, Jun 04, 2024 at 04:51:50PM +0000, Eric Dumazet wrote:
> This list is used to tranfert dst that are handled by
> rt_flush_dev() and rt6_uncached_list_flush_dev() out
> of the per-cpu lists.
> 
> But quarantine list is not used later.
> 
> If we simply use list_del_init(&rt->dst.rt_uncached),
> this also removes the dst from per-cpu list.
> 
> This patch also makes the future calls to rt_del_uncached_list()
> and rt6_uncached_list_del() faster, because no spinlock
> acquisition is needed anymore.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Reviewed-by: Simon Horman <horms@kernel.org>
patchwork-bot+netdevbpf@kernel.org June 6, 2024, 10:40 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Tue,  4 Jun 2024 16:51:50 +0000 you wrote:
> This list is used to tranfert dst that are handled by
> rt_flush_dev() and rt6_uncached_list_flush_dev() out
> of the per-cpu lists.
> 
> But quarantine list is not used later.
> 
> If we simply use list_del_init(&rt->dst.rt_uncached),
> this also removes the dst from per-cpu list.
> 
> [...]

Here is the summary with links:
  - [net-next] inet: remove (struct uncached_list)->quarantine
    https://git.kernel.org/netdev/net-next/c/98aa546af5e4

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index b3073d1c8f8f71c88dc525eefb2b03be8f1f2945..cb0bdf34ed50c92688a3c0fe14c3e0c06d78b47c 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1481,7 +1481,6 @@  static bool rt_cache_route(struct fib_nh_common *nhc, struct rtable *rt)
 struct uncached_list {
 	spinlock_t		lock;
 	struct list_head	head;
-	struct list_head	quarantine;
 };
 
 static DEFINE_PER_CPU_ALIGNED(struct uncached_list, rt_uncached_list);
@@ -1532,7 +1531,7 @@  void rt_flush_dev(struct net_device *dev)
 			rt->dst.dev = blackhole_netdev;
 			netdev_ref_replace(dev, blackhole_netdev,
 					   &rt->dst.dev_tracker, GFP_ATOMIC);
-			list_move(&rt->dst.rt_uncached, &ul->quarantine);
+			list_del_init(&rt->dst.rt_uncached);
 		}
 		spin_unlock_bh(&ul->lock);
 	}
@@ -3661,7 +3660,6 @@  int __init ip_rt_init(void)
 		struct uncached_list *ul = &per_cpu(rt_uncached_list, cpu);
 
 		INIT_LIST_HEAD(&ul->head);
-		INIT_LIST_HEAD(&ul->quarantine);
 		spin_lock_init(&ul->lock);
 	}
 #ifdef CONFIG_IP_ROUTE_CLASSID
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index a504b88ec06b5aec6b0f915c3ff044cd98f864ab..7b3704ef401bbb258d9ac4380a934b8ad2031bbe 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -131,7 +131,6 @@  static struct fib6_info *rt6_get_route_info(struct net *net,
 struct uncached_list {
 	spinlock_t		lock;
 	struct list_head	head;
-	struct list_head	quarantine;
 };
 
 static DEFINE_PER_CPU_ALIGNED(struct uncached_list, rt6_uncached_list);
@@ -189,8 +188,7 @@  static void rt6_uncached_list_flush_dev(struct net_device *dev)
 				handled = true;
 			}
 			if (handled)
-				list_move(&rt->dst.rt_uncached,
-					  &ul->quarantine);
+				list_del_init(&rt->dst.rt_uncached);
 		}
 		spin_unlock_bh(&ul->lock);
 	}
@@ -6755,7 +6753,6 @@  int __init ip6_route_init(void)
 		struct uncached_list *ul = per_cpu_ptr(&rt6_uncached_list, cpu);
 
 		INIT_LIST_HEAD(&ul->head);
-		INIT_LIST_HEAD(&ul->quarantine);
 		spin_lock_init(&ul->lock);
 	}