Skip to contentSkip to conversation

selftests: netconsole: only restore MAC when it changed on resume

PATCH Applied Andre Carvalho 4 participants 4 messages Jul 10 – Jul 17

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

PATCH 1/1 selftests: netconsole: only restore MAC when it changed on resume

The "mac" bind mode reactivation downs the interface, restores the saved MAC and renames it to trigger a target resume. This assumes the recreated interface comes back with a different MAC, which is true under MACAddressPolicy=none (as on the Netdev CI) but not when MACs are persistent. In the persistent case netconsole resumes the target on its own, and the down/restore/rename flow instead drops it and fails the test.

Guard the block on the MAC having actually changed so the test passes under both policies.

Fixes 6ecc08329bab ("selftests: netconsole: validate target resume")
---
 tools/testing/selftests/drivers/net/netconsole/netcons_resume.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/drivers/net/netconsole/netcons_resume.sh +2 -1
index cb59cf436dd0..d9111f2102bc 100755
@@ -44,7 +44,8 @@ function trigger_reactivation() {
 	# Restore MACs
 	ip netns exec "${NAMESPACE}" ip link set "${DSTIF}" \
 		address "${SAVED_DSTMAC}"
-	if [ "${BINDMODE}" == "mac" ]; then
+	if [ "${BINDMODE}" == "mac" ] &&
+		[ "$(mac_get "${SRCIF}")" != "${SAVED_SRCMAC}" ]; then
 		ip link set dev "${SRCIF}" down
 		ip link set dev "${SRCIF}" address "${SAVED_SRCMAC}"
 		# Rename device in order to trigger target resume, as initial

---
base-commit: 1cd23ca80784223fa2204e16203f754da4e821f8
change-id: 20260710-netcons-mac-reload-f6f5e86f9e1f

Best regards,

Signature · 1 line
Andre Carvalho <[email protected]>
Tested-by on v1 1/1
#1 lore raw

Hi Andre,

Quoted 9 lines · Andre Carvalho

The "mac" bind mode reactivation downs the interface, restores the saved MAC and renames it to trigger a target resume. This assumes the recreated interface comes back with a different MAC, which is true under MACAddressPolicy=none (as on the Netdev CI) but not when MACs are persistent. In the persistent case netconsole resumes the target on its own, and the down/restore/rename flow instead drops it and fails the test.

Guard the block on the MAC having actually changed so the test passes under both policies.

Thank you for the patch, it fixed the issue on my side when not forcing MACAddressPolicy=none.

Cheers,
Matt

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Andre Carvalho

Hello Andre,

Thanks for the fix.

Quoted 7 lines · Andre Carvalho

The "mac" bind mode reactivation downs the interface, restores the saved MAC and renames it to trigger a target resume. This assumes the recreated interface comes back with a different MAC, which is true under MACAddressPolicy=none (as on the Netdev CI) but not when MACs are persistent. In the persistent case netconsole resumes the target on its own, and the down/restore/rename flow instead drops it and fails the test.

Quoted 7 lines

Guard the block on the MAC having actually changed so the test passes under both policies.

Fixes 6ecc08329bab ("selftests: netconsole: validate target resume")

FWIW: netdev CI got yellow for this patch, but, this is not realted to this test.

https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/

#3 lore raw
In reply to Andre Carvalho
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:

Hello:

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

Quoted 8 lines · On Fri, 10 Jul 2026 23:19:17 +0100 you wrote:

The "mac" bind mode reactivation downs the interface, restores the saved MAC and renames it to trigger a target resume. This assumes the recreated interface comes back with a different MAC, which is true under MACAddressPolicy=none (as on the Netdev CI) but not when MACs are persistent. In the persistent case netconsole resumes the target on its own, and the down/restore/rename flow instead drops it and fails the test.

[...]

Here is the summary with links:
- [net] selftests: netconsole: only restore MAC when it changed on resume
https://git.kernel.org/netdev/net/c/04aeddf2dadd

You are awesome, thank you!

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