Skip to contentSkip to conversation

selftests: net: add ipv6 RA route to ECMP merge test

PATCH Applied Fernando Fernandez Mancera 2 participants 2 messages Mar 13 – Mar 17

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 selftests: net: add ipv6 RA route to ECMP merge test

As commit bbf4a17ad9ff ("ipv6: Fix ECMP sibling count mismatch when clearing RTF_ADDRCONF") pointed out, RA routes are not elegible for ECMP merging.

Add a test scenario mixing RA and static routes with gateway to check that they are not getting merged.

---
v2: added CONFIG_IPV6_ROUTE_INFO to the config
v3: added CONFIG_IPV6_ROUTER_PREF to the config, tested with virtme-ng

---
 tools/testing/selftests/net/config       |  2 ++
 tools/testing/selftests/net/fib_tests.sh | 17 +++++++++++++++++
 2 files changed, 19 insertions(+)
tools/testing/selftests/net/config +2 -0
index cd49b7dfe216..2a390cae41bf 100644
@@ -43,6 +43,8 @@ CONFIG_IPV6_ILA=m
 CONFIG_IPV6_IOAM6_LWTUNNEL=y
 CONFIG_IPV6_MROUTE=y
 CONFIG_IPV6_MULTIPLE_TABLES=y
+CONFIG_IPV6_ROUTE_INFO=y
+CONFIG_IPV6_ROUTER_PREF=y
 CONFIG_IPV6_RPL_LWTUNNEL=y
 CONFIG_IPV6_SEG6_LWTUNNEL=y
 CONFIG_IPV6_SIT=y
tools/testing/selftests/net/fib_tests.sh +17 -0
index 439461080c60..05dadc3f55b1 100755
@@ -1534,6 +1534,23 @@ fib6_ra_to_static()
 
 	log_test $ret 0 "ipv6 promote RA route to static"
 
+	# Prepare for RA route with gateway
+	$NS_EXEC sysctl -wq net.ipv6.conf.veth1.accept_ra_rt_info_max_plen=64
+
+	# Add initial route to cause ECMP merging
+	$IP -6 route add 2001:12::/64 via fe80::dead:beef dev veth1
+
+	$NS_EXEC ra6 -i veth2 -d 2001:10::1 -R 2001:12::/64#1#120
+
+	# Routes are not merged as RA routes are not elegible for ECMP
+	check_rt_num 2 "$($IP -6 route list | grep -c "2001:12::/64 via")"
+
+	$IP -6 route append 2001:12::/64 via fe80::dead:feeb dev veth1
+
+	check_rt_num 2 "$($IP -6 route list | grep -c "nexthop via")"
+
+	log_test "$ret" 0 "ipv6 RA route with nexthop do not merge into ECMP with static"
+
 	set +e
 
 	cleanup &> /dev/null
Signature · 1 line
2.53.0
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Quoted 8 lines · On Fri, 13 Mar 2026 13:48:27 +0100 you wrote:

As commit bbf4a17ad9ff ("ipv6: Fix ECMP sibling count mismatch when clearing RTF_ADDRCONF") pointed out, RA routes are not elegible for ECMP merging.

Add a test scenario mixing RA and static routes with gateway to check that they are not getting merged.

[...]

Here is the summary with links:
- [net-next,v3] selftests: net: add ipv6 RA route to ECMP merge test

    https://git.kernel.org/netdev/net-next/c/fdd973148a11

You are awesome, thank you!

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