🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
5 messages
5 total messages Started by Breno Leitao Tue, 10 Nov 2026 12:32
[PATCH net] selftests: netconsole: enable the targets created by the torture test
#13889
Author: Breno Leitao
Date: Tue, 10 Nov 2026 12:32
39 lines
11541 bytes
create_and_delete_random_target() is meant to create, enable and remove
targets while messages are sent, but it only creates and removes them.
The helper it calls, _create_dynamic_target(), stopped enabling the
target when the bonding test moved that step into
create_dynamic_target().

Enable the targets again, so they come up while messages flow and are
disabled before being removed. Like toggle_netcons_target(), ignore a
failed enable, which would otherwise end the function and leave the
targets behind. With a console per target, this also registers and
unregisters their consoles under load.

Fixes: 236682db3b6f ("selftest: netcons: add test for netconsole over bonded interfaces")
Signed-off-by: Breno Leitao <leitao@debian.org>
---
 tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh b/tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh
index 33a44adb6f8f3a..3dfab0bf1b0756 100755
--- a/tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh
+++ b/tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh
@@ -46,6 +46,7 @@ create_and_delete_random_target() {
 
 		# Basic population so the target can come up
 		_create_dynamic_target "${FORMAT}" "${RND_TARGET_PATH}"
+		echo 1 > "${RND_TARGET_PATH}"/enabled 2> /dev/null || true
 	done
 
 	echo "netconsole selftest: ${COUNT} additional targets were created" > /dev/kmsg

---
base-commit: b3dfbde62cf1981c4638939c159dfd087b7a72e9
change-id: 20261110-netcons_selftest_fix-4cbf633295ef

Best regards,
--  
Breno Leitao <leitao@debian.org>
Re: [PATCH net] selftests: netconsole: enable the targets created by the torture test
#14363
Author: Hangbin Liu
Date: Wed, 11 Nov 2026 01:58
49 lines
10445 bytes
Hi Breno,
On Tue, Nov 10, 2026 at 04:32:25AM -0800, Breno Leitao wrote:
> create_and_delete_random_target() is meant to create, enable and remove
> targets while messages are sent, but it only creates and removes them.
> The helper it calls, _create_dynamic_target(), stopped enabling the
> target when the bonding test moved that step into
> create_dynamic_target().
> 
> Enable the targets again, so they come up while messages flow and are
> disabled before being removed. Like toggle_netcons_target(), ignore a
> failed enable, which would otherwise end the function and leave the
> targets behind. With a console per target, this also registers and
> unregisters their consoles under load.
> 
> Fixes: 236682db3b6f ("selftest: netcons: add test for netconsole over bonded interfaces")
> Signed-off-by: Breno Leitao <leitao@debian.org>
> ---
>  tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh b/tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh
> index 33a44adb6f8f3a..3dfab0bf1b0756 100755
> --- a/tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh
> +++ b/tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh
> @@ -46,6 +46,7 @@ create_and_delete_random_target() {
>  
>  		# Basic population so the target can come up
>  		_create_dynamic_target "${FORMAT}" "${RND_TARGET_PATH}"
> +		echo 1 > "${RND_TARGET_PATH}"/enabled 2> /dev/null || true
>  	done
>  
>  	echo "netconsole selftest: ${COUNT} additional targets were created" > /dev/kmsg
> 
> ---
> base-commit: b3dfbde62cf1981c4638939c159dfd087b7a72e9
> change-id: 20261110-netcons_selftest_fix-4cbf633295ef
> 
> Best regards,
> --  
> Breno Leitao <leitao@debian.org>
> 

Ignore the failed enable makes sense to me, as we enabled `set -e`
and use random target. Do we need sleep 1s like create_dynamic_target()
to make sure the configuration loaded?

Thanks
Hangbin
Re: [PATCH net] selftests: netconsole: enable the targets created by the torture test
#14490
Author: Breno Leitao
Date: Wed, 11 Nov 2026 10:20
64 lines
11308 bytes
Hello Hangbin,

On Wed, Nov 11, 2026 at 09:58:32AM +0800, Hangbin Liu wrote:
> On Tue, Nov 10, 2026 at 04:32:25AM -0800, Breno Leitao wrote:
> > create_and_delete_random_target() is meant to create, enable and remove
> > targets while messages are sent, but it only creates and removes them.
> > The helper it calls, _create_dynamic_target(), stopped enabling the
> > target when the bonding test moved that step into
> > create_dynamic_target().
> > 
> > Enable the targets again, so they come up while messages flow and are
> > disabled before being removed. Like toggle_netcons_target(), ignore a
> > failed enable, which would otherwise end the function and leave the
> > targets behind. With a console per target, this also registers and
> > unregisters their consoles under load.
> > 
> > Fixes: 236682db3b6f ("selftest: netcons: add test for netconsole over bonded interfaces")
> > Signed-off-by: Breno Leitao <leitao@debian.org>
> > ---
> >  tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh b/tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh
> > index 33a44adb6f8f3a..3dfab0bf1b0756 100755
> > --- a/tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh
> > +++ b/tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh
> > @@ -46,6 +46,7 @@ create_and_delete_random_target() {
> >  
> >  		# Basic population so the target can come up
> >  		_create_dynamic_target "${FORMAT}" "${RND_TARGET_PATH}"
> > +		echo 1 > "${RND_TARGET_PATH}"/enabled 2> /dev/null || true
> >  	done
> >  
> >  	echo "netconsole selftest: ${COUNT} additional targets were created" > /dev/kmsg
> > 
> > ---
> > base-commit: b3dfbde62cf1981c4638939c159dfd087b7a72e9
> > change-id: 20261110-netcons_selftest_fix-4cbf633295ef
> > 
> > Best regards,
> > --  
> > Breno Leitao <leitao@debian.org>
> > 
> 
> Ignore the failed enable makes sense to me, as we enabled `set -e`
> and use random target.

ack!

> Do we need sleep 1s like create_dynamic_target() to make sure the
> configuration loaded?

I don't think we need it. The write to enabled is synchronous:
enabled_store() sets up netpoll and moves the target to STATE_ENABLED
before it returns. If the setup fails, enabled reads back 0, and the
disable loop checks enabled before writing 0 to it.

The other reason for that sleep, keeping the console messages in
order, does not apply either, since the torture test does not read
back any message.

Thanks for the review,
--breno
Re: [PATCH net] selftests: netconsole: enable the targets created by the torture test
#14542
Author: Hangbin Liu
Date: Wed, 11 Nov 2026 12:35
66 lines
11317 bytes
On Wed, Nov 11, 2026 at 02:20:08AM -0800, Breno Leitao wrote:
> Hello Hangbin,
> 
> On Wed, Nov 11, 2026 at 09:58:32AM +0800, Hangbin Liu wrote:
> > On Tue, Nov 10, 2026 at 04:32:25AM -0800, Breno Leitao wrote:
> > > create_and_delete_random_target() is meant to create, enable and remove
> > > targets while messages are sent, but it only creates and removes them.
> > > The helper it calls, _create_dynamic_target(), stopped enabling the
> > > target when the bonding test moved that step into
> > > create_dynamic_target().
> > > 
> > > Enable the targets again, so they come up while messages flow and are
> > > disabled before being removed. Like toggle_netcons_target(), ignore a
> > > failed enable, which would otherwise end the function and leave the
> > > targets behind. With a console per target, this also registers and
> > > unregisters their consoles under load.
> > > 
> > > Fixes: 236682db3b6f ("selftest: netcons: add test for netconsole over bonded interfaces")
> > > Signed-off-by: Breno Leitao <leitao@debian.org>
> > > ---
> > >  tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh b/tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh
> > > index 33a44adb6f8f3a..3dfab0bf1b0756 100755
> > > --- a/tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh
> > > +++ b/tools/testing/selftests/drivers/net/netconsole/netcons_torture.sh
> > > @@ -46,6 +46,7 @@ create_and_delete_random_target() {
> > >  
> > >  		# Basic population so the target can come up
> > >  		_create_dynamic_target "${FORMAT}" "${RND_TARGET_PATH}"
> > > +		echo 1 > "${RND_TARGET_PATH}"/enabled 2> /dev/null || true
> > >  	done
> > >  
> > >  	echo "netconsole selftest: ${COUNT} additional targets were created" > /dev/kmsg
> > > 
> > > ---
> > > base-commit: b3dfbde62cf1981c4638939c159dfd087b7a72e9
> > > change-id: 20261110-netcons_selftest_fix-4cbf633295ef
> > > 
> > > Best regards,
> > > --  
> > > Breno Leitao <leitao@debian.org>
> > > 
> > 
> > Ignore the failed enable makes sense to me, as we enabled `set -e`
> > and use random target.
> 
> ack!
> 
> > Do we need sleep 1s like create_dynamic_target() to make sure the
> > configuration loaded?
> 
> I don't think we need it. The write to enabled is synchronous:
> enabled_store() sets up netpoll and moves the target to STATE_ENABLED
> before it returns. If the setup fails, enabled reads back 0, and the
> disable loop checks enabled before writing 0 to it.
> 
> The other reason for that sleep, keeping the console messages in
> order, does not apply either, since the torture test does not read
> back any message.

Thanks for the explain.

Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Re: [PATCH net] selftests: netconsole: enable the targets created by the torture test
#14810
Author: patchwork-bot+netdevbpf
Date: Thu, 12 Nov 2026 01:20
29 lines
9082 bytes
Hello:

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

On Tue, 10 Nov 2026 04:32:25 -0800 you wrote:
> create_and_delete_random_target() is meant to create, enable and remove
> targets while messages are sent, but it only creates and removes them.
> The helper it calls, _create_dynamic_target(), stopped enabling the
> target when the bonding test moved that step into
> create_dynamic_target().
> 
> Enable the targets again, so they come up while messages flow and are
> disabled before being removed. Like toggle_netcons_target(), ignore a
> failed enable, which would otherwise end the function and leave the
> targets behind. With a console per target, this also registers and
> unregisters their consoles under load.
> 
> [...]

Here is the summary with links:
  - [net] selftests: netconsole: enable the targets created by the torture test
    https://git.kernel.org/netdev/net-next/c/d6548dd20bfd

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads