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: <20250217161954.57fd1457@kernel.org>
Date: Mon, 17 Feb 2025 16:19:54 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Gal Pressman <gal@...dia.com>
Cc: "David S. Miller" <davem@...emloft.net>, <netdev@...r.kernel.org>, Eric
 Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Simon
 Horman <horms@...nel.org>, Jonathan Corbet <corbet@....net>, Tony Nguyen
 <anthony.l.nguyen@...el.com>, Przemek Kitszel
 <przemyslaw.kitszel@...el.com>, Andrew Lunn <andrew+netdev@...n.ch>, "Tariq
 Toukan" <tariqt@...dia.com>, Edward Cree <ecree.xilinx@...il.com>, Ahmed
 Zaki <ahmed.zaki@...el.com>, <linux-doc@...r.kernel.org>, Nimrod Oren
 <noren@...dia.com>
Subject: Re: [PATCH net-next v3 5/5] selftests: drv-net-hw: Add a test for
 symmetric RSS hash

On Sun, 16 Feb 2025 20:24:53 +0200 Gal Pressman wrote:
> +    # Check for symmetric xor/or-xor
> +    if input_xfrm and (input_xfrm == 1 or input_xfrm == 2):
> +        port1 = _get_rand_port(cfg.remote)
> +        port2 = _get_rand_port(cfg.remote)
> +        ksft_pr(f'Running traffic on ports: {port1 = }, {port2 = }')
> +
> +        cnts = _get_rx_cnts(cfg)
> +        GenerateTraffic(cfg, port=port1, parallel=1,
> +                        cport=port2).wait_pkts_and_stop(20000)
> +        cnts = _get_rx_cnts(cfg, prev=cnts)
> +        rxq1 = _get_active_rx_queue(cnts)
> +        ksft_pr(f'Received traffic on {rxq1 = }')
> +
> +        cnts = _get_rx_cnts(cfg)
> +        GenerateTraffic(cfg, port=port2, parallel=1,
> +                        cport=port1).wait_pkts_and_stop(20000)
> +        cnts = _get_rx_cnts(cfg, prev=cnts)
> +        rxq2 = _get_active_rx_queue(cnts)
> +        ksft_pr(f'Received traffic on {rxq2 = }')
> +
> +        ksft_eq(
> +            rxq1, rxq2, comment=f"Received traffic on different queues ({rxq1} != {rxq2}) while symmetric hash is configured")

Wouldn't it be both faster and less error prone to test this with UDP
sockets?

	sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
	sock.connect(cfg.remove_addr_v[ipver], remote_port)
	sock.recvmsg(100)

	tgt = f"{ipver}:{cfg.addr_v[ipver]}:{local_port},sourceport={remote_port}"
	cmd("echo a | socat - UDP" + tgt, host=cfg.remote)

	cpu = sock.getsockopt(socket.SOL_SOCKET, socket.SO_INCOMING_CPU)

Run this for 10 pairs for ports, make sure we hit at least 2 CPUs,
and that the CPUs match for each pair.

Would be good to test both IPv4 and IPv6. I'm going to merge:
  https://lore.kernel.org/all/20250217194200.3011136-4-kuba@kernel.org/
it should make writing the v4 + v6 test combos easier.
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ