Skip to contentSkip to conversation

selftests: net: forwarding: bridge_vlan_mcast: Allow default startup query interval to vary by HZ

PATCH Superseded Jin Li 3 participants 5 messages Oct 9 – Oct 27

Subsystems (4)
lore
Share & tools
lore

Jin Li

author
#0 lore raw

PATCH 1/1 selftests: net: forwarding: bridge_vlan_mcast: Allow default startup query interval to vary by HZ

The mcast_startup_query_interval default value is calculated as 125 * HZ / 4. With CONFIG_HZ=250, this results in 3124 instead of 3125 due to integer truncation. The test currently hardcodes 3125, which fails on kernels built with CONFIG_HZ=250.

Allow a +/- 1 tolerance for the default value check to account for this rounding, while still catching genuine regressions in the default value.

---
 tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh +1 -1
index c4cd2078a8db..e72680869721 100755
@@ -383,7 +383,7 @@ vlmc_startup_query_test()
 
 	echo -n $goutput |
 		jq -e ".[].vlans[] | select(.vlan == 10 and \
-					    .mcast_startup_query_interval == 3125) " &>/dev/null
+                                           .mcast_startup_query_interval >= 3124 and .mcast_startup_query_interval <= 3126) " &>/dev/null
 	check_err $? "Wrong default mcast_startup_query_interval global vlan option value"
 	log_test "Vlan mcast_startup_query_interval global option default value"
 
Signature · 1 line
2.53.0
maintainer
#1 lore raw

Subject prefix should be "[PATCH net-next]" given that this never worked. See:

https://docs.kernel.org/next/process/maintainer-netdev.html

Quoted 19 lines · Jin Li

The mcast_startup_query_interval default value is calculated as 125 * HZ / 4. With CONFIG_HZ=250, this results in 3124 instead of 3125 due to integer truncation. The test currently hardcodes 3125, which fails on kernels built with CONFIG_HZ=250.

Allow a +/- 1 tolerance for the default value check to account for this rounding, while still catching genuine regressions in the default value.

---
 tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh +0 -0
index c4cd2078a8db..e72680869721 100755

tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh vlmc_startup_query_test() · line 386

Quoted 5 lines
tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh +1 -1
@@ -383,7 +383,7 @@ vlmc_startup_query_test()
 
 	echo -n $goutput |
 		jq -e ".[].vlans[] | select(.vlan == 10 and \
-					    .mcast_startup_query_interval == 3125) " &>/dev/null
+                                           .mcast_startup_query_interval >= 3124 and .mcast_startup_query_interval <= 3126) " &>/dev/null

Maintain the same type of indentation (tabs) as the current line and fold it:

tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh +2 -1
index c4cd2078a8db..c07c2af5df94 100755
@@ -383,7 +383,8 @@ vlmc_startup_query_test()
 
 	echo -n $goutput |
 		jq -e ".[].vlans[] | select(.vlan == 10 and \
-					    .mcast_startup_query_interval == 3125) " &>/dev/null
+					    .mcast_startup_query_interval >= 3124 and \
+					    .mcast_startup_query_interval <= 3126) " &>/dev/null
 	check_err $? "Wrong default mcast_startup_query_interval global vlan option value"
 	log_test "Vlan mcast_startup_query_interval global option default value"
 
author
#2 lore raw

PATCH v2 1/1 selftests: net: forwarding: bridge_vlan_mcast: Allow default startup query interval to vary by HZ

The mcast_startup_query_interval default value is calculated as 125 * HZ / 4. With CONFIG_HZ=250, this results in 3124 instead of 3125 due to integer truncation. The test currently hardcodes 3125, which fails on kernels built with CONFIG_HZ=250.

Allow a +/- 1 tolerance for the default value check to account for this rounding, while still catching genuine regressions in the default value.

---
 tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/net/forwarding/bridge_vlan_mcast.sh +2 -1
index c4cd2078a8db..c07c2af5df94 100755
@@ -383,7 +383,8 @@ vlmc_startup_query_test()
 
 	echo -n $goutput |
 		jq -e ".[].vlans[] | select(.vlan == 10 and \
-					    .mcast_startup_query_interval == 3125) " &>/dev/null
+					    .mcast_startup_query_interval >= 3124 and \
+					    .mcast_startup_query_interval <= 3126) " &>/dev/null
 	check_err $? "Wrong default mcast_startup_query_interval global vlan option value"
 	log_test "Vlan mcast_startup_query_interval global option default value"
 
Signature · 1 line
2.53.0
maintainer Reviewed-by on v2 1/1
#3 lore raw
Quoted 10 lines · Jin Li

The mcast_startup_query_interval default value is calculated as 125 * HZ / 4. With CONFIG_HZ=250, this results in 3124 instead of 3125 due to integer truncation. The test currently hardcodes 3125, which fails on kernels built with CONFIG_HZ=250.

Allow a +/- 1 tolerance for the default value check to account for this rounding, while still catching genuine regressions in the default value.

net-next is closed:

https://netdev.bots.linux.dev/net-next.html

So you will need to re-post after it re-opens.

#4 lore raw
In reply to Jin Li
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Thu, 22 Oct 2026 18:30:22 +0800 you wrote:

The mcast_startup_query_interval default value is calculated as 125 * HZ / 4. With CONFIG_HZ=250, this results in 3124 instead of 3125 due to integer truncation. The test currently hardcodes 3125, which fails on kernels built with CONFIG_HZ=250.

Allow a +/- 1 tolerance for the default value check to account for this rounding, while still catching genuine regressions in the default value.

[...]

Here is the summary with links:
- [net-next,v2] selftests: net: forwarding: bridge_vlan_mcast: Allow default startup query interval to vary by HZ

    https://git.kernel.org/netdev/net/c/9e2ba4a17735

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html