From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 062B93AA4F9; Wed, 8 Jul 2026 15:50:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783525861; cv=none; b=PHIH2X8Oz3+NNnnYevf7BjiTkCpXzJX2JNAeaBnMLiwlCvfHBonIswmmZ3khNw1ayTJHh0QOeQTCJ0vMbie0V3bROmMmCFueq9j7l6JpZKDGwzcV8TKB5mX3rTGXDsJa+4ch+XwV3KH568Nxtdj313BXwi0er6fZzl2VXcDwGjg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783525861; c=relaxed/simple; bh=0Ht6C/KQ2or/qv8egh8SNjkXW35Xwst2cMLczdpAYRY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=tLGf5hNSj3UP6V10DhGEHvUpRSKk5stXiXSyL/TJV9NOtchriD23hXSLjjQGAU3tg3R7KEkxFZD6mJgxG00PO9i7Jwn7j9Xd4nDx237tLKt089/N/wdDsmNg/zGCYWs3iTQ9GgQXyLe71N7iDXCsXoW55P0HUmXnR5DrRgO/OJg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jO/J01/h; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jO/J01/h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 233CB1F000E9; Wed, 8 Jul 2026 15:50:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783525859; bh=wuE75PEjauhhf61SUJFf1x8vbYIkv9QeYpA6RcVrlJ0=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=jO/J01/hzPgDT+IIB/ZBrBSWfAZUBVVJ2Xu808zgNS7EvizWJ14TTM1ia5h3h9mNi Uy2SIdVH3/7cm59qm3nctebNdOYpO7zo2Xa1hTAQKYpdiLtO9dZfHdGUO4mXhbV7YA FhcCeij3xyLs2HYULlUPEHJCUXRmU0NmXu1Exe5lkclxtQMdGZ3H0AVf2uFMS1k5Ct bkFu+211+TSp3ZW+A3pqJcB9wErXZlCjqrVlb1xrvSoKJ/+tP+Hu67egavZjR4zNXg 6pOfX9cdZ1Y/+6eRAvIwHJHMMnN4YWPJYvYPiJ8LcPiIGq+LhmzLNIveEcwGos30Oy yPtdC9VYsVs3g== Message-ID: Date: Wed, 8 Jul 2026 17:50:53 +0200 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH net-next v11 7/7] selftests: netconsole: validate target resume Content-Language: fr To: Andre Carvalho , Breno Leitao Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Simon Horman References: <20260118-netcons-retrigger-v11-0-4de36aebcf48@gmail.com> <20260118-netcons-retrigger-v11-7-4de36aebcf48@gmail.com> From: Matthieu Baerts Autocrypt: addr=matttbe@kernel.org; keydata= xsFNBFXj+ekBEADxVr99p2guPcqHFeI/JcFxls6KibzyZD5TQTyfuYlzEp7C7A9swoK5iCvf YBNdx5Xl74NLSgx6y/1NiMQGuKeu+2BmtnkiGxBNanfXcnl4L4Lzz+iXBvvbtCbynnnqDDqU c7SPFMpMesgpcu1xFt0F6bcxE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i7m3dIQNXK2e+Cbv5PXf19ce3XluaE+wA8D+vnIW5mbAAiojt3Mb 6p0WJS3QzbObzHNgAp3zy/L4lXwc6WW5vnpWAzqXFHP8D9PTpqvBALbXqL06smP47JqbyQxj Xf7D2rrPeIqbYmVY9da1KzMOVf3gReazYa89zZSdVkMojfWsbq05zwYU+SCWS3NiyF6QghbW voxbFwX1i/0xRwJiX9NNbRj1huVKQuS4W7rbWA87TrVQPXUAdkyd7FRYICNW+0gddysIwPoa KrLfx3Ba6Rpx0JznbrVOtXlihjl4KV8mtOPjYDY9u+8x412xXnlGl6AC4HLu2F3ECkamY4G6 UxejX+E6vW6Xe4n7H+rEX5UFgPRdYkS1TA/X3nMen9bouxNsvIJv7C6adZmMHqu/2azX7S7I vrxxySzOw9GxjoVTuzWMKWpDGP8n71IFeOot8JuPZtJ8omz+DZel+WCNZMVdVNLPOd5frqOv mpz0VhFAlNTjU1Vy0CnuxX3AM51J8dpdNyG0S8rADh6C8AKCDOfUstpq28/6oTaQv7QZdge0 JY6dglzGKnCi/zsmp2+1w559frz4+IC7j/igvJGX4KDDKUs0mlld8J2u2sBXv7CGxdzQoHaz lzVbFe7fduHbABmYz9cefQpO7wDE/Q== Organization: NGI0 Core In-Reply-To: <20260118-netcons-retrigger-v11-7-4de36aebcf48@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Andre, Breno, On 18/01/2026 12:00, Andre Carvalho wrote: > Introduce a new netconsole selftest to validate that netconsole is able > to resume a deactivated target when the low level interface comes back. > > The test setups the network using netdevsim, creates a netconsole target > and then remove/add netdevsim in order to bring the same interfaces > back. Afterwards, the test validates that the target works as expected. > > Targets are created via cmdline parameters to the module to ensure that > we are able to resume targets that were bound by mac and interface name. I'm sorry to react on this "old" patch, but I have some troubles running this netcons_resume.sh test in a new environment with containers. > diff --git a/tools/testing/selftests/drivers/net/netcons_resume.sh b/tools/testing/selftests/drivers/net/netcons_resume.sh > new file mode 100755 > index 000000000000..fc5e5e3ad3d4 > --- /dev/null > +++ b/tools/testing/selftests/drivers/net/netcons_resume.sh (...) > +function trigger_reactivation() { > + # Add back low level module > + modprobe netdevsim > + # Recreate namespace and two interfaces > + set_network > + # Restore MACs > + ip netns exec "${NAMESPACE}" ip link set "${DSTIF}" \ > + address "${SAVED_DSTMAC}" > + if [ "${BINDMODE}" == "mac" ]; 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 > + # when device was recreated it didn't have correct mac address. > + ip link set dev "${SRCIF}" name "${TARGET}" When I execute the test, the "ifname" bind mode works without issues, but the "mac" one not. From what I see, the socat process doesn't get any UDP packet when expected. I wonder if the problem might not come from here: the interface is disabled before changing the MAC address and renaming the interface, but not re-enabled at the end. Is it normal? If I add 'up' at the end of this last line here, or if I remove the whole if-statement block, the test passes. In the console, I can see these messages, with or without re-enabling the interface: netdevsim netdevsim642 eni642np1: renamed from eth0 netdevsim netdevsim387 eni387np1: renamed from eth1 netconsole: netconsole: local port 1514 netconsole: netconsole: local IPv4 address 192.0.2.1 netconsole: netconsole: interface name '' netconsole: netconsole: local ethernet address '1e:95:b7:ae:ab:dc' netconsole: netconsole: remote port 6666 netconsole: netconsole: remote IPv4 address 192.0.2.2 netconsole: netconsole: remote ethernet address e6:12:42:f8:4c:b2 printk: console [netcon_ext0] enabled netconsole: network logging started netconsole: network logging stopped on interface eni387np1 as it unregistered netdevsim netdevsim642 eni642np1: renamed from eth0 netdevsim netdevsim387 eni387np1: renamed from eth1 netconsole: Process resuming (mac: 1e:95:b7:ae:ab:dc), s:2, r:-1 netpoll: netconsole: device 1e:95:b7:ae:ab:dc not up yet, forcing it netconsole: network logging resumed on interface eni387np1 netdevsim netdevsim387 netcons_LFLQP: renamed from eni387np1 netconsole selftest: netcons_LFLQP The "network logging resumed on interface" seems to suggest that the previous patch of this series here, commit 220dbe3c76ed ("netconsole: resume previously deactivated target"), managed to resume the previously activated target, but not in my case. What I don't understand is why is it working on the Netdev CI, and not on my side. The main difference is that I might be missing some userspace packages -- but I don't see what can be missing here, all other netconsole tests pass -- a specific kernel config, or not applied patch. Or something different on the host -- in a container on my side -- but there shouldn't be any interactions with the host here, everything is happening in the VM. Any ideas? :) > + fi > +} > + > +function trigger_deactivation() { > + # Start by storing mac addresses so we can be restored in reactivate > + SAVED_DSTMAC=$(ip netns exec "${NAMESPACE}" \ > + cat /sys/class/net/"$DSTIF"/address) > + SAVED_SRCMAC=$(mac_get "${SRCIF}") > + # Remove low level module > + rmmod netdevsim > +} > + > +trap cleanup EXIT > + > +# Run the test twice, with different cmdline parameters > +for BINDMODE in "ifname" "mac" > +do > + echo "Running with bind mode: ${BINDMODE}" >&2 > + # Set current loglevel to KERN_INFO(6), and default to KERN_NOTICE(5) > + echo "6 5" > /proc/sys/kernel/printk Can we remove this? Without that, it is hard to understand what went wrong in case of issues. > + > + # Create one namespace and two interfaces > + set_network > + > + # Create the command line for netconsole, with the configuration from > + # the function above > + CMDLINE=$(create_cmdline_str "${BINDMODE}") > + > + # The content of kmsg will be save to the following file > + OUTPUT_FILE="/tmp/${TARGET}-${BINDMODE}" > + > + # Load the module, with the cmdline set > + modprobe netconsole "${CMDLINE}" > + # Expose cmdline target in configfs > + mkdir "${NETCONS_CONFIGFS}/cmdline0" > + > + # Target should be enabled > + wait_target_state "cmdline0" "enabled" > + > + # Trigger deactivation by unloading netdevsim module. Target should be > + # disabled. > + trigger_deactivation > + wait_target_state "cmdline0" "disabled" > + > + # Trigger reactivation by loading netdevsim, recreating the network and > + # restoring mac addresses. Target should be re-enabled. > + trigger_reactivation > + wait_target_state "cmdline0" "enabled" > + > + # Listen for netconsole port inside the namespace and destination > + # interface > + listen_port_and_save_to "${OUTPUT_FILE}" & > + # Wait for socat to start and listen to the port. > + wait_local_port_listen "${NAMESPACE}" "${PORT}" udp > + # Send the message > + echo "${MSG}: ${TARGET}" > /dev/kmsg > + # Wait until socat saves the file to disk > + busywait "${BUSYWAIT_TIMEOUT}" test -s "${OUTPUT_FILE}" In my case, the script was stopping here, without any message. I can send a patch adding "|| true" to go to the next instruction, and display "FAIL: File was not generated.". > + # Make sure the message was received in the dst part > + # and exit > + validate_msg "${OUTPUT_FILE}" > + > + # kill socat in case it is still running > + pkill_socat > + # Cleanup & unload the module > + cleanup > + > + echo "${BINDMODE} : Test passed" >&2 > +done > + > +trap - EXIT > +exit "${EXIT_STATUS}" > Cheers, Matt