All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: bridge: remove redundant check of f->dst
@ 2024-04-23 10:53 linke li
  2024-04-23 11:12 ` Nikolay Aleksandrov
  2024-04-25 12:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 5+ messages in thread
From: linke li @ 2024-04-23 10:53 UTC (permalink / raw)
  Cc: xujianhao01, linke li, Roopa Prabhu, Nikolay Aleksandrov,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	bridge, netdev, linux-kernel

In br_fill_forward_path(), f->dst is checked not to be NULL, then
immediately read using READ_ONCE and checked again. The first check is
useless, so this patch aims to remove the redundant check of f->dst.

Signed-off-by: linke li <lilinke99@qq.com>
---
 net/bridge/br_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 65cee0ad3c1b..ae33b30ff87c 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -405,7 +405,7 @@ static int br_fill_forward_path(struct net_device_path_ctx *ctx,
 	br_vlan_fill_forward_path_pvid(br, ctx, path);
 
 	f = br_fdb_find_rcu(br, ctx->daddr, path->bridge.vlan_id);
-	if (!f || !f->dst)
+	if (!f)
 		return -1;
 
 	dst = READ_ONCE(f->dst);
-- 
2.39.3 (Apple Git-146)


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

* Re: [PATCH] net: bridge: remove redundant check of f->dst
  2024-04-23 10:53 [PATCH] net: bridge: remove redundant check of f->dst linke li
@ 2024-04-23 11:12 ` Nikolay Aleksandrov
  2024-04-23 11:58   ` linke li
  2024-04-25 12:20 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 5+ messages in thread
From: Nikolay Aleksandrov @ 2024-04-23 11:12 UTC (permalink / raw)
  To: linke li
  Cc: xujianhao01, Roopa Prabhu, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, bridge, netdev, linux-kernel

On 4/23/24 13:53, linke li wrote:
> In br_fill_forward_path(), f->dst is checked not to be NULL, then
> immediately read using READ_ONCE and checked again. The first check is
> useless, so this patch aims to remove the redundant check of f->dst.
> 
> Signed-off-by: linke li <lilinke99@qq.com>
> ---
>   net/bridge/br_device.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
> index 65cee0ad3c1b..ae33b30ff87c 100644
> --- a/net/bridge/br_device.c
> +++ b/net/bridge/br_device.c
> @@ -405,7 +405,7 @@ static int br_fill_forward_path(struct net_device_path_ctx *ctx,
>   	br_vlan_fill_forward_path_pvid(br, ctx, path);
>   
>   	f = br_fdb_find_rcu(br, ctx->daddr, path->bridge.vlan_id);
> -	if (!f || !f->dst)
> +	if (!f)
>   		return -1;
>   
>   	dst = READ_ONCE(f->dst);

This patch should target net-next (PATCH net-next in subject).
Other than that the patch seems fine.

Acked-by: Nikolay Aleksandrov <razor@blackwall.org>


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

* Re: [PATCH] net: bridge: remove redundant check of f->dst
  2024-04-23 11:12 ` Nikolay Aleksandrov
@ 2024-04-23 11:58   ` linke li
  2024-04-23 12:17     ` Nikolay Aleksandrov
  0 siblings, 1 reply; 5+ messages in thread
From: linke li @ 2024-04-23 11:58 UTC (permalink / raw)
  To: razor
  Cc: bridge, davem, edumazet, kuba, lilinke99, linux-kernel, netdev,
	pabeni, roopa, xujianhao01

Thanks for your advice! Should I submit another patch with subject
"[PATCH net-next] net: bridge: remove redundant check of f->dst" or
"[PATCH net-next v2] net: bridge: remove redundant check of f->dst"?


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

* Re: [PATCH] net: bridge: remove redundant check of f->dst
  2024-04-23 11:58   ` linke li
@ 2024-04-23 12:17     ` Nikolay Aleksandrov
  0 siblings, 0 replies; 5+ messages in thread
From: Nikolay Aleksandrov @ 2024-04-23 12:17 UTC (permalink / raw)
  To: linke li
  Cc: bridge, davem, edumazet, kuba, linux-kernel, netdev, pabeni,
	roopa, xujianhao01

On 4/23/24 14:58, linke li wrote:
> Thanks for your advice! Should I submit another patch with subject
> "[PATCH net-next] net: bridge: remove redundant check of f->dst" or
> "[PATCH net-next v2] net: bridge: remove redundant check of f->dst"?
> 

Please don't delete the whole thread, just reply below it and snip any 
unnecessary big chunks if needed. As to your question - maintainers
usually take care of this so re-submission is not necessary but in case
they request a re-submission please wait 24 hours before sending another
version. v2 is expected in the subject, also please add a small 
description of what changed in v2.

Thanks,
  Nik


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

* Re: [PATCH] net: bridge: remove redundant check of f->dst
  2024-04-23 10:53 [PATCH] net: bridge: remove redundant check of f->dst linke li
  2024-04-23 11:12 ` Nikolay Aleksandrov
@ 2024-04-25 12:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-25 12:20 UTC (permalink / raw)
  To: linke li
  Cc: xujianhao01, roopa, razor, davem, edumazet, kuba, pabeni, bridge,
	netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Tue, 23 Apr 2024 18:53:26 +0800 you wrote:
> In br_fill_forward_path(), f->dst is checked not to be NULL, then
> immediately read using READ_ONCE and checked again. The first check is
> useless, so this patch aims to remove the redundant check of f->dst.
> 
> Signed-off-by: linke li <lilinke99@qq.com>
> ---
>  net/bridge/br_device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - net: bridge: remove redundant check of f->dst
    https://git.kernel.org/netdev/net-next/c/e7d96e750f2b

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] 5+ messages in thread

end of thread, other threads:[~2024-04-25 12:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-23 10:53 [PATCH] net: bridge: remove redundant check of f->dst linke li
2024-04-23 11:12 ` Nikolay Aleksandrov
2024-04-23 11:58   ` linke li
2024-04-23 12:17     ` Nikolay Aleksandrov
2024-04-25 12:20 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.