return i;
}
+/* Test case for latency/validation for LDPC Decoder */
static int
latency_test_ldpc_dec(struct rte_mempool *mempool,
struct test_buffers *bufs, struct rte_bbdev_dec_op *ref_op,
int vector_mask, uint16_t dev_id, uint16_t queue_id,
const uint16_t num_to_process, uint16_t burst_sz,
- uint64_t *total_time, uint64_t *min_time, uint64_t *max_time)
+ uint64_t *total_time, uint64_t *min_time, uint64_t *max_time,
+ bool disable_et)
{
int ret = TEST_SUCCESS;
uint16_t i, j, dequeued;
"rte_bbdev_dec_op_alloc_bulk() failed");
/* For latency tests we need to disable early termination */
- if (check_bit(ref_op->ldpc_dec.op_flags,
+ if (disable_et && check_bit(ref_op->ldpc_dec.op_flags,
RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE))
ref_op->ldpc_dec.op_flags -=
RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE;
return i;
}
+/* Common function for running validation and latency test cases */
static int
-latency_test(struct active_device *ad,
- struct test_op_params *op_params)
+validation_latency_test(struct active_device *ad,
+ struct test_op_params *op_params, bool latency_flag)
{
int iter;
uint16_t burst_sz = op_params->burst_sz;
TEST_ASSERT_NOT_NULL(op_type_str, "Invalid op type: %u", op_type);
printf("+ ------------------------------------------------------- +\n");
- printf("== test: validation/latency\ndev: %s, burst size: %u, num ops: %u, op type: %s\n",
+ if (latency_flag)
+ printf("== test: latency\ndev:");
+ else
+ printf("== test: validation\ndev:");
+ printf("%s, burst size: %u, num ops: %u, op type: %s\n",
info.dev_name, burst_sz, num_to_process, op_type_str);
if (op_type == RTE_BBDEV_OP_TURBO_DEC)
op_params->ref_dec_op, op_params->vector_mask,
ad->dev_id, queue_id, num_to_process,
burst_sz, &total_time, &min_time, &max_time);
- else if (op_type == RTE_BBDEV_OP_TURBO_ENC)
- iter = latency_test_enc(op_params->mp, bufs,
- op_params->ref_enc_op, ad->dev_id, queue_id,
- num_to_process, burst_sz, &total_time,
- &min_time, &max_time);
else if (op_type == RTE_BBDEV_OP_LDPC_ENC)
iter = latency_test_ldpc_enc(op_params->mp, bufs,
op_params->ref_enc_op, ad->dev_id, queue_id,
iter = latency_test_ldpc_dec(op_params->mp, bufs,
op_params->ref_dec_op, op_params->vector_mask,
ad->dev_id, queue_id, num_to_process,
- burst_sz, &total_time, &min_time, &max_time);
- else
+ burst_sz, &total_time, &min_time, &max_time,
+ latency_flag);
+ else /* RTE_BBDEV_OP_TURBO_ENC */
iter = latency_test_enc(op_params->mp, bufs,
- op_params->ref_enc_op,
- ad->dev_id, queue_id,
- num_to_process, burst_sz, &total_time,
- &min_time, &max_time);
+ op_params->ref_enc_op,
+ ad->dev_id, queue_id,
+ num_to_process, burst_sz, &total_time,
+ &min_time, &max_time);
if (iter <= 0)
return TEST_FAILED;
return TEST_SUCCESS;
}
+static int
+latency_test(struct active_device *ad, struct test_op_params *op_params)
+{
+ return validation_latency_test(ad, op_params, true);
+}
+
+static int
+validation_test(struct active_device *ad, struct test_op_params *op_params)
+{
+ return validation_latency_test(ad, op_params, false);
+}
+
#ifdef RTE_BBDEV_OFFLOAD_COST
static int
get_bbdev_queue_stats(uint16_t dev_id, uint16_t queue_id,
return run_test_case(latency_test);
}
+static int
+validation_tc(void)
+{
+ return run_test_case(validation_test);
+}
+
static int
interrupt_tc(void)
{
.setup = testsuite_setup,
.teardown = testsuite_teardown,
.unit_test_cases = {
- TEST_CASE_ST(ut_setup, ut_teardown, latency_tc),
+ TEST_CASE_ST(ut_setup, ut_teardown, validation_tc),
TEST_CASES_END() /**< NULL terminate unit test array */
}
};