> -----Original Message-----
> From: Jakub Kicinski <[email protected]>
> Sent: Saturday, 7 February 2026 3:22
> To: [email protected]
> Cc: [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected]; linux-
> [email protected]; Jakub Kicinski <[email protected]>; Danielle Ratson
> <[email protected]>; Petr Machata <[email protected]>
> 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: [email protected]
> CC: [email protected]
> Signed-off-by: Jakub Kicinski <[email protected]>
> ---
> .../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