lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <DM6PR12MB4516D06845B4A6D2691E46F4D865A@DM6PR12MB4516.namprd12.prod.outlook.com>
Date: Mon, 9 Feb 2026 09:54:08 +0000
From: Danielle Ratson <danieller@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>, "davem@...emloft.net"
	<davem@...emloft.net>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>, "edumazet@...gle.com"
	<edumazet@...gle.com>, "pabeni@...hat.com" <pabeni@...hat.com>,
	"andrew+netdev@...n.ch" <andrew+netdev@...n.ch>, "horms@...nel.org"
	<horms@...nel.org>, "shuah@...nel.org" <shuah@...nel.org>,
	"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>, Petr
 Machata <petrm@...dia.com>
Subject: RE: [PATCH net-next] selftests: drv-net: port_split: convert to ksft
 format and mark disruptive

> -----Original Message-----
> From: Jakub Kicinski <kuba@...nel.org>
> Sent: Saturday, 7 February 2026 3:22
> To: davem@...emloft.net
> Cc: netdev@...r.kernel.org; edumazet@...gle.com; pabeni@...hat.com;
> andrew+netdev@...n.ch; horms@...nel.org; shuah@...nel.org; linux-
> kselftest@...r.kernel.org; Jakub Kicinski <kuba@...nel.org>; Danielle Ratson
> <danieller@...dia.com>; Petr Machata <petrm@...dia.com>
> Subject: [PATCH net-next] selftests: drv-net: port_split: convert to ksft format
> and mark disruptive
> 
> The devlink port split test is included in the HW tests, but it does not obey our
> KSFT_DISRUPTIVE marking.
> If someone tries to run driver tests over SSH on a device that supports port
> splitting the outcome will be loss of connectivity.
> 
> Convert the test to conform to our "driver test environment".
> Mark it as disruptive.
> 
> This is completely untested, I'd appreciate if someone with the right setup
> could give this a go (and probably fix up the bugs I introduced).
> 
> CC: danieller@...dia.com
> CC: petrm@...dia.com
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
>  .../drivers/net/hw/devlink_port_split.py      | 243 ++++++------------
>  1 file changed, 77 insertions(+), 166 deletions(-)
>> 

[..]

Few comments:

1. Before the change we simply ran the test without extra info, like that:
$ ./devlink_port_split.py

Now the new infrastructure requires to run with:
$ NETIF=swp1 ./devlink_port_split.py

While swp1 is an example for some interface in the machine using to indicate the real target device.

Otherwise, the test fails- if no NETIF is configured, the framework defaults to netdevsim (SW mode), and since the test sets 'nsim_test=False', it emits an error.
So the new change, breaks the way the test was running by now.

However, I managed to work around that by adding a configuration file to the selftests dir:

$ cat drivers/net/hw/net.config
NETIF=swp1

2. The test fails for waiting for the carrier to come up. But actually, we should skip the carrier check.
The port split test doesn't require carrier to be up since it's only testing port configuration (split/unsplit) functionality, not the data path.

I tried to run it while overriding the NetDrvEnv __enter__ method to bring the interface up without waiting for carrier:

diff --git a/tools/testing/selftests/drivers/net/hw/devlink_port_split.py b/tools/testing/selftests/drivers/net/hw/devlink_port_split.py
index c7b38f5e94fd..39d82f2d9d82 100755
--- a/tools/testing/selftests/drivers/net/hw/devlink_port_split.py
+++ b/tools/testing/selftests/drivers/net/hw/devlink_port_split.py
@@ -18,12 +18,19 @@ from lib.py import ksft_run, ksft_exit, ksft_pr
 from lib.py import ksft_eq, ksft_disruptive
 from lib.py import NetDrvEnv
 from lib.py import KsftSkipEx
-from lib.py import cmd
+from lib.py import cmd, ip

 Port = collections.namedtuple('Port', 'bus_info name')

+class NetDrvEnvNoCarrier(NetDrvEnv):
+    """NetDrvEnv that doesn't require carrier for port split testing."""
+    def __enter__(self):
+        ip(f"link set dev {self.dev['ifname']} up")
+        return self
+
+
 def get_devlink_ports(dev):
     """
     Get a list of physical devlink ports.
@@ -208,7 +215,7 @@ def test_port_split(cfg):

 def main() -> None:
     """Ksft boiler plate main"""
-    with NetDrvEnv(__file__, nsim_test=False) as cfg:
+    with NetDrvEnvNoCarrier(__file__, nsim_test=False) as cfg:
         cfg.pci = os.path.basename(
             os.path.realpath(f"/sys/class/net/{cfg.ifname}/device")
         )

Here is the output after the adding the config file and overriding the carrier check:

$ ./devlink_port_split.py
TAP version 13
1..1
ok 1 devlink_port_split.test_port_split
# Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ