diff mbox series

[net] hsr: ratelimit only when errors are printed

Message ID 20230315-net-20230315-hsr_framereg-ratelimit-v1-1-61d2ef176d11@tessares.net (mailing list archive)
State Accepted
Commit 1b0120e4db0bf2838d1ce741195ce4b7cc100b91
Delegated to: Netdev Maintainers
Headers show
Series [net] hsr: ratelimit only when errors are printed | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 18 this patch: 18
netdev/cc_maintainers warning 1 maintainers not CCed: bigeasy@linutronix.de
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 Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 18 this patch: 18
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Matthieu Baerts March 15, 2023, 8:25 p.m. UTC
Recently, when automatically merging -net and net-next in MPTCP devel
tree, our CI reported [1] a conflict in hsr, the same as the one
reported by Stephen in netdev [2].

When looking at the conflict, I noticed it is in fact the v1 [3] that
has been applied in -net and the v2 [4] in net-next. Maybe the v1 was
applied by accident.

As mentioned by Jakub Kicinski [5], the new condition makes more sense
before the net_ratelimit(), not to update net_ratelimit's state which is
unnecessary if we're not going to print either way.

Here, this modification applies the v2 but in -net.

Link: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/4423171069 [1]
Link: https://lore.kernel.org/netdev/20230315100914.53fc1760@canb.auug.org.au/ [2]
Link: https://lore.kernel.org/netdev/20230307133229.127442-1-koverskeid@gmail.com/ [3]
Link: https://lore.kernel.org/netdev/20230309092302.179586-1-koverskeid@gmail.com/ [4]
Link: https://lore.kernel.org/netdev/20230308232001.2fb62013@kernel.org/ [5]
Fixes: 28e8cabe80f3 ("net: hsr: Don't log netdev_err message on unknown prp dst node")
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
 net/hsr/hsr_framereg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


---
base-commit: 75014826d0826d175aa9e36cd8e118793263e3f4
change-id: 20230315-net-20230315-hsr_framereg-ratelimit-3c8ff6e43511

Best regards,

Comments

Steen Hegelund March 16, 2023, 9:35 a.m. UTC | #1
Hi Mattieu,

Looks good to me.

Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>

On Wed, 2023-03-15 at 21:25 +0100, Matthieu Baerts wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> Recently, when automatically merging -net and net-next in MPTCP devel
> tree, our CI reported [1] a conflict in hsr, the same as the one
> reported by Stephen in netdev [2].
> 
> When looking at the conflict, I noticed it is in fact the v1 [3] that
> has been applied in -net and the v2 [4] in net-next. Maybe the v1 was
> applied by accident.
> 
> As mentioned by Jakub Kicinski [5], the new condition makes more sense
> before the net_ratelimit(), not to update net_ratelimit's state which is
> unnecessary if we're not going to print either way.
> 
> Here, this modification applies the v2 but in -net.
> 
> Link: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/4423171069 [1]
> Link: https://lore.kernel.org/netdev/20230315100914.53fc1760@canb.auug.org.au/ [2]
> Link: https://lore.kernel.org/netdev/20230307133229.127442-1-koverskeid@gmail.com/ [3]
> Link: https://lore.kernel.org/netdev/20230309092302.179586-1-koverskeid@gmail.com/ [4]
> Link: https://lore.kernel.org/netdev/20230308232001.2fb62013@kernel.org/ [5]
> Fixes: 28e8cabe80f3 ("net: hsr: Don't log netdev_err message on unknown prp dst node")
> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
> ---
>  net/hsr/hsr_framereg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c
> index 865eda39d601..b77f1189d19d 100644
> --- a/net/hsr/hsr_framereg.c
> +++ b/net/hsr/hsr_framereg.c
> @@ -415,7 +415,7 @@ void hsr_addr_subst_dest(struct hsr_node *node_src, struct sk_buff *skb,
>         node_dst = find_node_by_addr_A(&port->hsr->node_db,
>                                        eth_hdr(skb)->h_dest);
>         if (!node_dst) {
> -               if (net_ratelimit() && port->hsr->prot_version != PRP_V1)
> +               if (port->hsr->prot_version != PRP_V1 && net_ratelimit())
>                         netdev_err(skb->dev, "%s: Unknown node\n", __func__);
>                 return;
>         }
> 
> ---
> base-commit: 75014826d0826d175aa9e36cd8e118793263e3f4
> change-id: 20230315-net-20230315-hsr_framereg-ratelimit-3c8ff6e43511
> 
> Best regards,
> --
> Matthieu Baerts <matthieu.baerts@tessares.net>
> 

BR
Steen
Jakub Kicinski March 17, 2023, 4:12 a.m. UTC | #2
On Wed, 15 Mar 2023 21:25:17 +0100 Matthieu Baerts wrote:
> Recently, when automatically merging -net and net-next in MPTCP devel
> tree, our CI reported [1] a conflict in hsr, the same as the one
> reported by Stephen in netdev [2].
> 
> When looking at the conflict, I noticed it is in fact the v1 [3] that
> has been applied in -net and the v2 [4] in net-next. Maybe the v1 was
> applied by accident.

Ah, thank you! I didn't even notice that the version which went into 
net was v1 :S
patchwork-bot+netdevbpf@kernel.org March 17, 2023, 4:20 a.m. UTC | #3
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 15 Mar 2023 21:25:17 +0100 you wrote:
> Recently, when automatically merging -net and net-next in MPTCP devel
> tree, our CI reported [1] a conflict in hsr, the same as the one
> reported by Stephen in netdev [2].
> 
> When looking at the conflict, I noticed it is in fact the v1 [3] that
> has been applied in -net and the v2 [4] in net-next. Maybe the v1 was
> applied by accident.
> 
> [...]

Here is the summary with links:
  - [net] hsr: ratelimit only when errors are printed
    https://git.kernel.org/netdev/net/c/1b0120e4db0b

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c
index 865eda39d601..b77f1189d19d 100644
--- a/net/hsr/hsr_framereg.c
+++ b/net/hsr/hsr_framereg.c
@@ -415,7 +415,7 @@  void hsr_addr_subst_dest(struct hsr_node *node_src, struct sk_buff *skb,
 	node_dst = find_node_by_addr_A(&port->hsr->node_db,
 				       eth_hdr(skb)->h_dest);
 	if (!node_dst) {
-		if (net_ratelimit() && port->hsr->prot_version != PRP_V1)
+		if (port->hsr->prot_version != PRP_V1 && net_ratelimit())
 			netdev_err(skb->dev, "%s: Unknown node\n", __func__);
 		return;
 	}