netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ipv6: Cleanup fib6_drop_pcpu_from()
@ 2025-07-01  4:12 Yue Haibing
  2025-07-01 14:30 ` Simon Horman
  2025-07-03 14:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Yue Haibing @ 2025-07-01  4:12 UTC (permalink / raw)
  To: davem, dsahern, edumazet, kuba, pabeni, horms, kuniyu
  Cc: netdev, linux-kernel, yuehaibing

Since commit 0e2338749192 ("ipv6: fix races in ip6_dst_destroy()"), 
'table' is unused in __fib6_drop_pcpu_from(), no need pass it from
fib6_drop_pcpu_from().

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
---
 net/ipv6/ip6_fib.c | 26 +++++++-------------------
 1 file changed, 7 insertions(+), 19 deletions(-)

diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 93578b2ec35f..7272d7e0fc36 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -963,8 +963,7 @@ static struct fib6_node *fib6_add_1(struct net *net,
 }
 
 static void __fib6_drop_pcpu_from(struct fib6_nh *fib6_nh,
-				  const struct fib6_info *match,
-				  const struct fib6_table *table)
+				  const struct fib6_info *match)
 {
 	int cpu;
 
@@ -999,21 +998,15 @@ static void __fib6_drop_pcpu_from(struct fib6_nh *fib6_nh,
 	rcu_read_unlock();
 }
 
-struct fib6_nh_pcpu_arg {
-	struct fib6_info	*from;
-	const struct fib6_table *table;
-};
-
 static int fib6_nh_drop_pcpu_from(struct fib6_nh *nh, void *_arg)
 {
-	struct fib6_nh_pcpu_arg *arg = _arg;
+	struct fib6_info *arg = _arg;
 
-	__fib6_drop_pcpu_from(nh, arg->from, arg->table);
+	__fib6_drop_pcpu_from(nh, arg);
 	return 0;
 }
 
-static void fib6_drop_pcpu_from(struct fib6_info *f6i,
-				const struct fib6_table *table)
+static void fib6_drop_pcpu_from(struct fib6_info *f6i)
 {
 	/* Make sure rt6_make_pcpu_route() wont add other percpu routes
 	 * while we are cleaning them here.
@@ -1022,19 +1015,14 @@ static void fib6_drop_pcpu_from(struct fib6_info *f6i,
 	mb(); /* paired with the cmpxchg() in rt6_make_pcpu_route() */
 
 	if (f6i->nh) {
-		struct fib6_nh_pcpu_arg arg = {
-			.from = f6i,
-			.table = table
-		};
-
 		rcu_read_lock();
-		nexthop_for_each_fib6_nh(f6i->nh, fib6_nh_drop_pcpu_from, &arg);
+		nexthop_for_each_fib6_nh(f6i->nh, fib6_nh_drop_pcpu_from, f6i);
 		rcu_read_unlock();
 	} else {
 		struct fib6_nh *fib6_nh;
 
 		fib6_nh = f6i->fib6_nh;
-		__fib6_drop_pcpu_from(fib6_nh, f6i, table);
+		__fib6_drop_pcpu_from(fib6_nh, f6i);
 	}
 }
 
@@ -1045,7 +1033,7 @@ static void fib6_purge_rt(struct fib6_info *rt, struct fib6_node *fn,
 
 	/* Flush all cached dst in exception table */
 	rt6_flush_exceptions(rt);
-	fib6_drop_pcpu_from(rt, table);
+	fib6_drop_pcpu_from(rt);
 
 	if (rt->nh) {
 		spin_lock(&rt->nh->lock);
-- 
2.34.1


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

* Re: [PATCH net-next] ipv6: Cleanup fib6_drop_pcpu_from()
  2025-07-01  4:12 [PATCH net-next] ipv6: Cleanup fib6_drop_pcpu_from() Yue Haibing
@ 2025-07-01 14:30 ` Simon Horman
  2025-07-03 14:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-07-01 14:30 UTC (permalink / raw)
  To: Yue Haibing
  Cc: davem, dsahern, edumazet, kuba, pabeni, kuniyu, netdev,
	linux-kernel

On Tue, Jul 01, 2025 at 12:12:35PM +0800, Yue Haibing wrote:
> Since commit 0e2338749192 ("ipv6: fix races in ip6_dst_destroy()"), 
> 'table' is unused in __fib6_drop_pcpu_from(), no need pass it from
> fib6_drop_pcpu_from().
> 
> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [PATCH net-next] ipv6: Cleanup fib6_drop_pcpu_from()
  2025-07-01  4:12 [PATCH net-next] ipv6: Cleanup fib6_drop_pcpu_from() Yue Haibing
  2025-07-01 14:30 ` Simon Horman
@ 2025-07-03 14:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-07-03 14:10 UTC (permalink / raw)
  To: Yue Haibing
  Cc: davem, dsahern, edumazet, kuba, pabeni, horms, kuniyu, netdev,
	linux-kernel

Hello:

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

On Tue, 1 Jul 2025 12:12:35 +0800 you wrote:
> Since commit 0e2338749192 ("ipv6: fix races in ip6_dst_destroy()"),
> 'table' is unused in __fib6_drop_pcpu_from(), no need pass it from
> fib6_drop_pcpu_from().
> 
> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
> ---
>  net/ipv6/ip6_fib.c | 26 +++++++-------------------
>  1 file changed, 7 insertions(+), 19 deletions(-)

Here is the summary with links:
  - [net-next] ipv6: Cleanup fib6_drop_pcpu_from()
    https://git.kernel.org/netdev/net-next/c/5f712c3877f9

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-07-03 14:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-01  4:12 [PATCH net-next] ipv6: Cleanup fib6_drop_pcpu_from() Yue Haibing
2025-07-01 14:30 ` Simon Horman
2025-07-03 14:10 ` patchwork-bot+netdevbpf

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