* [PATCH net] selftests: net: nl_genl_mcast: unload drop_monitor if already loaded
@ 2026-12-02 15:41 Matthieu Baerts (NGI0)
2026-12-03 9:07 ` Nicolas Dichtel
0 siblings, 1 reply; 3+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-12-02 15:41 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Willem de Bruijn, Simon Horman, Shuah Khan, Anil Kaushik,
Nicolas Dichtel
Cc: netdev, linux-kselftest, Matthieu Baerts (NGI0)
The bind_before_family subtest is skipped when the NET_DM family is
already registered.
On the netdev CI, this happens each time nl_genl_mcast.py is executed
from the same VM after drop_monitor_tests.sh, which loads the
drop_monitor module via dwdump, and does not unload it.
Instead of skipping, try to unload drop_monitor first, and only skip if
NET_DM is still registered after that, e.g. when it is built-in or in
use. The subtest already unloads the module at the end.
Fixes: aa98cde56c48 ("selftests: net: test joining genetlink groups no family owns")
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Note: drop_monitor_tests.sh could also unload the drop_monitor module at
the end, unless it was loaded before, but that is net-next material.
Here, only the issue causing troubles on NIPA is fixed.
---
tools/testing/selftests/net/nl_genl_mcast.py | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/net/nl_genl_mcast.py b/tools/testing/selftests/net/nl_genl_mcast.py
index 32b4951f8816..b245a0088cff 100755
--- a/tools/testing/selftests/net/nl_genl_mcast.py
+++ b/tools/testing/selftests/net/nl_genl_mcast.py
@@ -102,9 +102,15 @@ def _unload_drop_monitor():
def bind_before_family(ctrl) -> None:
"""A free ID joined with bind() stays unjoined when a family takes it."""
- names = [fam['family-name'] for fam in ctrl.getfamily({}, dump=True)]
- if 'NET_DM' in names:
- raise KsftSkipEx("NET_DM is already registered")
+ def _registered():
+ return any(fam['family-name'] == 'NET_DM'
+ for fam in ctrl.getfamily({}, dump=True))
+
+ if _registered():
+ # Likely loaded by another test, e.g. drop_monitor_tests.sh
+ _unload_drop_monitor()
+ if _registered():
+ raise KsftSkipEx("NET_DM is registered and cannot be unloaded")
free = _free_ids(ctrl)
with _sock() as sk:
---
base-commit: 7c13d5d5afb4ba2e8634fe5aa0a9f2bca235cb4b
change-id: 20261202-net-genetlink-sft-skip-271d9b340608
Best regards,
--
Matthieu Baerts (NGI0) <matttbe@kernel.org>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] selftests: net: nl_genl_mcast: unload drop_monitor if already loaded
2026-12-02 15:41 [PATCH net] selftests: net: nl_genl_mcast: unload drop_monitor if already loaded Matthieu Baerts (NGI0)
@ 2026-12-03 9:07 ` Nicolas Dichtel
2026-12-03 18:43 ` Matthieu Baerts
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Dichtel @ 2026-12-03 9:07 UTC (permalink / raw)
To: Matthieu Baerts (NGI0), David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Willem de Bruijn, Simon Horman,
Shuah Khan, Anil Kaushik
Cc: netdev, linux-kselftest
Le 02/12/2026 à 16:41, Matthieu Baerts (NGI0) a écrit :> The bind_before_family
subtest is skipped when the NET_DM family is
> already registered.
>
> On the netdev CI, this happens each time nl_genl_mcast.py is executed
> from the same VM after drop_monitor_tests.sh, which loads the
> drop_monitor module via dwdump, and does not unload it.
>
> Instead of skipping, try to unload drop_monitor first, and only skip if
> NET_DM is still registered after that, e.g. when it is built-in or in
> use. The subtest already unloads the module at the end.
With this change, the test now unloads a drop_monitor module that was
loaded by someone else, and does not load it again afterwards. This is
fine on NIPA, but on a developer machine where drop_monitor was loaded on
purpose, the test leaves the system in a different state. Would it be
worth loading it again at the end when it was registered before the
test? If not, maybe the commit log could say that this is acceptable.
Anyway, the fix LGTM:
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Regards,
Nicolas
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] selftests: net: nl_genl_mcast: unload drop_monitor if already loaded
2026-12-03 9:07 ` Nicolas Dichtel
@ 2026-12-03 18:43 ` Matthieu Baerts
0 siblings, 0 replies; 3+ messages in thread
From: Matthieu Baerts @ 2026-12-03 18:43 UTC (permalink / raw)
To: nicolas.dichtel
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Willem de Bruijn, Simon Horman, Shuah Khan, Anil Kaushik, netdev,
linux-kselftest
Hi Nicolas,
On 03/12/2026 10:07, Nicolas Dichtel wrote:
> Le 02/12/2026 à 16:41, Matthieu Baerts (NGI0) a écrit :
>> The bind_before_family subtest is skipped when the NET_DM family is
>> already registered.
>>
>> On the netdev CI, this happens each time nl_genl_mcast.py is executed
>> from the same VM after drop_monitor_tests.sh, which loads the
>> drop_monitor module via dwdump, and does not unload it.
>>
>> Instead of skipping, try to unload drop_monitor first, and only skip if
>> NET_DM is still registered after that, e.g. when it is built-in or in
>> use. The subtest already unloads the module at the end.
> With this change, the test now unloads a drop_monitor module that was
> loaded by someone else, and does not load it again afterwards. This is
> fine on NIPA, but on a developer machine where drop_monitor was loaded on
> purpose, the test leaves the system in a different state. Would it be
> worth loading it again at the end when it was registered before the
> test? If not, maybe the commit log could say that this is acceptable.
Agreed: it would be better to reload the drop_monitor module if it was
loaded before this script.
Here, the fix is small, for -net, just to fix the regression on NIPA,
and keeping the prerequisite that the module can be loaded. People
annoyed by this prerequisite can change it by sending a patch to -next :)
> Anyway, the fix LGTM:
> Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Merci!
Cheers,
Matt
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-12-03 18:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 15:41 [PATCH net] selftests: net: nl_genl_mcast: unload drop_monitor if already loaded Matthieu Baerts (NGI0)
2026-12-03 9:07 ` Nicolas Dichtel
2026-12-03 18:43 ` Matthieu Baerts
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox