[PATCH v1 2/2] dts: add latency coverage for cryptodev testing
Patrick Robb
patrickrobb1997 at gmail.com
Thu Jun 25 16:17:09 CEST 2026
On Wed, May 13, 2026 at 11:27 AM Andrew Bailey <abailey at iol.unh.edu> wrote:
> Currently, next DTS only has cryptodev testing coverage for throughput
> metrics. This patch adds a test suite to include latency testing for
> crypto devices.
>
> Signed-off-by: Andrew Bailey <abailey at iol.unh.edu>
> ---
> .../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
>
>
> + @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.
> + 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
> the delta tolerance")
>
Why this one does not have "below baseline" in the string like other verify
assertions in this suite?
> +
> + @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.
> + 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:
> + 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")
> + self._print_stats(results)
> + for result in results:
> + verify(
> + result["passed"] == "PASS",
> + "latency fell more than the delta tolerance below
> baseline",
> + )
> +
> + @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.
> + 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")
> +
> + @crypto_test
> + def kasumi_vdev(self) -> None:
> + """Kasumi vdev latency test.
> +
> + Steps:
> + * Create a cryptodev instance with provided device type and
> buffer sizes.
> + 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
> tolerance")
>
Should this be latency instead of Gbps?
> +
> + @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.
> + 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
> tolerance")
>
Same
> +
> + @crypto_test
> + def snow3g_vdev(self) -> None:
> + """snow3g vdev latency test.
> +
> + Steps:
> + * Create a cryptodev instance with provided device type and
> buffer sizes.
> + 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
> tolerance")
>
Same
> +
> + @crypto_test
> + def zuc_vdev(self) -> None:
> + """Zuc vdev latency test.
> +
> + Steps:
> + * Create a cryptodev instance with provided device type and
> buffer sizes.
> + 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
> tolerance")
>
Same
> --
> 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.
Reviewed-by: Patrick Robb <patrickrobb1997 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20260625/0820c9c7/attachment-0001.htm>
More information about the dev
mailing list