Netdev List
 help / color / mirror / Atom feed
* [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; 2+ 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] 2+ messages in thread

end of thread, other threads:[~2026-12-03  9:07 UTC | newest]

Thread overview: 2+ 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox