* Test function that determines BLER wireless performance */
| 4857 | * Test function that determines BLER wireless performance |
| 4858 | */ |
| 4859 | static int |
| 4860 | bler_test(struct active_device *ad, |
| 4861 | struct test_op_params *op_params) |
| 4862 | { |
| 4863 | int ret; |
| 4864 | unsigned int lcore_id, used_cores = 0; |
| 4865 | struct thread_params *t_params; |
| 4866 | struct rte_bbdev_info info; |
| 4867 | lcore_function_t *bler_function; |
| 4868 | uint16_t num_lcores; |
| 4869 | const char *op_type_str; |
| 4870 | |
| 4871 | rte_bbdev_info_get(ad->dev_id, &info); |
| 4872 | |
| 4873 | op_type_str = rte_bbdev_op_type_str(test_vector.op_type); |
| 4874 | TEST_ASSERT_NOT_NULL(op_type_str, "Invalid op type: %u", |
| 4875 | test_vector.op_type); |
| 4876 | |
| 4877 | printf("+ ------------------------------------------------------- +\n"); |
| 4878 | printf("== test: bler\ndev: %s, nb_queues: %u, burst size: %u, num ops: %u, num_lcores: %u, op type: %s, itr mode: %s, GHz: %lg\n", |
| 4879 | info.dev_name, ad->nb_queues, op_params->burst_sz, |
| 4880 | op_params->num_to_process, op_params->num_lcores, |
| 4881 | op_type_str, |
| 4882 | intr_enabled ? "Interrupt mode" : "PMD mode", |
| 4883 | (double)rte_get_tsc_hz() / 1000000000.0); |
| 4884 | |
| 4885 | /* Set number of lcores */ |
| 4886 | num_lcores = (ad->nb_queues < (op_params->num_lcores)) |
| 4887 | ? ad->nb_queues |
| 4888 | : op_params->num_lcores; |
| 4889 | |
| 4890 | /* Allocate memory for thread parameters structure */ |
| 4891 | t_params = rte_zmalloc(NULL, num_lcores * sizeof(struct thread_params), |
| 4892 | RTE_CACHE_LINE_SIZE); |
| 4893 | TEST_ASSERT_NOT_NULL(t_params, "Failed to alloc %zuB for t_params", |
| 4894 | RTE_ALIGN(sizeof(struct thread_params) * num_lcores, |
| 4895 | RTE_CACHE_LINE_SIZE)); |
| 4896 | |
| 4897 | if ((test_vector.op_type == RTE_BBDEV_OP_LDPC_DEC) && |
| 4898 | !check_bit(test_vector.ldpc_dec.op_flags, |
| 4899 | RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_LOOPBACK) |
| 4900 | && !check_bit(test_vector.ldpc_dec.op_flags, |
| 4901 | RTE_BBDEV_LDPC_LLR_COMPRESSION)) |
| 4902 | bler_function = bler_pmd_lcore_ldpc_dec; |
| 4903 | else if ((test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC) && |
| 4904 | !check_bit(test_vector.turbo_dec.op_flags, |
| 4905 | RTE_BBDEV_TURBO_SOFT_OUTPUT)) |
| 4906 | bler_function = bler_pmd_lcore_turbo_dec; |
| 4907 | else |
| 4908 | return TEST_SKIPPED; |
| 4909 | |
| 4910 | __atomic_store_n(&op_params->sync, SYNC_WAIT, __ATOMIC_RELAXED); |
| 4911 | |
| 4912 | /* Main core is set at first entry */ |
| 4913 | t_params[0].dev_id = ad->dev_id; |
| 4914 | t_params[0].lcore_id = rte_lcore_id(); |
| 4915 | t_params[0].op_params = op_params; |
| 4916 | t_params[0].queue_id = ad->queue_ids[used_cores++]; |
nothing calls this directly
no test coverage detected