MCPcopy Create free account
hub / github.com/F-Stack/f-stack / latency_test_dec

Function latency_test_dec

dpdk/app/test-bbdev/test_bbdev_perf.c:5128–5206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5126}
5127
5128static int
5129latency_test_dec(struct rte_mempool *mempool,
5130 struct test_buffers *bufs, struct rte_bbdev_dec_op *ref_op,
5131 uint16_t dev_id, uint16_t queue_id,
5132 const uint16_t num_to_process, uint16_t burst_sz,
5133 uint64_t *total_time, uint64_t *min_time, uint64_t *max_time, bool disable_et)
5134{
5135 int ret = TEST_SUCCESS;
5136 uint16_t i, j, dequeued;
5137 struct rte_bbdev_dec_op *ops_enq[MAX_BURST], *ops_deq[MAX_BURST];
5138 uint64_t start_time = 0, last_time = 0;
5139
5140 for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
5141 uint16_t enq = 0, deq = 0;
5142 uint32_t time_out = 0;
5143 bool first_time = true;
5144 last_time = 0;
5145
5146 if (unlikely(num_to_process - dequeued < burst_sz))
5147 burst_sz = num_to_process - dequeued;
5148
5149 ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
5150 TEST_ASSERT_SUCCESS(ret, "rte_bbdev_dec_op_alloc_bulk() failed");
5151
5152 ref_op->turbo_dec.iter_max = get_iter_max();
5153 /* For validation tests we want to enable early termination */
5154 if (!disable_et && !check_bit(ref_op->turbo_dec.op_flags,
5155 RTE_BBDEV_TURBO_EARLY_TERMINATION))
5156 ref_op->turbo_dec.op_flags |= RTE_BBDEV_TURBO_EARLY_TERMINATION;
5157
5158 if (test_vector.op_type != RTE_BBDEV_OP_NONE)
5159 copy_reference_dec_op(ops_enq, burst_sz, dequeued,
5160 bufs->inputs,
5161 bufs->hard_outputs,
5162 bufs->soft_outputs,
5163 ref_op);
5164
5165 /* Set counter to validate the ordering */
5166 for (j = 0; j < burst_sz; ++j)
5167 ops_enq[j]->opaque_data = (void *)(uintptr_t)j;
5168
5169 start_time = rte_rdtsc_precise();
5170
5171 enq = rte_bbdev_enqueue_dec_ops(dev_id, queue_id, &ops_enq[enq],
5172 burst_sz);
5173 TEST_ASSERT(enq == burst_sz,
5174 "Error enqueueing burst, expected %u, got %u",
5175 burst_sz, enq);
5176
5177 /* Dequeue */
5178 do {
5179 deq += rte_bbdev_dequeue_dec_ops(dev_id, queue_id,
5180 &ops_deq[deq], burst_sz - deq);
5181 if (likely(first_time && (deq > 0))) {
5182 last_time = rte_rdtsc_precise() - start_time;
5183 first_time = false;
5184 }
5185 time_out++;

Callers 1

validation_latency_testFunction · 0.85

Calls 10

get_iter_maxFunction · 0.85
copy_reference_dec_opFunction · 0.85
timeout_exitFunction · 0.85
check_bitFunction · 0.70
validate_dec_opFunction · 0.70
rte_rdtsc_preciseFunction · 0.50

Tested by

no test coverage detected