On Mon, Mar 2, 2026 at 1:55 PM Andrew Bailey <[email protected]> wrote:
>
>
> +config_list: list[dict[str, int | float | str]] = [
> +    {"buff_size": 64, "Gbps": 1.00},
> +    {"buff_size": 512, "Gbps": 1.00},
> +    {"buff_size": 2048, "Gbps": 1.00},

Either Gbps needs to become gbps or the gbps field from
tests_config.example.yaml needs to be updated.

> +]
> +
> +TOTAL_OPS = 10_000_000
> +
> +
> +class Config(BaseConfig):
> +    """Performance test metrics.
> +
> +    Attributes:
> +        delta_tolerance: The allowed tolerance below a given baseline.
> +        throughput_test_parameters: The test parameters to use in the test 
> suite.
> +    """
> +
> +    delta_tolerance: float = 0.05
> +
> +    throughput_test_parameters: dict[str, list[dict[str, int | float | 
> str]]] = {
> +        "aes_cbc": config_list,
> +        "aes_cbc_sha1": config_list,
> +        "aes_cbc_sha2": config_list,
> +        "aes_cbc_sha2_digest_16": config_list,
> +        "aead_aes_gcm": config_list,
> +        "aes_docsisbpi": config_list,
> +        "sha1_hmac": config_list,
> +        "snow3g_uea2_snow3g_uia2": config_list,
> +        "zuc_eea3_zuc_eia3": config_list,
> +        "kasumi_f8_kasumi_f9": config_list,
> +        "open_ssl_vdev": config_list,
> +        "aesni_mb_vdev": config_list,
> +        "aesni_gcm_vdev": config_list,
> +        "kasumi_vdev": config_list,
> +        "zuc_vdev": config_list,
> +        "snow3g_vdev": config_list,
> +    }
> +
> +
> +@requires_link_topology(LinkTopology.NO_LINK)
> +class TestCryptodevThroughput(TestSuite):
> +    """DPDK Crypto Device Testing Suite."""
> +
> +    config: Config
> +
> +    def set_up_suite(self) -> None:
> +        """Set up the test suite."""
> +        self.throughput_test_parameters: dict[str, list[dict[str, int | 
> float | str]]] = (
> +            self.config.throughput_test_parameters
> +        )
> +        self.delta_tolerance: float = self.config.delta_tolerance
> +        self.driver: DeviceType | None = get_device_from_str(
> +            str(get_ctx().sut_node.crypto_device_type)
> +        )
> +        self.buffer_sizes = {}
> +
> +        for k, v in self.throughput_test_parameters.items():
> +            self.buffer_sizes[k] = ListWrapper([int(run["buff_size"]) for 
> run in v])
> +
> +    def _print_stats(self, test_vals: list[dict[str, int | float | str]]) -> 
> None:
> +        element_len = len("Delta Tolerance")
> +        border_len = (element_len + 1) * (len(test_vals[0]))
> +
> +        print(f"{'Throughput Results'.center(border_len)}\n{'=' * 
> border_len}")
> +        for k, v in test_vals[0].items():
> +            print(f"|{k.title():<{element_len}}", end="")
> +        print(f"|\n{'='*border_len}")
> +
> +        for test_val in test_vals:
> +            for k, v in test_val.items():
> +                print(f"|{v:<{element_len}}", end="")
> +            print(f"|\n{'='*border_len}")
> +
> +    def _verify_throughput(
> +        self,
> +        results: list[CryptodevResults],
> +        key: str,
> +    ) -> list[dict[str, int | float | str]]:
> +        result_list: list[dict[str, int | float | str]] = []
> +
> +        for result in results:
> +            # get the corresponding baseline for the current buffer size
> +            parameters: dict[str, int | float | str] = list(
> +                filter(
> +                    lambda x: x["buff_size"] == result.buffer_size,
> +                    self.throughput_test_parameters[key],
> +                )
> +            )[0]
> +            test_result = True
> +            expected_gbps = parameters["Gbps"]

Gbps <-> gbps misalignment with tests_config.example.yaml

Reply via email to