From: Thomas Wilks <thomas.wilks@arm.com>
To: dev@dpdk.org
Cc: Paul Szczepanek <paul.szczepanek@arm.com>,
Luca Vizzarro <luca.vizzarro@arm.com>,
Patrick Robb <probb@iol.unh.edu>,
Alex Chapman <alex.chapman@arm.com>,
Thomas Wilks <thomas.wilks@arm.com>
Subject: [PATCH v2 3/6] dts: add PMD RSS hash testsuite
Date: Tue, 25 Feb 2025 15:33:42 +0000 [thread overview]
Message-ID: <20250225153345.331216-4-thomas.wilks@arm.com> (raw)
In-Reply-To: <20250225153345.331216-1-thomas.wilks@arm.com>
From: Alex Chapman <alex.chapman@arm.com>
Port over the pmd_rss_hash test suite from old DTS. This
suite verifies that the 4 supported types of hashing
algorithm used in Receive Side Scaling (RSS) function
correctly. Them being DEFAULT, TOEPLITZ
SYMMETRIC_TOEPLITZ and SIMPLE_XOR. This test suite also
verifies the supported hashing algorithms reported by
the NIC are correct.
Signed-off-by: Alex Chapman <alex.chapman@arm.com>
Signed-off-by: Thomas Wilks <thomas.wilks@arm.com>
Reviewed-by: Paul Szczepanek <paul.szczepanek@arm.com>
---
| 118 ++++++++++++++++++++++++++++
1 file changed, 118 insertions(+)
create mode 100644 dts/tests/TestSuite_pmd_rss_hash.py
--git a/dts/tests/TestSuite_pmd_rss_hash.py b/dts/tests/TestSuite_pmd_rss_hash.py
new file mode 100644
index 0000000000..d21e33456e
--- /dev/null
+++ b/dts/tests/TestSuite_pmd_rss_hash.py
@@ -0,0 +1,118 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2025 Arm Limited
+
+"""RSS Hash testing suite.
+
+Hashing algorithms are used in conjunction with a RSS hash keys to hash packets.
+This test suite verifies that updating the Hashing algorithms will
+continue to correctly hash packets.
+
+Symmetric_toeplitz_sort hasn't been included due to it not being supported by
+the rss func actions in the flow rule.
+"""
+
+from framework.remote_session.testpmd_shell import FlowRule, TestPmdShell
+from framework.test_suite import TestSuite, func_test
+from framework.testbed_model.capability import NicCapability, requires
+from framework.testbed_model.topology import TopologyType
+from framework.utils import StrEnum
+
+from .pmd_rss_utils import ( # type: ignore[import-untyped]
+ SendTestPackets,
+ SetupRssEnvironment,
+ VerifyHashQueue,
+)
+
+NUM_QUEUES = 16
+
+
+class HashAlgorithm(StrEnum):
+ """Enum of hashing algorithms."""
+
+ DEFAULT = "default"
+ SIMPLE_XOR = "simple_xor"
+ TOEPLITZ = "toeplitz"
+ SYMMETRIC_TOEPLITZ = "symmetric_toeplitz"
+
+
+@requires(topology_type=TopologyType.one_link)
+class TestPmdRssHash(TestSuite):
+ """PMD RSS Hash test suite.
+
+ Verifies the redirection table when updating the size.
+ The suite contains four tests, one for each hash algorithms.
+ """
+
+ def VerifyHashFunction(self, hash_algorithm: HashAlgorithm) -> None:
+ """Verifies the hash function is supported by the NIC.
+
+ Args:
+ hash_algorithm: The hash algorithm to be tested.
+ """
+ is_symmetric = hash_algorithm == HashAlgorithm.SYMMETRIC_TOEPLITZ
+ # Build flow rule
+ flow_rule = FlowRule(
+ group_id=0,
+ direction="ingress",
+ pattern=["eth / ipv4 / udp"],
+ actions=[f"rss types ipv4-udp end queues end func {str(hash_algorithm).lower()}"],
+ )
+
+ # Run the key update test suite with an asymmetric hash algorithm
+ with TestPmdShell(
+ rx_queues=NUM_QUEUES,
+ tx_queues=NUM_QUEUES,
+ ) as testpmd:
+ # Setup testpmd environment for RSS, create RETA table, return RETA table and key_size
+ reta, _ = SetupRssEnvironment(self, testpmd, NUM_QUEUES, flow_rule)
+ # Send udp packets and ensure hash corresponds with queue
+ parsed_output = SendTestPackets(self, testpmd, is_symmetric)
+ VerifyHashQueue(self, reta, parsed_output, is_symmetric)
+
+ @func_test
+ def TestDefaultHashAlgorithm(self) -> None:
+ """Default hashing algorithm test.
+
+ Steps:
+ Setup RSS environment using the default RSS hashing algorithm
+ and send test packets.
+ Verify:
+ Packet hash corresponds to the packet queue.
+ """
+ self.VerifyHashFunction(HashAlgorithm.DEFAULT)
+
+ @func_test
+ def TestToeplitzHashAlgorithm(self) -> None:
+ """Toeplitz hashing algorithm test.
+
+ Steps:
+ Setup RSS environment using the toeplitz RSS hashing algorithm and send test packets.
+ Verify:
+ Packet hash corresponds to the packet queue.
+ """
+ self.VerifyHashFunction(HashAlgorithm.TOEPLITZ)
+
+ @func_test
+ def TestSymmetricToeplitzHashAlgorithm(self) -> None:
+ """Symmetric toeplitz hashing algorithm test.
+
+ Steps:
+ Setup RSS environment using the symmetric_toeplitz RSS hashing algorithm
+ and send test packets.
+ Verify:
+ Packet hash corresponds to the packet queue.
+ """
+ self.VerifyHashFunction(HashAlgorithm.SYMMETRIC_TOEPLITZ)
+
+ @requires(NicCapability.XOR_SUPPORT)
+ @func_test
+ def TestSimpleXorHashAlgorithm(self) -> None:
+ """Simple xor hashing algorithm test.
+
+ Steps:
+ Setup RSS environment using the simple xor RSS hashing algorithm
+ and send test packets.
+ Verify:
+ Packet hash corresponds to the packet queue.
+ """
+ self.VerifyHashFunction(HashAlgorithm.SIMPLE_XOR)
--
2.43.0
next prev parent reply other threads:[~2025-02-25 15:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-29 12:50 [PATCH] dts: add RSS functions to testpmd Alex Chapman
2024-09-06 14:29 ` Juraj Linkeš
2025-02-25 15:33 ` [PATCH v2 0/6] Added RSS functions and tests Thomas Wilks
2025-02-25 15:33 ` [PATCH v2 1/6] dts: add RSS functions to testpmd Thomas Wilks
2025-02-25 15:33 ` [PATCH v2 2/6] dts: add utils for PMD RSS testsuites Thomas Wilks
2025-02-25 15:33 ` Thomas Wilks [this message]
2025-02-25 15:33 ` [PATCH v2 4/6] dts: add PMD RSS RETA testsuite Thomas Wilks
2025-02-25 15:33 ` [PATCH v2 5/6] dts: add PMD RSS key update testsuite Thomas Wilks
2025-02-25 15:33 ` [PATCH v2 6/6] dts: add NIC capabilities for hash algorithms Thomas Wilks
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=20250225153345.331216-4-thomas.wilks@arm.com \
--to=thomas.wilks@arm.com \
--cc=alex.chapman@arm.com \
--cc=dev@dpdk.org \
--cc=luca.vizzarro@arm.com \
--cc=paul.szczepanek@arm.com \
--cc=probb@iol.unh.edu \
/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).