Skip to contentSkip to conversation

dts: update parsing for cryptodev latency

RFC PATCH New Andrew Bailey 2 participants 11 messages Apr 28 – Jul 8

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/2 dts: update parsing for cryptodev latency

Previously, the parsing for cryptodev latency output would fail to parse due to an incorrect regex. This commit updates this regex to properly capture the burst size attribute for latency results.

Bugzilla ID: 1938

Fixes 8ee2df9da125 ("dts: add cryptodev package")
---
 dts/api/cryptodev/types.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dts/api/cryptodev/types.py +1 -1
index df73a86fa4..0942d08371 100644
@@ -69,7 +69,7 @@ class LatencyResults(CryptodevResults):
     )
     #: burst size ran with app
     burst_size: int = field(
-        metadata=TextParser.find_int(rf"Burst(?:.*\n\s+\d+\s+){2}?(?: size:\s+)?(\d+)"),
+        metadata=TextParser.find_int(r"Burst size:\s+(\d+)"),
     )
     #: total operations ran
     total_ops: int = field(metadata=TextParser.find_int(r"total operations:\s+(\d+)"))
Signature · 1 line
2.50.1
#1 lore raw

RFC PATCH 2/2 dts: add latency coverage for cryptodev testing

Currently, next DTS only has cryptodev testing coverage for throughput metrics. This patch adds a test suite to include latency testing for crypto devices.

---
 .../dts/tests.TestSuite_cryptodev_latency.rst |   8 +
 dts/tests/TestSuite_cryptodev_latency.py      | 356 ++++++++++++++++++
 2 files changed, 364 insertions(+)
 create mode 100644 doc/api/dts/tests.TestSuite_cryptodev_latency.rst
 create mode 100644 dts/tests/TestSuite_cryptodev_latency.py
doc/api/dts/tests.TestSuite_cryptodev_latency.rst new file +8 -0
new file mode 100644
index 0000000000..1bf4a0f4b0
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+
+cryptodev_latency Test Suite
+============================
+
+.. automodule:: tests.TestSuite_cryptodev_latency
+   :members:
+   :show-inheritance:
dts/tests/TestSuite_cryptodev_latency.py new file +356 -0

356 lines not on this page · raw message

Signature · 1 line
2.50.1
#2 lore raw

PATCH 1/2 dts: update parsing for cryptodev latency

In reply to Andrew Bailey

Previously, the parsing for cryptodev latency output would fail to parse due to an incorrect regex. This commit updates this regex to properly capture the burst size attribute for latency results.

Bugzilla ID: 1938

Fixes 8ee2df9da125 ("dts: add cryptodev package")
---
 dts/api/cryptodev/__init__.py | 3 +--
 dts/api/cryptodev/types.py    | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)
dts/api/cryptodev/__init__.py +1 -2
index a4fafc3713..15cffcb409 100644
@@ -117,7 +117,6 @@ def run_app(self, num_vfs: int = 1) -> list[CryptodevResults]:
                     f"dependencies missing for virtual device {self._app_params['vdevs'][0].name}"
                 )
             raise e
-
         regex = r"^\s+\d+.*$"
         parser_options = re.MULTILINE
         parser: type[CryptodevResults]
@@ -126,7 +125,7 @@ def run_app(self, num_vfs: int = 1) -> list[CryptodevResults]:
             case TestType.throughput:
                 parser = ThroughputResults
             case TestType.latency:
-                regex = r"total operations:.*time[^\n]*"
+                regex = r"total operations:.*?time[^\n]*"
                 parser_options |= re.DOTALL
                 parser = LatencyResults
             case TestType.pmd_cyclecount:
dts/api/cryptodev/types.py +2 -2
index df73a86fa4..7b4fd17cb6 100644
@@ -65,11 +65,11 @@ class LatencyResults(CryptodevResults):
 
     #: buffer size ran with app
     buffer_size: int = field(
-        metadata=TextParser.find_int(r"Buf(?:.*\n\s+\d+\s+)?(?:fer size:\s+)?(\d+)"),
+        metadata=TextParser.find_int(r"Buffer size:\s+(\d+)"),
     )
     #: burst size ran with app
     burst_size: int = field(
-        metadata=TextParser.find_int(rf"Burst(?:.*\n\s+\d+\s+){2}?(?: size:\s+)?(\d+)"),
+        metadata=TextParser.find_int(r"Burst size:\s+(\d+)"),
     )
     #: total operations ran
     total_ops: int = field(metadata=TextParser.find_int(r"total operations:\s+(\d+)"))
Signature · 1 line
2.50.1
#3 lore raw

PATCH 2/2 dts: add latency coverage for cryptodev testing

Currently, next DTS only has cryptodev testing coverage for throughput metrics. This patch adds a test suite to include latency testing for crypto devices.

---
 .../dts/tests.TestSuite_cryptodev_latency.rst |   8 +
 dts/tests/TestSuite_cryptodev_latency.py      | 695 ++++++++++++++++++
 2 files changed, 703 insertions(+)
 create mode 100644 doc/api/dts/tests.TestSuite_cryptodev_latency.rst
 create mode 100644 dts/tests/TestSuite_cryptodev_latency.py
doc/api/dts/tests.TestSuite_cryptodev_latency.rst new file +8 -0
new file mode 100644
index 0000000000..1bf4a0f4b0
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+
+cryptodev_latency Test Suite
+============================
+
+.. automodule:: tests.TestSuite_cryptodev_latency
+   :members:
+   :show-inheritance:
dts/tests/TestSuite_cryptodev_latency.py new file +695 -0

695 lines not on this page · raw message

Signature · 1 line
2.50.1
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH v1 2/2] dts: add latency coverage for cryptodev testing

Quoted 46 lines · Andrew Bailey

Currently, next DTS only has cryptodev testing coverage for throughput metrics. This patch adds a test suite to include latency testing for crypto devices.

---
 .../dts/tests.TestSuite_cryptodev_latency.rst |   8 +
 dts/tests/TestSuite_cryptodev_latency.py      | 695 ++++++++++++++++++
 2 files changed, 703 insertions(+)
 create mode 100644 doc/api/dts/tests.TestSuite_cryptodev_latency.rst
 create mode 100644 dts/tests/TestSuite_cryptodev_latency.py
dts/tests/TestSuite_cryptodev_latency.py new file +6 -0
+    @crypto_test
+    def aesni_gcm_vdev(self) -> None:
+        """aesni_gcm virtual device latency test.
+
+        Steps:
+            * Create a cryptodev instance with provided device type and

buffer sizes.

dts/tests/TestSuite_cryptodev_latency.py new file +26 -0
+        Verify:
+            * The latency is below or within delta of provided baseline.
+
+        Raises:
+            SkippedTestException: When configuration is not provided.
+        """
+        if "aesni_gcm_vdev" not in self.latency_test_parameters:
+            skip("test not configured")
+        app = Cryptodev(
+            ptest=TestType.latency,
+            vdevs=[VirtualDevice("crypto_aesni_gcm0")],
+            devtype=DeviceType.crypto_aesni_gcm,
+            optype=OperationType.aead,
+            aead_op=EncryptDecryptSwitch.encrypt,
+            aead_key_sz=16,
+            aead_iv_sz=12,
+            aead_aad_sz=16,
+            digest_sz=16,
+            burst_sz=32,
+            total_ops=TOTAL_OPS,
+            buffer_sz=self.buffer_sizes["aesni_gcm_vdev"],
+        )
+        results = self._verify_latency(app.run_app(), "aesni_gcm_vdev")
+        self._print_stats(results)
+        for result in results:
+            verify(result["passed"] == "PASS", "latency fell more than
Quoted 2 lines

the delta tolerance")

Why this one does not have "below baseline" in the string like other verify assertions in this suite?

Quoted 113 lines
dts/tests/TestSuite_cryptodev_latency.py new file +7 -0
+
+    @crypto_test
+    def aesni_mb_cipher_then_auth_vdev(self) -> None:
+        """aesni_mb vdev cipher and auth latency test.
+
+        Steps:
+            * Create a cryptodev instance with provided device type and

buffer sizes.

dts/tests/TestSuite_cryptodev_latency.py new file +7 -0
+        Verify:
+            * The latency is below or within delta of provided baseline.
+
+        Raises:
+            SkippedTestException: When configuration is not provided.
+        """
+        if "aesni_mb_cipher_then_auth_vdev" not in

self.latency_test_parameters:

dts/tests/TestSuite_cryptodev_latency.py new file +18 -0
+            skip("test not configured")
+        app = Cryptodev(
+            ptest=TestType.latency,
+            vdevs=[VirtualDevice("crypto_aesni_mb0")],
+            devtype=DeviceType.crypto_aesni_mb,
+            optype=OperationType.cipher_then_auth,
+            cipher_algo=CipherAlgorithm.aes_cbc,
+            cipher_op=EncryptDecryptSwitch.encrypt,
+            cipher_key_sz=16,
+            auth_algo=AuthenticationAlgorithm.sha1_hmac,
+            auth_op=AuthenticationOpMode.generate,
+            auth_key_sz=64,
+            digest_sz=12,
+            burst_sz=32,
+            total_ops=TOTAL_OPS,
+            buffer_sz=self.buffer_sizes["aesni_mb_cipher_then_auth_vdev"],
+        )
+        results = self._verify_latency(app.run_app(),

"aesni_mb_cipher_then_auth_vdev")

dts/tests/TestSuite_cryptodev_latency.py new file +5 -0
+        self._print_stats(results)
+        for result in results:
+            verify(
+                result["passed"] == "PASS",
+                "latency fell more than the delta tolerance below

baseline",

dts/tests/TestSuite_cryptodev_latency.py new file +8 -0
+            )
+
+    @crypto_test
+    def aesni_mb_vdev(self) -> None:
+        """aesni_mb vdev latency test.
+
+        Steps:
+            * Create a cryptodev instance with provided device type and

buffer sizes.

dts/tests/TestSuite_cryptodev_latency.py new file +25 -0
+        Verify:
+            * The latency is below or within delta of provided baseline.
+
+        Raises:
+            SkippedTestException: When configuration is not provided.
+        """
+        if "aesni_mb_vdev" not in self.latency_test_parameters:
+            skip("test not configured")
+        app = Cryptodev(
+            ptest=TestType.latency,
+            vdevs=[VirtualDevice("crypto_aesni_mb0")],
+            devtype=DeviceType.crypto_aesni_mb,
+            optype=OperationType.cipher_only,
+            cipher_algo=CipherAlgorithm.aes_cbc,
+            cipher_op=EncryptDecryptSwitch.encrypt,
+            cipher_key_sz=16,
+            cipher_iv_sz=16,
+            burst_sz=32,
+            total_ops=TOTAL_OPS,
+            buffer_sz=self.buffer_sizes["aesni_mb_vdev"],
+        )
+        results = self._verify_latency(app.run_app(), "aesni_mb_vdev")
+        self._print_stats(results)
+        for result in results:
+            verify(result["passed"] == "PASS", "Gbps fell below delta

tolerance")

dts/tests/TestSuite_cryptodev_latency.py new file +7 -0
+
+    @crypto_test
+    def kasumi_vdev(self) -> None:
+        """Kasumi vdev latency test.
+
+        Steps:
+            * Create a cryptodev instance with provided device type and

buffer sizes.

dts/tests/TestSuite_cryptodev_latency.py new file +29 -0
+        Verify:
+            * The latency is below or within delta of provided baseline.
+
+        Raises:
+            SkippedTestException: When configuration is not provided.
+        """
+        if "kasumi_vdev" not in self.latency_test_parameters:
+            skip("test not configured")
+        app = Cryptodev(
+            ptest=TestType.latency,
+            vdevs=[VirtualDevice("crypto_kasumi0")],
+            devtype=DeviceType.crypto_kasumi,
+            optype=OperationType.cipher_then_auth,
+            cipher_algo=CipherAlgorithm.kasumi_f8,
+            cipher_op=EncryptDecryptSwitch.encrypt,
+            cipher_key_sz=16,
+            cipher_iv_sz=8,
+            auth_algo=AuthenticationAlgorithm.kasumi_f9,
+            auth_op=AuthenticationOpMode.generate,
+            auth_key_sz=16,
+            digest_sz=4,
+            burst_sz=32,
+            total_ops=TOTAL_OPS,
+            buffer_sz=self.buffer_sizes["kasumi_vdev"],
+        )
+        results = self._verify_latency(app.run_app(), "kasmui_vdev")
+        self._print_stats(results)
+        for result in results:
+            verify(result["passed"] == "PASS", "Gbps fell below delta
Quoted 2 lines

tolerance")

Should this be latency instead of Gbps?

Quoted 34 lines
dts/tests/TestSuite_cryptodev_latency.py new file +7 -0
+
+    @crypto_test
+    def open_ssl_vdev(self) -> None:
+        """open_ssl vdev latency test.
+
+        Steps:
+            * Create a cryptodev instance with provided device type and

buffer sizes.

dts/tests/TestSuite_cryptodev_latency.py new file +26 -0
+        Verify:
+            * The latency is below or within delta of provided baseline.
+
+        Raises:
+            SkippedTestException: When configuration is not provided.
+        """
+        if "open_ssl_vdev" not in self.latency_test_parameters:
+            skip("test not configured")
+        app = Cryptodev(
+            ptest=TestType.latency,
+            vdevs=[VirtualDevice("crypto_openssl0")],
+            devtype=DeviceType.crypto_openssl,
+            optype=OperationType.aead,
+            aead_algo=AeadAlgName.aes_gcm,
+            aead_op=EncryptDecryptSwitch.encrypt,
+            aead_key_sz=16,
+            aead_iv_sz=16,
+            aead_aad_sz=16,
+            digest_sz=16,
+            total_ops=TOTAL_OPS,
+            buffer_sz=self.buffer_sizes["open_ssl_vdev"],
+        )
+        results = self._verify_latency(app.run_app(), "open_ssl_vdev")
+        self._print_stats(results)
+        for result in results:
+            verify(result["passed"] == "PASS", "Gbps fell below delta
Quoted 2 lines

tolerance")

Same

Quoted 38 lines
dts/tests/TestSuite_cryptodev_latency.py new file +7 -0
+
+    @crypto_test
+    def snow3g_vdev(self) -> None:
+        """snow3g vdev latency test.
+
+        Steps:
+            * Create a cryptodev instance with provided device type and

buffer sizes.

dts/tests/TestSuite_cryptodev_latency.py new file +30 -0
+        Verify:
+            * The latency is below or within delta of provided baseline.
+
+        Raises:
+            SkippedTestException: When configuration is not provided.
+        """
+        if "snow3g_vdev" not in self.latency_test_parameters:
+            skip("test not configured")
+        app = Cryptodev(
+            ptest=TestType.latency,
+            vdevs=[VirtualDevice("crypto_snow3g0")],
+            devtype=DeviceType.crypto_snow3g,
+            optype=OperationType.cipher_then_auth,
+            cipher_algo=CipherAlgorithm.snow3g_uea2,
+            cipher_op=EncryptDecryptSwitch.encrypt,
+            cipher_key_sz=16,
+            cipher_iv_sz=16,
+            auth_algo=AuthenticationAlgorithm.snow3g_uia2,
+            auth_op=AuthenticationOpMode.generate,
+            auth_key_sz=16,
+            auth_iv_sz=16,
+            digest_sz=16,
+            burst_sz=32,
+            total_ops=TOTAL_OPS,
+            buffer_sz=self.buffer_sizes["open_ssl_vdev"],
+        )
+        results = self._verify_latency(app.run_app(), "open_ssl_vdev")
+        self._print_stats(results)
+        for result in results:
+            verify(result["passed"] == "PASS", "Gbps fell below delta
Quoted 2 lines

tolerance")

Same

Quoted 38 lines
dts/tests/TestSuite_cryptodev_latency.py new file +7 -0
+
+    @crypto_test
+    def zuc_vdev(self) -> None:
+        """Zuc vdev latency test.
+
+        Steps:
+            * Create a cryptodev instance with provided device type and

buffer sizes.

dts/tests/TestSuite_cryptodev_latency.py new file +30 -0
+        Verify:
+            * The latency is below or within delta of provided baseline.
+
+        Raises:
+            SkippedTestException: When configuration is not provided.
+        """
+        if "zuc_vdev" not in self.latency_test_parameters:
+            skip("test not configured")
+        app = Cryptodev(
+            ptest=TestType.latency,
+            vdevs=[VirtualDevice("crypto_zuc0")],
+            devtype=DeviceType.crypto_zuc,
+            optype=OperationType.cipher_then_auth,
+            cipher_algo=CipherAlgorithm.zuc_eea3,
+            cipher_op=EncryptDecryptSwitch.encrypt,
+            cipher_key_sz=16,
+            cipher_iv_sz=16,
+            auth_algo=AuthenticationAlgorithm.zuc_eia3,
+            auth_op=AuthenticationOpMode.generate,
+            auth_key_sz=16,
+            auth_iv_sz=16,
+            digest_sz=4,
+            burst_sz=32,
+            total_ops=TOTAL_OPS,
+            buffer_sz=self.buffer_sizes["zuc_vdev"],
+        )
+        results = self._verify_latency(app.run_app(), "zuc_vdev")
+        self._print_stats(results)
+        for result in results:
+            verify(result["passed"] == "PASS", "Gbps fell below delta
Quoted 2 lines

tolerance")

Same

Quoted 4 lines

--
2.50.1

Make sure you also see the ai code review mention of kasumi and snow3g typo or misassignment
https://mails.dpdk.org/archives/test-report/2026-May/990932.html

The suggestions about safety when reading index 0 of a list are worth implementing too.

#6 lore raw

PATCH v2 1/2 dts: update parsing for cryptodev latency

In reply to Andrew Bailey

Previously, the parsing for cryptodev latency output would fail to parse due to an incorrect regex. This commit updates this regex to properly capture the burst size attribute for latency results.

Bugzilla ID: 1938

Fixes 8ee2df9da125 ("dts: add cryptodev package")
---
 dts/api/cryptodev/__init__.py | 3 +--
 dts/api/cryptodev/types.py    | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)
dts/api/cryptodev/__init__.py +1 -2
index a4fafc3713..15cffcb409 100644
@@ -117,7 +117,6 @@ def run_app(self, num_vfs: int = 1) -> list[CryptodevResults]:
                     f"dependencies missing for virtual device {self._app_params['vdevs'][0].name}"
                 )
             raise e
-
         regex = r"^\s+\d+.*$"
         parser_options = re.MULTILINE
         parser: type[CryptodevResults]
@@ -126,7 +125,7 @@ def run_app(self, num_vfs: int = 1) -> list[CryptodevResults]:
             case TestType.throughput:
                 parser = ThroughputResults
             case TestType.latency:
-                regex = r"total operations:.*time[^\n]*"
+                regex = r"total operations:.*?time[^\n]*"
                 parser_options |= re.DOTALL
                 parser = LatencyResults
             case TestType.pmd_cyclecount:
dts/api/cryptodev/types.py +2 -2
index df73a86fa4..7b4fd17cb6 100644
@@ -65,11 +65,11 @@ class LatencyResults(CryptodevResults):
 
     #: buffer size ran with app
     buffer_size: int = field(
-        metadata=TextParser.find_int(r"Buf(?:.*\n\s+\d+\s+)?(?:fer size:\s+)?(\d+)"),
+        metadata=TextParser.find_int(r"Buffer size:\s+(\d+)"),
     )
     #: burst size ran with app
     burst_size: int = field(
-        metadata=TextParser.find_int(rf"Burst(?:.*\n\s+\d+\s+){2}?(?: size:\s+)?(\d+)"),
+        metadata=TextParser.find_int(r"Burst size:\s+(\d+)"),
     )
     #: total operations ran
     total_ops: int = field(metadata=TextParser.find_int(r"total operations:\s+(\d+)"))
Signature · 1 line
2.54.0
#7 lore raw

PATCH v2 2/2 dts: add latency coverage for cryptodev testing

Currently, next DTS only has cryptodev testing coverage for throughput metrics. This patch adds a test suite to include latency testing for crypto devices.

---
 .../dts/tests.TestSuite_cryptodev_latency.rst |   8 +
 dts/tests/TestSuite_cryptodev_latency.py      | 718 ++++++++++++++++++
 2 files changed, 726 insertions(+)
 create mode 100644 doc/api/dts/tests.TestSuite_cryptodev_latency.rst
 create mode 100644 dts/tests/TestSuite_cryptodev_latency.py
doc/api/dts/tests.TestSuite_cryptodev_latency.rst new file +8 -0
new file mode 100644
index 0000000000..1bf4a0f4b0
@@ -0,0 +1,8 @@
+.. SPDX-License-Identifier: BSD-3-Clause
+
+cryptodev_latency Test Suite
+============================
+
+.. automodule:: tests.TestSuite_cryptodev_latency
+   :members:
+   :show-inheritance:
dts/tests/TestSuite_cryptodev_latency.py new file +718 -0

718 lines not on this page · raw message

Signature · 1 line
2.54.0
Applied
#8 lore raw

Re: [PATCH v2 2/2] dts: add latency coverage for cryptodev testing

Applied to next-dts, thanks Andrew.