* Test function that determines how long an enqueue + dequeue of a burst * takes on available lcores. */
| 4955 | * takes on available lcores. |
| 4956 | */ |
| 4957 | static int |
| 4958 | throughput_test(struct active_device *ad, |
| 4959 | struct test_op_params *op_params) |
| 4960 | { |
| 4961 | int ret; |
| 4962 | unsigned int lcore_id, used_cores = 0; |
| 4963 | struct thread_params *t_params, *tp; |
| 4964 | struct rte_bbdev_info info; |
| 4965 | lcore_function_t *throughput_function; |
| 4966 | uint16_t num_lcores; |
| 4967 | const char *op_type_str; |
| 4968 | |
| 4969 | rte_bbdev_info_get(ad->dev_id, &info); |
| 4970 | |
| 4971 | op_type_str = rte_bbdev_op_type_str(test_vector.op_type); |
| 4972 | TEST_ASSERT_NOT_NULL(op_type_str, "Invalid op type: %u", |
| 4973 | test_vector.op_type); |
| 4974 | |
| 4975 | printf("+ ------------------------------------------------------- +\n"); |
| 4976 | printf("== test: throughput\ndev: %s, nb_queues: %u, burst size: %u, num ops: %u, num_lcores: %u, op type: %s, itr mode: %s, GHz: %lg\n", |
| 4977 | info.dev_name, ad->nb_queues, op_params->burst_sz, |
| 4978 | op_params->num_to_process, op_params->num_lcores, |
| 4979 | op_type_str, |
| 4980 | intr_enabled ? "Interrupt mode" : "PMD mode", |
| 4981 | (double)rte_get_tsc_hz() / 1000000000.0); |
| 4982 | |
| 4983 | /* Set number of lcores */ |
| 4984 | num_lcores = (ad->nb_queues < (op_params->num_lcores)) |
| 4985 | ? ad->nb_queues |
| 4986 | : op_params->num_lcores; |
| 4987 | |
| 4988 | /* Allocate memory for thread parameters structure */ |
| 4989 | t_params = rte_zmalloc(NULL, num_lcores * sizeof(struct thread_params), |
| 4990 | RTE_CACHE_LINE_SIZE); |
| 4991 | TEST_ASSERT_NOT_NULL(t_params, "Failed to alloc %zuB for t_params", |
| 4992 | RTE_ALIGN(sizeof(struct thread_params) * num_lcores, |
| 4993 | RTE_CACHE_LINE_SIZE)); |
| 4994 | |
| 4995 | if (intr_enabled) { |
| 4996 | if (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC) |
| 4997 | throughput_function = throughput_intr_lcore_dec; |
| 4998 | else if (test_vector.op_type == RTE_BBDEV_OP_LDPC_DEC) |
| 4999 | throughput_function = throughput_intr_lcore_ldpc_dec; |
| 5000 | else if (test_vector.op_type == RTE_BBDEV_OP_TURBO_ENC) |
| 5001 | throughput_function = throughput_intr_lcore_enc; |
| 5002 | else if (test_vector.op_type == RTE_BBDEV_OP_LDPC_ENC) |
| 5003 | throughput_function = throughput_intr_lcore_ldpc_enc; |
| 5004 | else if (test_vector.op_type == RTE_BBDEV_OP_FFT) |
| 5005 | throughput_function = throughput_intr_lcore_fft; |
| 5006 | else if (test_vector.op_type == RTE_BBDEV_OP_MLDTS) |
| 5007 | throughput_function = throughput_intr_lcore_mldts; |
| 5008 | else |
| 5009 | throughput_function = throughput_intr_lcore_enc; |
| 5010 | |
| 5011 | /* Dequeue interrupt callback registration */ |
| 5012 | ret = rte_bbdev_callback_register(ad->dev_id, |
| 5013 | RTE_BBDEV_EVENT_DEQUEUE, dequeue_event_callback, |
| 5014 | t_params); |
nothing calls this directly
no test coverage detected