Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'selftests-drv-net-improve-zerocopy-tests'

Jakub Kicinski says:

====================
selftests: drv-net: improve zerocopy tests

A few tweaks to the devmem test to make it more "NIPA-compatible".
We still need a fix to make sure that the test sets hds threshold
to 0. Taehee is presumably already/still working on that:
https://lore.kernel.org/20250702104249.1665034-1-ap420073@gmail.com
so I'm not including my version.

# ./tools/testing/selftests/drivers/net/hw/devmem.py
TAP version 13
1..3
ok 1 devmem.check_rx
ok 2 devmem.check_tx
ok 3 devmem.check_tx_chunks
# Totals: pass:3 fail:0 xfail:0 xpass:0 skip:0 error:0
====================

Link: https://patch.msgid.link/20250811231334.561137-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+20 -15
+2
tools/testing/selftests/drivers/net/hw/config
··· 1 + CONFIG_IO_URING=y 1 2 CONFIG_IPV6=y 2 3 CONFIG_IPV6_GRE=y 3 4 CONFIG_NET_IPGRE=y 4 5 CONFIG_NET_IPGRE_DEMUX=y 6 + CONFIG_UDMABUF=y 5 7 CONFIG_VXLAN=y
+7 -7
tools/testing/selftests/drivers/net/hw/devmem.py
··· 24 24 require_devmem(cfg) 25 25 26 26 port = rand_port() 27 - socat = f"socat -u - TCP{cfg.addr_ipver}:{cfg.addr}:{port},bind={cfg.remote_addr}:{port}" 27 + socat = f"socat -u - TCP{cfg.addr_ipver}:{cfg.baddr}:{port},bind={cfg.remote_baddr}:{port}" 28 28 listen_cmd = f"{cfg.bin_local} -l -f {cfg.ifname} -s {cfg.addr} -p {port} -c {cfg.remote_addr} -v 7" 29 29 30 30 with bkg(listen_cmd, exit_wait=True) as ncdevmem: ··· 42 42 port = rand_port() 43 43 listen_cmd = f"socat -U - TCP{cfg.addr_ipver}-LISTEN:{port}" 44 44 45 - with bkg(listen_cmd) as socat: 46 - wait_port_listen(port) 47 - cmd(f"echo -e \"hello\\nworld\"| {cfg.bin_remote} -f {cfg.ifname} -s {cfg.addr} -p {port}", host=cfg.remote, shell=True) 45 + with bkg(listen_cmd, host=cfg.remote, exit_wait=True) as socat: 46 + wait_port_listen(port, host=cfg.remote) 47 + cmd(f"echo -e \"hello\\nworld\"| {cfg.bin_local} -f {cfg.ifname} -s {cfg.remote_addr} -p {port}", shell=True) 48 48 49 49 ksft_eq(socat.stdout.strip(), "hello\nworld") 50 50 ··· 56 56 port = rand_port() 57 57 listen_cmd = f"socat -U - TCP{cfg.addr_ipver}-LISTEN:{port}" 58 58 59 - with bkg(listen_cmd, exit_wait=True) as socat: 60 - wait_port_listen(port) 61 - cmd(f"echo -e \"hello\\nworld\"| {cfg.bin_remote} -f {cfg.ifname} -s {cfg.addr} -p {port} -z 3", host=cfg.remote, shell=True) 59 + with bkg(listen_cmd, host=cfg.remote, exit_wait=True) as socat: 60 + wait_port_listen(port, host=cfg.remote) 61 + cmd(f"echo -e \"hello\\nworld\"| {cfg.bin_local} -f {cfg.ifname} -s {cfg.remote_addr} -p {port} -z 3", shell=True) 62 62 63 63 ksft_eq(socat.stdout.strip(), "hello\nworld") 64 64
+7 -7
tools/testing/selftests/drivers/net/hw/ncdevmem.c
··· 287 287 * the exit status. 288 288 */ 289 289 290 - run_command("sudo ethtool -K %s ntuple off >&2", ifname); 291 - run_command("sudo ethtool -K %s ntuple on >&2", ifname); 290 + run_command("ethtool -K %s ntuple off >&2", ifname); 291 + run_command("ethtool -K %s ntuple on >&2", ifname); 292 292 run_command( 293 - "sudo ethtool -n %s | grep 'Filter:' | awk '{print $2}' | xargs -n1 ethtool -N %s delete >&2", 293 + "ethtool -n %s | grep 'Filter:' | awk '{print $2}' | xargs -n1 ethtool -N %s delete >&2", 294 294 ifname, ifname); 295 295 return 0; 296 296 } ··· 351 351 352 352 static int configure_rss(void) 353 353 { 354 - return run_command("sudo ethtool -X %s equal %d >&2", ifname, start_queue); 354 + return run_command("ethtool -X %s equal %d >&2", ifname, start_queue); 355 355 } 356 356 357 357 static int configure_channels(unsigned int rx, unsigned int tx) 358 358 { 359 - return run_command("sudo ethtool -L %s rx %u tx %u", ifname, rx, tx); 359 + return run_command("ethtool -L %s rx %u tx %u", ifname, rx, tx); 360 360 } 361 361 362 362 static int configure_flow_steering(struct sockaddr_in6 *server_sin) ··· 374 374 } 375 375 376 376 /* Try configure 5-tuple */ 377 - if (run_command("sudo ethtool -N %s flow-type %s %s %s dst-ip %s %s %s dst-port %s queue %d >&2", 377 + if (run_command("ethtool -N %s flow-type %s %s %s dst-ip %s %s %s dst-port %s queue %d >&2", 378 378 ifname, 379 379 type, 380 380 client_ip ? "src-ip" : "", ··· 384 384 client_ip ? port : "", 385 385 port, start_queue)) 386 386 /* If that fails, try configure 3-tuple */ 387 - if (run_command("sudo ethtool -N %s flow-type %s dst-ip %s dst-port %s queue %d >&2", 387 + if (run_command("ethtool -N %s flow-type %s dst-ip %s dst-port %s queue %d >&2", 388 388 ifname, 389 389 type, 390 390 server_addr,
+4 -1
tools/testing/selftests/net/lib/py/utils.py
··· 117 117 shell=shell, fail=fail, ns=ns, host=host, 118 118 ksft_wait=ksft_wait) 119 119 self.terminate = not exit_wait and not ksft_wait 120 + self._exit_wait = exit_wait 120 121 self.check_fail = fail 121 122 122 123 if shell and self.terminate: ··· 128 127 return self 129 128 130 129 def __exit__(self, ex_type, ex_value, ex_tb): 131 - return self.process(terminate=self.terminate, fail=self.check_fail) 130 + # Force termination on exception 131 + terminate = self.terminate or (self._exit_wait and ex_type) 132 + return self.process(terminate=terminate, fail=self.check_fail) 132 133 133 134 134 135 global_defer_queue = []