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: <87fraaarfv.fsf@nvidia.com>
Date: Wed, 19 Nov 2025 17:39:46 +0100
From: Petr Machata <petrm@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: <davem@...emloft.net>, <netdev@...r.kernel.org>, <edumazet@...gle.com>,
	<pabeni@...hat.com>, <andrew+netdev@...n.ch>, <horms@...nel.org>,
	<willemdebruijn.kernel@...il.com>, <shuah@...nel.org>, <sdf@...ichev.me>,
	<krakauer@...gle.com>, <linux-kselftest@...r.kernel.org>, <petrm@...dia.com>,
	<matttbe@...nel.org>
Subject: Re: [PATCH net-next v2 10/12] selftests: drv-net: hw: convert the
 Toeplitz test to Python


Jakub Kicinski <kuba@...nel.org> writes:

> Rewrite the existing toeplitz.sh test in Python. The conversion
> is a lot less exact than the GRO one. We use Netlink APIs to
> get the device RSS and IRQ information. We expect that the device
> has neither RPS nor RFS configured, and set RPS up as part of
> the test.
>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>

Reviewed-by: Petr Machata <petrm@...dia.com>

> +    # Set RPS bitmap for all rx queues
> +    for rps_file in glob.glob(f"/sys/class/net/{cfg.ifname}/queues/rx-*/rps_cpus"):
> +        cmd(f"echo {mask} > {rps_file}", shell=True)

A bit odd to use echo like this, the other test does this through open /
write. Unless I'm missing something and this actually runs remotely...?

Anyway, not important. Just that maybe eventually some helpers that
support this sysfs-based configuration might be handy.

> +    return mask
> +
> +
> +def _send_traffic(cfg, proto_flag, ipver, port):
> +    """Send 20 packets of requested type."""
> +
> +    # Determine protocol and IP version for socat
> +    if proto_flag == "-u":
> +        proto = "UDP"
> +    else:
> +        proto = "TCP"
> +
> +    baddr = f"[{cfg.addr_v['6']}]" if ipver == "6" else cfg.addr_v["4"]
> +
> +    # Run socat in a loop to send traffic periodically
> +    # Use sh -c with a loop similar to toeplitz_client.sh
> +    socat_cmd = f"""
> +    for i in `seq 20`; do
> +        echo "msg $i" | socat -{ipver} -t 0.1 - {proto}:{baddr}:{port};
> +        sleep 0.001;
> +    done
> +    """

Yeah, what with the remote execution, this probably makes sense.

> +    cmd(socat_cmd, shell=True, host=cfg.remote)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ