From: Nicolas Chautru Date: Thu, 26 Mar 2020 03:27:47 +0000 (-0700) Subject: app/bbdev: support offload test for LDPC X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6e024c4b918a292312fcf96d7148c7863a65d9ee;p=dpdk.git app/bbdev: support offload test for LDPC Adding support for the offload latency tests when using the LDPC encoder and decoder operations. Signed-off-by: Nicolas Chautru Acked-by: Dave Burley Acked-by: Akhil Goyal --- diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index c45cdd2600..6ec17e5066 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -4643,7 +4643,7 @@ static int offload_latency_empty_q_test_dec(uint16_t dev_id, uint16_t queue_id, const uint16_t num_to_process, uint16_t burst_sz, uint64_t *deq_total_time, uint64_t *deq_min_time, - uint64_t *deq_max_time) + uint64_t *deq_max_time, const enum rte_bbdev_op_type op_type) { int i, deq_total; struct rte_bbdev_dec_op *ops[MAX_BURST]; @@ -4657,7 +4657,12 @@ offload_latency_empty_q_test_dec(uint16_t dev_id, uint16_t queue_id, if (unlikely(num_to_process - deq_total < burst_sz)) burst_sz = num_to_process - deq_total; - rte_bbdev_dequeue_dec_ops(dev_id, queue_id, ops, burst_sz); + if (op_type == RTE_BBDEV_OP_LDPC_DEC) + rte_bbdev_dequeue_ldpc_dec_ops(dev_id, queue_id, ops, + burst_sz); + else + rte_bbdev_dequeue_dec_ops(dev_id, queue_id, ops, + burst_sz); deq_last_time = rte_rdtsc_precise() - deq_start_time; *deq_max_time = RTE_MAX(*deq_max_time, deq_last_time); @@ -4672,7 +4677,7 @@ static int offload_latency_empty_q_test_enc(uint16_t dev_id, uint16_t queue_id, const uint16_t num_to_process, uint16_t burst_sz, uint64_t *deq_total_time, uint64_t *deq_min_time, - uint64_t *deq_max_time) + uint64_t *deq_max_time, const enum rte_bbdev_op_type op_type) { int i, deq_total; struct rte_bbdev_enc_op *ops[MAX_BURST]; @@ -4685,7 +4690,12 @@ offload_latency_empty_q_test_enc(uint16_t dev_id, uint16_t queue_id, if (unlikely(num_to_process - deq_total < burst_sz)) burst_sz = num_to_process - deq_total; - rte_bbdev_dequeue_enc_ops(dev_id, queue_id, ops, burst_sz); + if (op_type == RTE_BBDEV_OP_LDPC_ENC) + rte_bbdev_dequeue_ldpc_enc_ops(dev_id, queue_id, ops, + burst_sz); + else + rte_bbdev_dequeue_enc_ops(dev_id, queue_id, ops, + burst_sz); deq_last_time = rte_rdtsc_precise() - deq_start_time; *deq_max_time = RTE_MAX(*deq_max_time, deq_last_time); @@ -4695,6 +4705,7 @@ offload_latency_empty_q_test_enc(uint16_t dev_id, uint16_t queue_id, return i; } + #endif static int @@ -4732,14 +4743,15 @@ offload_latency_empty_q_test(struct active_device *ad, printf("== test: offload latency empty dequeue\ndev: %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) + if (op_type == RTE_BBDEV_OP_TURBO_DEC || + op_type == RTE_BBDEV_OP_LDPC_DEC) iter = offload_latency_empty_q_test_dec(ad->dev_id, queue_id, num_to_process, burst_sz, &deq_total_time, - &deq_min_time, &deq_max_time); + &deq_min_time, &deq_max_time, op_type); else iter = offload_latency_empty_q_test_enc(ad->dev_id, queue_id, num_to_process, burst_sz, &deq_total_time, - &deq_min_time, &deq_max_time); + &deq_min_time, &deq_max_time, op_type); if (iter <= 0) return TEST_FAILED;