Common function for running validation and latency test cases */
| 5595 | |
| 5596 | /* Common function for running validation and latency test cases */ |
| 5597 | static int |
| 5598 | validation_latency_test(struct active_device *ad, |
| 5599 | struct test_op_params *op_params, bool latency_flag) |
| 5600 | { |
| 5601 | int iter; |
| 5602 | uint16_t burst_sz = op_params->burst_sz; |
| 5603 | const uint16_t num_to_process = op_params->num_to_process; |
| 5604 | const enum rte_bbdev_op_type op_type = test_vector.op_type; |
| 5605 | const uint16_t queue_id = ad->queue_ids[0]; |
| 5606 | struct test_buffers *bufs = NULL; |
| 5607 | struct rte_bbdev_info info; |
| 5608 | uint64_t total_time, min_time, max_time; |
| 5609 | const char *op_type_str; |
| 5610 | |
| 5611 | total_time = max_time = 0; |
| 5612 | min_time = UINT64_MAX; |
| 5613 | |
| 5614 | TEST_ASSERT_SUCCESS((burst_sz > MAX_BURST), |
| 5615 | "BURST_SIZE should be <= %u", MAX_BURST); |
| 5616 | |
| 5617 | rte_bbdev_info_get(ad->dev_id, &info); |
| 5618 | bufs = &op_params->q_bufs[GET_SOCKET(info.socket_id)][queue_id]; |
| 5619 | |
| 5620 | op_type_str = rte_bbdev_op_type_str(op_type); |
| 5621 | TEST_ASSERT_NOT_NULL(op_type_str, "Invalid op type: %u", op_type); |
| 5622 | |
| 5623 | printf("+ ------------------------------------------------------- +\n"); |
| 5624 | if (latency_flag) |
| 5625 | printf("== test: latency\ndev:"); |
| 5626 | else |
| 5627 | printf("== test: validation\ndev:"); |
| 5628 | printf("%s, burst size: %u, num ops: %u, op type: %s\n", |
| 5629 | info.dev_name, burst_sz, num_to_process, op_type_str); |
| 5630 | |
| 5631 | if (op_type == RTE_BBDEV_OP_TURBO_DEC) |
| 5632 | iter = latency_test_dec(op_params->mp, bufs, |
| 5633 | op_params->ref_dec_op, ad->dev_id, queue_id, |
| 5634 | num_to_process, burst_sz, &total_time, |
| 5635 | &min_time, &max_time, latency_flag); |
| 5636 | else if (op_type == RTE_BBDEV_OP_LDPC_ENC) |
| 5637 | iter = latency_test_ldpc_enc(op_params->mp, bufs, |
| 5638 | op_params->ref_enc_op, ad->dev_id, queue_id, |
| 5639 | num_to_process, burst_sz, &total_time, |
| 5640 | &min_time, &max_time); |
| 5641 | else if (op_type == RTE_BBDEV_OP_LDPC_DEC) |
| 5642 | iter = latency_test_ldpc_dec(op_params->mp, bufs, |
| 5643 | op_params->ref_dec_op, op_params->vector_mask, |
| 5644 | ad->dev_id, queue_id, num_to_process, |
| 5645 | burst_sz, &total_time, &min_time, &max_time, |
| 5646 | latency_flag); |
| 5647 | else if (op_type == RTE_BBDEV_OP_FFT) |
| 5648 | iter = latency_test_fft(op_params->mp, bufs, |
| 5649 | op_params->ref_fft_op, |
| 5650 | ad->dev_id, queue_id, |
| 5651 | num_to_process, burst_sz, &total_time, |
| 5652 | &min_time, &max_time); |
| 5653 | else if (op_type == RTE_BBDEV_OP_MLDTS) |
| 5654 | iter = latency_test_mldts(op_params->mp, bufs, |
no test coverage detected