* [PATCH net-next 0/5] selftests: drv-net: improve zerocopy tests
@ 2025-08-11 23:13 Jakub Kicinski
2025-08-11 23:13 ` [PATCH net-next 1/5] selftests: drv-net: add configs for zerocopy Rx Jakub Kicinski
` (6 more replies)
0 siblings, 7 replies; 19+ messages in thread
From: Jakub Kicinski @ 2025-08-11 23:13 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
almasrymina, noren, linux-kselftest, ap420073, Jakub Kicinski
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
Jakub Kicinski (5):
selftests: drv-net: add configs for zerocopy Rx
selftests: drv-net: devmem: remove sudo from system() calls
selftests: drv-net: devmem: add / correct the IPv6 support
selftests: net: terminate bkg() commands on exception
selftests: drv-net: devmem: flip the direction of Tx tests
tools/testing/selftests/drivers/net/hw/ncdevmem.c | 14 +++++++-------
tools/testing/selftests/drivers/net/hw/config | 2 ++
tools/testing/selftests/drivers/net/hw/devmem.py | 14 +++++++-------
tools/testing/selftests/net/lib/py/utils.py | 5 ++++-
4 files changed, 20 insertions(+), 15 deletions(-)
--
2.50.1
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH net-next 1/5] selftests: drv-net: add configs for zerocopy Rx
2025-08-11 23:13 [PATCH net-next 0/5] selftests: drv-net: improve zerocopy tests Jakub Kicinski
@ 2025-08-11 23:13 ` Jakub Kicinski
2025-08-11 23:52 ` Joe Damato
2025-08-12 16:56 ` Mina Almasry
2025-08-11 23:13 ` [PATCH net-next 2/5] selftests: drv-net: devmem: remove sudo from system() calls Jakub Kicinski
` (5 subsequent siblings)
6 siblings, 2 replies; 19+ messages in thread
From: Jakub Kicinski @ 2025-08-11 23:13 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
almasrymina, noren, linux-kselftest, ap420073, Jakub Kicinski
Looks like neither IO_URING nor UDMABUF are enabled even tho
iou-zcrx.py and devmem.py (respectively) need those.
IO_URING gets enabled by default but UDMABUF is missing.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
tools/testing/selftests/drivers/net/hw/config | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/drivers/net/hw/config b/tools/testing/selftests/drivers/net/hw/config
index 88ae719e6f8f..e8a06aa1471c 100644
--- a/tools/testing/selftests/drivers/net/hw/config
+++ b/tools/testing/selftests/drivers/net/hw/config
@@ -1,5 +1,7 @@
+CONFIG_IO_URING=y
CONFIG_IPV6=y
CONFIG_IPV6_GRE=y
CONFIG_NET_IPGRE=y
CONFIG_NET_IPGRE_DEMUX=y
+CONFIG_UDMABUF=y
CONFIG_VXLAN=y
--
2.50.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH net-next 2/5] selftests: drv-net: devmem: remove sudo from system() calls
2025-08-11 23:13 [PATCH net-next 0/5] selftests: drv-net: improve zerocopy tests Jakub Kicinski
2025-08-11 23:13 ` [PATCH net-next 1/5] selftests: drv-net: add configs for zerocopy Rx Jakub Kicinski
@ 2025-08-11 23:13 ` Jakub Kicinski
2025-08-11 23:55 ` Joe Damato
2025-08-12 16:58 ` Mina Almasry
2025-08-11 23:13 ` [PATCH net-next 3/5] selftests: drv-net: devmem: add / correct the IPv6 support Jakub Kicinski
` (4 subsequent siblings)
6 siblings, 2 replies; 19+ messages in thread
From: Jakub Kicinski @ 2025-08-11 23:13 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
almasrymina, noren, linux-kselftest, ap420073, Jakub Kicinski
The general expectations for network HW selftests is that they
will be run as root. sudo doesn't seem to work on NIPA VMs.
While it's probably something solvable in the setup I think we should
remove the sudos. devmem is the only networking test using sudo.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
tools/testing/selftests/drivers/net/hw/ncdevmem.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/testing/selftests/drivers/net/hw/ncdevmem.c b/tools/testing/selftests/drivers/net/hw/ncdevmem.c
index 72f828021f83..be937542b4c0 100644
--- a/tools/testing/selftests/drivers/net/hw/ncdevmem.c
+++ b/tools/testing/selftests/drivers/net/hw/ncdevmem.c
@@ -287,10 +287,10 @@ static int reset_flow_steering(void)
* the exit status.
*/
- run_command("sudo ethtool -K %s ntuple off >&2", ifname);
- run_command("sudo ethtool -K %s ntuple on >&2", ifname);
+ run_command("ethtool -K %s ntuple off >&2", ifname);
+ run_command("ethtool -K %s ntuple on >&2", ifname);
run_command(
- "sudo ethtool -n %s | grep 'Filter:' | awk '{print $2}' | xargs -n1 ethtool -N %s delete >&2",
+ "ethtool -n %s | grep 'Filter:' | awk '{print $2}' | xargs -n1 ethtool -N %s delete >&2",
ifname, ifname);
return 0;
}
@@ -351,12 +351,12 @@ static int configure_headersplit(bool on)
static int configure_rss(void)
{
- return run_command("sudo ethtool -X %s equal %d >&2", ifname, start_queue);
+ return run_command("ethtool -X %s equal %d >&2", ifname, start_queue);
}
static int configure_channels(unsigned int rx, unsigned int tx)
{
- return run_command("sudo ethtool -L %s rx %u tx %u", ifname, rx, tx);
+ return run_command("ethtool -L %s rx %u tx %u", ifname, rx, tx);
}
static int configure_flow_steering(struct sockaddr_in6 *server_sin)
@@ -374,7 +374,7 @@ static int configure_flow_steering(struct sockaddr_in6 *server_sin)
}
/* Try configure 5-tuple */
- if (run_command("sudo ethtool -N %s flow-type %s %s %s dst-ip %s %s %s dst-port %s queue %d >&2",
+ if (run_command("ethtool -N %s flow-type %s %s %s dst-ip %s %s %s dst-port %s queue %d >&2",
ifname,
type,
client_ip ? "src-ip" : "",
@@ -384,7 +384,7 @@ static int configure_flow_steering(struct sockaddr_in6 *server_sin)
client_ip ? port : "",
port, start_queue))
/* If that fails, try configure 3-tuple */
- if (run_command("sudo ethtool -N %s flow-type %s dst-ip %s dst-port %s queue %d >&2",
+ if (run_command("ethtool -N %s flow-type %s dst-ip %s dst-port %s queue %d >&2",
ifname,
type,
server_addr,
--
2.50.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH net-next 3/5] selftests: drv-net: devmem: add / correct the IPv6 support
2025-08-11 23:13 [PATCH net-next 0/5] selftests: drv-net: improve zerocopy tests Jakub Kicinski
2025-08-11 23:13 ` [PATCH net-next 1/5] selftests: drv-net: add configs for zerocopy Rx Jakub Kicinski
2025-08-11 23:13 ` [PATCH net-next 2/5] selftests: drv-net: devmem: remove sudo from system() calls Jakub Kicinski
@ 2025-08-11 23:13 ` Jakub Kicinski
2025-08-12 0:07 ` Joe Damato
2025-08-12 17:00 ` Mina Almasry
2025-08-11 23:13 ` [PATCH net-next 4/5] selftests: net: terminate bkg() commands on exception Jakub Kicinski
` (3 subsequent siblings)
6 siblings, 2 replies; 19+ messages in thread
From: Jakub Kicinski @ 2025-08-11 23:13 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
almasrymina, noren, linux-kselftest, ap420073, Jakub Kicinski
We need to use bracketed IPv6 addresses for socat.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
tools/testing/selftests/drivers/net/hw/devmem.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/drivers/net/hw/devmem.py b/tools/testing/selftests/drivers/net/hw/devmem.py
index baa2f24240ba..0a2533a3d6d6 100755
--- a/tools/testing/selftests/drivers/net/hw/devmem.py
+++ b/tools/testing/selftests/drivers/net/hw/devmem.py
@@ -24,7 +24,7 @@ from lib.py import ksft_disruptive
require_devmem(cfg)
port = rand_port()
- socat = f"socat -u - TCP{cfg.addr_ipver}:{cfg.addr}:{port},bind={cfg.remote_addr}:{port}"
+ socat = f"socat -u - TCP{cfg.addr_ipver}:{cfg.baddr}:{port},bind={cfg.remote_baddr}:{port}"
listen_cmd = f"{cfg.bin_local} -l -f {cfg.ifname} -s {cfg.addr} -p {port} -c {cfg.remote_addr} -v 7"
with bkg(listen_cmd, exit_wait=True) as ncdevmem:
--
2.50.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH net-next 4/5] selftests: net: terminate bkg() commands on exception
2025-08-11 23:13 [PATCH net-next 0/5] selftests: drv-net: improve zerocopy tests Jakub Kicinski
` (2 preceding siblings ...)
2025-08-11 23:13 ` [PATCH net-next 3/5] selftests: drv-net: devmem: add / correct the IPv6 support Jakub Kicinski
@ 2025-08-11 23:13 ` Jakub Kicinski
2025-08-12 0:08 ` Joe Damato
2025-08-12 17:02 ` Mina Almasry
2025-08-11 23:13 ` [PATCH net-next 5/5] selftests: drv-net: devmem: flip the direction of Tx tests Jakub Kicinski
` (2 subsequent siblings)
6 siblings, 2 replies; 19+ messages in thread
From: Jakub Kicinski @ 2025-08-11 23:13 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
almasrymina, noren, linux-kselftest, ap420073, Jakub Kicinski
There is a number of:
with bkg("socat ..LISTEN..", exit_wait=True)
uses in the tests. If whatever is supposed to send the traffic
fails we will get stuck in the bkg(). Try to kill the process
in case of exception, to avoid the long wait.
A specific example where this happens is the devmem Tx tests.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
tools/testing/selftests/net/lib/py/utils.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/lib/py/utils.py b/tools/testing/selftests/net/lib/py/utils.py
index f395c90fb0f1..4ac9249c85ab 100644
--- a/tools/testing/selftests/net/lib/py/utils.py
+++ b/tools/testing/selftests/net/lib/py/utils.py
@@ -117,6 +117,7 @@ import time
shell=shell, fail=fail, ns=ns, host=host,
ksft_wait=ksft_wait)
self.terminate = not exit_wait and not ksft_wait
+ self._exit_wait = exit_wait
self.check_fail = fail
if shell and self.terminate:
@@ -127,7 +128,9 @@ import time
return self
def __exit__(self, ex_type, ex_value, ex_tb):
- return self.process(terminate=self.terminate, fail=self.check_fail)
+ # Force termination on exception
+ terminate = self.terminate or (self._exit_wait and ex_type)
+ return self.process(terminate=terminate, fail=self.check_fail)
global_defer_queue = []
--
2.50.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH net-next 5/5] selftests: drv-net: devmem: flip the direction of Tx tests
2025-08-11 23:13 [PATCH net-next 0/5] selftests: drv-net: improve zerocopy tests Jakub Kicinski
` (3 preceding siblings ...)
2025-08-11 23:13 ` [PATCH net-next 4/5] selftests: net: terminate bkg() commands on exception Jakub Kicinski
@ 2025-08-11 23:13 ` Jakub Kicinski
2025-08-12 0:15 ` Joe Damato
2025-08-12 18:32 ` Mina Almasry
2025-08-12 16:46 ` [PATCH net-next 0/5] selftests: drv-net: improve zerocopy tests Stanislav Fomichev
2025-08-13 1:50 ` patchwork-bot+netdevbpf
6 siblings, 2 replies; 19+ messages in thread
From: Jakub Kicinski @ 2025-08-11 23:13 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
almasrymina, noren, linux-kselftest, ap420073, Jakub Kicinski
The Device Under Test should always be the local system.
While the Rx test gets this right the Tx test is sending
from remote to local. So Tx of DMABUF memory happens on remote.
These tests never run in NIPA since we don't have a compatible
device so we haven't caught this.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
tools/testing/selftests/drivers/net/hw/devmem.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/drivers/net/hw/devmem.py b/tools/testing/selftests/drivers/net/hw/devmem.py
index 0a2533a3d6d6..45c2d49d55b6 100755
--- a/tools/testing/selftests/drivers/net/hw/devmem.py
+++ b/tools/testing/selftests/drivers/net/hw/devmem.py
@@ -42,9 +42,9 @@ from lib.py import ksft_disruptive
port = rand_port()
listen_cmd = f"socat -U - TCP{cfg.addr_ipver}-LISTEN:{port}"
- with bkg(listen_cmd) as socat:
- wait_port_listen(port)
- cmd(f"echo -e \"hello\\nworld\"| {cfg.bin_remote} -f {cfg.ifname} -s {cfg.addr} -p {port}", host=cfg.remote, shell=True)
+ with bkg(listen_cmd, host=cfg.remote, exit_wait=True) as socat:
+ wait_port_listen(port, host=cfg.remote)
+ cmd(f"echo -e \"hello\\nworld\"| {cfg.bin_local} -f {cfg.ifname} -s {cfg.remote_addr} -p {port}", shell=True)
ksft_eq(socat.stdout.strip(), "hello\nworld")
@@ -56,9 +56,9 @@ from lib.py import ksft_disruptive
port = rand_port()
listen_cmd = f"socat -U - TCP{cfg.addr_ipver}-LISTEN:{port}"
- with bkg(listen_cmd, exit_wait=True) as socat:
- wait_port_listen(port)
- cmd(f"echo -e \"hello\\nworld\"| {cfg.bin_remote} -f {cfg.ifname} -s {cfg.addr} -p {port} -z 3", host=cfg.remote, shell=True)
+ with bkg(listen_cmd, host=cfg.remote, exit_wait=True) as socat:
+ wait_port_listen(port, host=cfg.remote)
+ cmd(f"echo -e \"hello\\nworld\"| {cfg.bin_local} -f {cfg.ifname} -s {cfg.remote_addr} -p {port} -z 3", shell=True)
ksft_eq(socat.stdout.strip(), "hello\nworld")
--
2.50.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH net-next 1/5] selftests: drv-net: add configs for zerocopy Rx
2025-08-11 23:13 ` [PATCH net-next 1/5] selftests: drv-net: add configs for zerocopy Rx Jakub Kicinski
@ 2025-08-11 23:52 ` Joe Damato
2025-08-12 16:56 ` Mina Almasry
1 sibling, 0 replies; 19+ messages in thread
From: Joe Damato @ 2025-08-11 23:52 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
almasrymina, noren, linux-kselftest, ap420073
On Mon, Aug 11, 2025 at 04:13:30PM -0700, Jakub Kicinski wrote:
> Looks like neither IO_URING nor UDMABUF are enabled even tho
> iou-zcrx.py and devmem.py (respectively) need those.
> IO_URING gets enabled by default but UDMABUF is missing.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> tools/testing/selftests/drivers/net/hw/config | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/testing/selftests/drivers/net/hw/config b/tools/testing/selftests/drivers/net/hw/config
> index 88ae719e6f8f..e8a06aa1471c 100644
> --- a/tools/testing/selftests/drivers/net/hw/config
> +++ b/tools/testing/selftests/drivers/net/hw/config
> @@ -1,5 +1,7 @@
> +CONFIG_IO_URING=y
> CONFIG_IPV6=y
> CONFIG_IPV6_GRE=y
> CONFIG_NET_IPGRE=y
> CONFIG_NET_IPGRE_DEMUX=y
> +CONFIG_UDMABUF=y
> CONFIG_VXLAN=y
Reviewed-by: Joe Damato <joe@dama.to>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next 2/5] selftests: drv-net: devmem: remove sudo from system() calls
2025-08-11 23:13 ` [PATCH net-next 2/5] selftests: drv-net: devmem: remove sudo from system() calls Jakub Kicinski
@ 2025-08-11 23:55 ` Joe Damato
2025-08-11 23:58 ` Jakub Kicinski
2025-08-12 16:58 ` Mina Almasry
1 sibling, 1 reply; 19+ messages in thread
From: Joe Damato @ 2025-08-11 23:55 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
almasrymina, noren, linux-kselftest, ap420073
On Mon, Aug 11, 2025 at 04:13:31PM -0700, Jakub Kicinski wrote:
> The general expectations for network HW selftests is that they
> will be run as root. sudo doesn't seem to work on NIPA VMs.
> While it's probably something solvable in the setup I think we should
> remove the sudos. devmem is the only networking test using sudo.
FWIW, it looks like:
virtio_net/virtio_net_common.sh
is also using sudo... that said in general I agree on removing the sudos, so:
Reviewed-by: Joe Damato <joe@dama.to>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next 2/5] selftests: drv-net: devmem: remove sudo from system() calls
2025-08-11 23:55 ` Joe Damato
@ 2025-08-11 23:58 ` Jakub Kicinski
0 siblings, 0 replies; 19+ messages in thread
From: Jakub Kicinski @ 2025-08-11 23:58 UTC (permalink / raw)
To: Joe Damato
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
almasrymina, noren, linux-kselftest, ap420073
On Mon, 11 Aug 2025 16:55:56 -0700 Joe Damato wrote:
> On Mon, Aug 11, 2025 at 04:13:31PM -0700, Jakub Kicinski wrote:
> > The general expectations for network HW selftests is that they
> > will be run as root. sudo doesn't seem to work on NIPA VMs.
> > While it's probably something solvable in the setup I think we should
> > remove the sudos. devmem is the only networking test using sudo.
>
> FWIW, it looks like:
>
> virtio_net/virtio_net_common.sh
I think there were two tests that had sudo in code comments.
But not the actual code. I may have misread..
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next 3/5] selftests: drv-net: devmem: add / correct the IPv6 support
2025-08-11 23:13 ` [PATCH net-next 3/5] selftests: drv-net: devmem: add / correct the IPv6 support Jakub Kicinski
@ 2025-08-12 0:07 ` Joe Damato
2025-08-12 17:00 ` Mina Almasry
1 sibling, 0 replies; 19+ messages in thread
From: Joe Damato @ 2025-08-12 0:07 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
almasrymina, noren, linux-kselftest, ap420073
On Mon, Aug 11, 2025 at 04:13:32PM -0700, Jakub Kicinski wrote:
> We need to use bracketed IPv6 addresses for socat.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> tools/testing/selftests/drivers/net/hw/devmem.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/drivers/net/hw/devmem.py b/tools/testing/selftests/drivers/net/hw/devmem.py
> index baa2f24240ba..0a2533a3d6d6 100755
> --- a/tools/testing/selftests/drivers/net/hw/devmem.py
> +++ b/tools/testing/selftests/drivers/net/hw/devmem.py
> @@ -24,7 +24,7 @@ from lib.py import ksft_disruptive
> require_devmem(cfg)
>
> port = rand_port()
> - socat = f"socat -u - TCP{cfg.addr_ipver}:{cfg.addr}:{port},bind={cfg.remote_addr}:{port}"
> + socat = f"socat -u - TCP{cfg.addr_ipver}:{cfg.baddr}:{port},bind={cfg.remote_baddr}:{port}"
FWIW I had no idea socat supports bracketed v4 addresses (just to make sure
this change won't break anything). A quick test I did locally shows it does.
Reviewed-by: Joe Damato <joe@dama.to>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next 4/5] selftests: net: terminate bkg() commands on exception
2025-08-11 23:13 ` [PATCH net-next 4/5] selftests: net: terminate bkg() commands on exception Jakub Kicinski
@ 2025-08-12 0:08 ` Joe Damato
2025-08-12 17:02 ` Mina Almasry
1 sibling, 0 replies; 19+ messages in thread
From: Joe Damato @ 2025-08-12 0:08 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
almasrymina, noren, linux-kselftest, ap420073
On Mon, Aug 11, 2025 at 04:13:33PM -0700, Jakub Kicinski wrote:
> There is a number of:
>
> with bkg("socat ..LISTEN..", exit_wait=True)
>
> uses in the tests. If whatever is supposed to send the traffic
> fails we will get stuck in the bkg(). Try to kill the process
> in case of exception, to avoid the long wait.
>
> A specific example where this happens is the devmem Tx tests.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> tools/testing/selftests/net/lib/py/utils.py | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
Reviewed-by: Joe Damato <joe@dama.to>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next 5/5] selftests: drv-net: devmem: flip the direction of Tx tests
2025-08-11 23:13 ` [PATCH net-next 5/5] selftests: drv-net: devmem: flip the direction of Tx tests Jakub Kicinski
@ 2025-08-12 0:15 ` Joe Damato
2025-08-12 18:32 ` Mina Almasry
1 sibling, 0 replies; 19+ messages in thread
From: Joe Damato @ 2025-08-12 0:15 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
almasrymina, noren, linux-kselftest, ap420073
On Mon, Aug 11, 2025 at 04:13:34PM -0700, Jakub Kicinski wrote:
> The Device Under Test should always be the local system.
> While the Rx test gets this right the Tx test is sending
> from remote to local. So Tx of DMABUF memory happens on remote.
>
> These tests never run in NIPA since we don't have a compatible
> device so we haven't caught this.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> tools/testing/selftests/drivers/net/hw/devmem.py | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/tools/testing/selftests/drivers/net/hw/devmem.py b/tools/testing/selftests/drivers/net/hw/devmem.py
> index 0a2533a3d6d6..45c2d49d55b6 100755
> --- a/tools/testing/selftests/drivers/net/hw/devmem.py
> +++ b/tools/testing/selftests/drivers/net/hw/devmem.py
> @@ -42,9 +42,9 @@ from lib.py import ksft_disruptive
> port = rand_port()
> listen_cmd = f"socat -U - TCP{cfg.addr_ipver}-LISTEN:{port}"
>
> - with bkg(listen_cmd) as socat:
> - wait_port_listen(port)
> - cmd(f"echo -e \"hello\\nworld\"| {cfg.bin_remote} -f {cfg.ifname} -s {cfg.addr} -p {port}", host=cfg.remote, shell=True)
> + with bkg(listen_cmd, host=cfg.remote, exit_wait=True) as socat:
> + wait_port_listen(port, host=cfg.remote)
> + cmd(f"echo -e \"hello\\nworld\"| {cfg.bin_local} -f {cfg.ifname} -s {cfg.remote_addr} -p {port}", shell=True)
>
> ksft_eq(socat.stdout.strip(), "hello\nworld")
>
> @@ -56,9 +56,9 @@ from lib.py import ksft_disruptive
> port = rand_port()
> listen_cmd = f"socat -U - TCP{cfg.addr_ipver}-LISTEN:{port}"
>
> - with bkg(listen_cmd, exit_wait=True) as socat:
> - wait_port_listen(port)
> - cmd(f"echo -e \"hello\\nworld\"| {cfg.bin_remote} -f {cfg.ifname} -s {cfg.addr} -p {port} -z 3", host=cfg.remote, shell=True)
> + with bkg(listen_cmd, host=cfg.remote, exit_wait=True) as socat:
> + wait_port_listen(port, host=cfg.remote)
> + cmd(f"echo -e \"hello\\nworld\"| {cfg.bin_local} -f {cfg.ifname} -s {cfg.remote_addr} -p {port} -z 3", shell=True)
>
> ksft_eq(socat.stdout.strip(), "hello\nworld")
FWIW: I don't have one of these devices to test this on, but the change seems
reasonable to me, so:
Reviewed-by: Joe Damato <joe@dama.to>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next 0/5] selftests: drv-net: improve zerocopy tests
2025-08-11 23:13 [PATCH net-next 0/5] selftests: drv-net: improve zerocopy tests Jakub Kicinski
` (4 preceding siblings ...)
2025-08-11 23:13 ` [PATCH net-next 5/5] selftests: drv-net: devmem: flip the direction of Tx tests Jakub Kicinski
@ 2025-08-12 16:46 ` Stanislav Fomichev
2025-08-13 1:50 ` patchwork-bot+netdevbpf
6 siblings, 0 replies; 19+ messages in thread
From: Stanislav Fomichev @ 2025-08-12 16:46 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
almasrymina, noren, linux-kselftest, ap420073
On 08/11, Jakub Kicinski wrote:
> 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
>
> Jakub Kicinski (5):
> selftests: drv-net: add configs for zerocopy Rx
> selftests: drv-net: devmem: remove sudo from system() calls
> selftests: drv-net: devmem: add / correct the IPv6 support
> selftests: net: terminate bkg() commands on exception
> selftests: drv-net: devmem: flip the direction of Tx tests
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next 1/5] selftests: drv-net: add configs for zerocopy Rx
2025-08-11 23:13 ` [PATCH net-next 1/5] selftests: drv-net: add configs for zerocopy Rx Jakub Kicinski
2025-08-11 23:52 ` Joe Damato
@ 2025-08-12 16:56 ` Mina Almasry
1 sibling, 0 replies; 19+ messages in thread
From: Mina Almasry @ 2025-08-12 16:56 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
noren, linux-kselftest, ap420073
On Mon, Aug 11, 2025 at 4:13 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> Looks like neither IO_URING nor UDMABUF are enabled even tho
> iou-zcrx.py and devmem.py (respectively) need those.
> IO_URING gets enabled by default but UDMABUF is missing.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
At first glance I thought CONFIG_NET_DEVMEM=y could also be added, but
that is def_bool y, so it's very unnecessary to add it.
Reviewed-by: Mina Almasry <almasrymina@google.com>
--
Thanks,
Mina
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next 2/5] selftests: drv-net: devmem: remove sudo from system() calls
2025-08-11 23:13 ` [PATCH net-next 2/5] selftests: drv-net: devmem: remove sudo from system() calls Jakub Kicinski
2025-08-11 23:55 ` Joe Damato
@ 2025-08-12 16:58 ` Mina Almasry
1 sibling, 0 replies; 19+ messages in thread
From: Mina Almasry @ 2025-08-12 16:58 UTC (permalink / raw)
To: Jakub Kicinski, Pranjal Shrivastava, Shivaji Kant
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
noren, linux-kselftest, ap420073
On Mon, Aug 11, 2025 at 4:13 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> The general expectations for network HW selftests is that they
> will be run as root. sudo doesn't seem to work on NIPA VMs.
> While it's probably something solvable in the setup I think we should
> remove the sudos. devmem is the only networking test using sudo.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
I suspect this breaks my test setup, but I can probably figure out how
to run our tests as sudo. I can't argue with consistency with the rest
of the tests which don't sudo anyway :D
Reviewed-by: Mina Almasry <almasrymina@google.com>
--
Thanks,
Mina
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next 3/5] selftests: drv-net: devmem: add / correct the IPv6 support
2025-08-11 23:13 ` [PATCH net-next 3/5] selftests: drv-net: devmem: add / correct the IPv6 support Jakub Kicinski
2025-08-12 0:07 ` Joe Damato
@ 2025-08-12 17:00 ` Mina Almasry
1 sibling, 0 replies; 19+ messages in thread
From: Mina Almasry @ 2025-08-12 17:00 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
noren, linux-kselftest, ap420073
On Mon, Aug 11, 2025 at 4:13 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> We need to use bracketed IPv6 addresses for socat.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Mina Almasry <almasrymina@google.com>
--
Thanks,
Mina
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next 4/5] selftests: net: terminate bkg() commands on exception
2025-08-11 23:13 ` [PATCH net-next 4/5] selftests: net: terminate bkg() commands on exception Jakub Kicinski
2025-08-12 0:08 ` Joe Damato
@ 2025-08-12 17:02 ` Mina Almasry
1 sibling, 0 replies; 19+ messages in thread
From: Mina Almasry @ 2025-08-12 17:02 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
noren, linux-kselftest, ap420073
On Mon, Aug 11, 2025 at 4:13 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> There is a number of:
>
> with bkg("socat ..LISTEN..", exit_wait=True)
>
> uses in the tests. If whatever is supposed to send the traffic
> fails we will get stuck in the bkg(). Try to kill the process
> in case of exception, to avoid the long wait.
>
> A specific example where this happens is the devmem Tx tests.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--
Thanks,
Mina
Acked-by: Mina Almasry <almasrymina@google.com>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next 5/5] selftests: drv-net: devmem: flip the direction of Tx tests
2025-08-11 23:13 ` [PATCH net-next 5/5] selftests: drv-net: devmem: flip the direction of Tx tests Jakub Kicinski
2025-08-12 0:15 ` Joe Damato
@ 2025-08-12 18:32 ` Mina Almasry
1 sibling, 0 replies; 19+ messages in thread
From: Mina Almasry @ 2025-08-12 18:32 UTC (permalink / raw)
To: Jakub Kicinski, Shivaji Kant, Pranjal Shrivastava
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
noren, linux-kselftest, ap420073
On Mon, Aug 11, 2025 at 4:13 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> The Device Under Test should always be the local system.
> While the Rx test gets this right the Tx test is sending
> from remote to local. So Tx of DMABUF memory happens on remote.
>
> These tests never run in NIPA since we don't have a compatible
> device so we haven't caught this.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Changes look reasonable, and to my eye the rx and tx commands are just
switched with no changes. I would have liked to test this first but
I'm not sure I'll get the chance today. So:
Reviewed-by: Mina Almasry <almasrymina@google.com>
and I guess when I have a chance to test I'll either give Tested-by or
a fix on top.
--
Thanks,
Mina
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH net-next 0/5] selftests: drv-net: improve zerocopy tests
2025-08-11 23:13 [PATCH net-next 0/5] selftests: drv-net: improve zerocopy tests Jakub Kicinski
` (5 preceding siblings ...)
2025-08-12 16:46 ` [PATCH net-next 0/5] selftests: drv-net: improve zerocopy tests Stanislav Fomichev
@ 2025-08-13 1:50 ` patchwork-bot+netdevbpf
6 siblings, 0 replies; 19+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-13 1:50 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, andrew+netdev, horms, shuah, sdf,
almasrymina, noren, linux-kselftest, ap420073
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 11 Aug 2025 16:13:29 -0700 you wrote:
> 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
>
> [...]
Here is the summary with links:
- [net-next,1/5] selftests: drv-net: add configs for zerocopy Rx
https://git.kernel.org/netdev/net-next/c/27e5b560a86e
- [net-next,2/5] selftests: drv-net: devmem: remove sudo from system() calls
https://git.kernel.org/netdev/net-next/c/a94e9cf79cee
- [net-next,3/5] selftests: drv-net: devmem: add / correct the IPv6 support
https://git.kernel.org/netdev/net-next/c/424e96de3023
- [net-next,4/5] selftests: net: terminate bkg() commands on exception
https://git.kernel.org/netdev/net-next/c/6e9a12f85a75
- [net-next,5/5] selftests: drv-net: devmem: flip the direction of Tx tests
https://git.kernel.org/netdev/net-next/c/c378c497f3fe
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2025-08-13 1:50 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11 23:13 [PATCH net-next 0/5] selftests: drv-net: improve zerocopy tests Jakub Kicinski
2025-08-11 23:13 ` [PATCH net-next 1/5] selftests: drv-net: add configs for zerocopy Rx Jakub Kicinski
2025-08-11 23:52 ` Joe Damato
2025-08-12 16:56 ` Mina Almasry
2025-08-11 23:13 ` [PATCH net-next 2/5] selftests: drv-net: devmem: remove sudo from system() calls Jakub Kicinski
2025-08-11 23:55 ` Joe Damato
2025-08-11 23:58 ` Jakub Kicinski
2025-08-12 16:58 ` Mina Almasry
2025-08-11 23:13 ` [PATCH net-next 3/5] selftests: drv-net: devmem: add / correct the IPv6 support Jakub Kicinski
2025-08-12 0:07 ` Joe Damato
2025-08-12 17:00 ` Mina Almasry
2025-08-11 23:13 ` [PATCH net-next 4/5] selftests: net: terminate bkg() commands on exception Jakub Kicinski
2025-08-12 0:08 ` Joe Damato
2025-08-12 17:02 ` Mina Almasry
2025-08-11 23:13 ` [PATCH net-next 5/5] selftests: drv-net: devmem: flip the direction of Tx tests Jakub Kicinski
2025-08-12 0:15 ` Joe Damato
2025-08-12 18:32 ` Mina Almasry
2025-08-12 16:46 ` [PATCH net-next 0/5] selftests: drv-net: improve zerocopy tests Stanislav Fomichev
2025-08-13 1:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).