From: Jakub Kicinski <kuba@kernel.org>
To: Gal Pressman <gal@nvidia.com>
Cc: "David S. Miller" <davem@davemloft.net>, <netdev@vger.kernel.org>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"Tariq Toukan" <tariqt@nvidia.com>,
Edward Cree <ecree.xilinx@gmail.com>,
Ahmed Zaki <ahmed.zaki@intel.com>, <linux-doc@vger.kernel.org>,
Nimrod Oren <noren@nvidia.com>
Subject: Re: [PATCH net-next v3 5/5] selftests: drv-net-hw: Add a test for symmetric RSS hash
Date: Mon, 17 Feb 2025 16:19:54 -0800 [thread overview]
Message-ID: <20250217161954.57fd1457@kernel.org> (raw)
In-Reply-To: <20250216182453.226325-6-gal@nvidia.com>
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
next prev parent reply other threads:[~2025-02-18 0:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-16 18:24 [PATCH net-next v3 0/5] Symmetric OR-XOR RSS hash Gal Pressman
2025-02-16 18:24 ` [PATCH net-next v3 1/5] ethtool: " Gal Pressman
2025-02-16 18:24 ` [PATCH net-next v3 2/5] net/mlx5e: Symmetric OR-XOR RSS hash control Gal Pressman
2025-02-16 18:24 ` [PATCH net-next v3 3/5] selftests: drv-net: Make rand_port() get a port more reliably Gal Pressman
2025-02-16 18:24 ` [PATCH net-next v3 4/5] selftests: drv-net: Introduce a function that checks whether a port is available on remote host Gal Pressman
2025-02-16 18:24 ` [PATCH net-next v3 5/5] selftests: drv-net-hw: Add a test for symmetric RSS hash Gal Pressman
2025-02-18 0:19 ` Jakub Kicinski [this message]
2025-02-18 20:26 ` Gal Pressman
2025-02-18 21:24 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250217161954.57fd1457@kernel.org \
--to=kuba@kernel.org \
--cc=ahmed.zaki@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=horms@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=noren@nvidia.com \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).