app/bbdev: enhance interrupt test
[dpdk.git] / app / test-bbdev / test_bbdev_perf.c
index a25e3a7..1c4a645 100644 (file)
@@ -77,13 +77,17 @@ struct test_op_params {
 struct thread_params {
        uint8_t dev_id;
        uint16_t queue_id;
+       uint32_t lcore_id;
        uint64_t start_time;
        double ops_per_sec;
        double mbps;
        uint8_t iter_count;
        rte_atomic16_t nb_dequeued;
        rte_atomic16_t processing_status;
+       rte_atomic16_t burst_sz;
        struct test_op_params *op_params;
+       struct rte_bbdev_dec_op *dec_ops[MAX_BURST];
+       struct rte_bbdev_enc_op *enc_ops[MAX_BURST];
 };
 
 #ifdef RTE_BBDEV_OFFLOAD_COST
@@ -113,6 +117,17 @@ struct test_time_stats {
 typedef int (test_case_function)(struct active_device *ad,
                struct test_op_params *op_params);
 
+static inline void
+mbuf_reset(struct rte_mbuf *m)
+{
+       m->pkt_len = 0;
+
+       do {
+               m->data_len = 0;
+               m = m->next;
+       } while (m != NULL);
+}
+
 static inline void
 set_avail_op(struct active_device *ad, enum rte_bbdev_op_type op_type)
 {
@@ -573,6 +588,10 @@ init_op_data_objs(struct rte_bbdev_op_data *bufs,
                                op_type, n * ref_entries->nb_segments,
                                mbuf_pool->size);
 
+               TEST_ASSERT_SUCCESS(((seg->length + RTE_PKTMBUF_HEADROOM) >
+                               (uint32_t)UINT16_MAX),
+                               "Given data is bigger than allowed mbuf segment size");
+
                bufs[i].data = m_head;
                bufs[i].offset = 0;
                bufs[i].length = 0;
@@ -589,7 +608,6 @@ init_op_data_objs(struct rte_bbdev_op_data *bufs,
                        rte_memcpy(data, seg->addr, seg->length);
                        bufs[i].length += seg->length;
 
-
                        for (j = 1; j < ref_entries->nb_segments; ++j) {
                                struct rte_mbuf *m_tail =
                                                rte_pktmbuf_alloc(mbuf_pool);
@@ -617,6 +635,24 @@ init_op_data_objs(struct rte_bbdev_op_data *bufs,
                                                "Couldn't chain mbufs from %d data type mbuf pool",
                                                op_type);
                        }
+
+               } else {
+
+                       /* allocate chained-mbuf for output buffer */
+                       for (j = 1; j < ref_entries->nb_segments; ++j) {
+                               struct rte_mbuf *m_tail =
+                                               rte_pktmbuf_alloc(mbuf_pool);
+                               TEST_ASSERT_NOT_NULL(m_tail,
+                                               "Not enough mbufs in %d data type mbuf pool (needed %u, available %u)",
+                                               op_type,
+                                               n * ref_entries->nb_segments,
+                                               mbuf_pool->size);
+
+                               ret = rte_pktmbuf_chain(m_head, m_tail);
+                               TEST_ASSERT_SUCCESS(ret,
+                                               "Couldn't chain mbufs from %d data type mbuf pool",
+                                               op_type);
+                       }
                }
        }
 
@@ -655,7 +691,7 @@ limit_input_llr_val_range(struct rte_bbdev_op_data *input_ops,
                while (m != NULL) {
                        int8_t *llr = rte_pktmbuf_mtod_offset(m, int8_t *,
                                        input_ops[i].offset);
-                       for (byte_idx = 0; byte_idx < input_ops[i].length;
+                       for (byte_idx = 0; byte_idx < rte_pktmbuf_data_len(m);
                                        ++byte_idx)
                                llr[byte_idx] = round((double)max_llr_modulus *
                                                llr[byte_idx] / INT8_MAX);
@@ -864,15 +900,18 @@ validate_op_chain(struct rte_bbdev_op_data *op,
        uint8_t i;
        struct rte_mbuf *m = op->data;
        uint8_t nb_dst_segments = orig_op->nb_segments;
+       uint32_t total_data_size = 0;
 
        TEST_ASSERT(nb_dst_segments == m->nb_segs,
                        "Number of segments differ in original (%u) and filled (%u) op",
                        nb_dst_segments, m->nb_segs);
 
+       /* Validate each mbuf segment length */
        for (i = 0; i < nb_dst_segments; ++i) {
                /* Apply offset to the first mbuf segment */
                uint16_t offset = (i == 0) ? op->offset : 0;
-               uint16_t data_len = m->data_len - offset;
+               uint16_t data_len = rte_pktmbuf_data_len(m) - offset;
+               total_data_size += orig_op->segments[i].length;
 
                TEST_ASSERT(orig_op->segments[i].length == data_len,
                                "Length of segment differ in original (%u) and filled (%u) op",
@@ -884,6 +923,12 @@ validate_op_chain(struct rte_bbdev_op_data *op,
                m = m->next;
        }
 
+       /* Validate total mbuf pkt length */
+       uint32_t pkt_len = rte_pktmbuf_pkt_len(op->data) - op->offset;
+       TEST_ASSERT(total_data_size == pkt_len,
+                       "Length of data differ in original (%u) and filled (%u) op",
+                       total_data_size, pkt_len);
+
        return TEST_SUCCESS;
 }
 
@@ -1165,16 +1210,12 @@ dequeue_event_callback(uint16_t dev_id,
        uint16_t i;
        uint64_t total_time;
        uint16_t deq, burst_sz, num_ops;
-       uint16_t queue_id = INVALID_QUEUE_ID;
-       struct rte_bbdev_dec_op *dec_ops[MAX_BURST];
-       struct rte_bbdev_enc_op *enc_ops[MAX_BURST];
+       uint16_t queue_id = *(uint16_t *) ret_param;
        struct rte_bbdev_info info;
 
        double tb_len_bits;
 
        struct thread_params *tp = cb_arg;
-       RTE_SET_USED(ret_param);
-       queue_id = tp->queue_id;
 
        /* Find matching thread params using queue_id */
        for (i = 0; i < MAX_QUEUES; ++i, ++tp)
@@ -1194,18 +1235,19 @@ dequeue_event_callback(uint16_t dev_id,
                return;
        }
 
-       burst_sz = tp->op_params->burst_sz;
+       burst_sz = rte_atomic16_read(&tp->burst_sz);
        num_ops = tp->op_params->num_to_process;
 
-       if (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC) {
-               deq = rte_bbdev_dequeue_dec_ops(dev_id, queue_id, dec_ops,
+       if (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC)
+               deq = rte_bbdev_dequeue_dec_ops(dev_id, queue_id,
+                               &tp->dec_ops[
+                                       rte_atomic16_read(&tp->nb_dequeued)],
                                burst_sz);
-               rte_bbdev_dec_op_free_bulk(dec_ops, deq);
-       } else {
-               deq = rte_bbdev_dequeue_enc_ops(dev_id, queue_id, enc_ops,
+       else
+               deq = rte_bbdev_dequeue_enc_ops(dev_id, queue_id,
+                               &tp->enc_ops[
+                                       rte_atomic16_read(&tp->nb_dequeued)],
                                burst_sz);
-               rte_bbdev_enc_op_free_bulk(enc_ops, deq);
-       }
 
        if (deq < burst_sz) {
                printf(
@@ -1228,13 +1270,18 @@ dequeue_event_callback(uint16_t dev_id,
 
        if (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC) {
                struct rte_bbdev_dec_op *ref_op = tp->op_params->ref_dec_op;
-               ret = validate_dec_op(dec_ops, num_ops, ref_op,
+               ret = validate_dec_op(tp->dec_ops, num_ops, ref_op,
                                tp->op_params->vector_mask);
-               rte_bbdev_dec_op_free_bulk(dec_ops, deq);
+               /* get the max of iter_count for all dequeued ops */
+               for (i = 0; i < num_ops; ++i)
+                       tp->iter_count = RTE_MAX(
+                                       tp->dec_ops[i]->turbo_dec.iter_count,
+                                       tp->iter_count);
+               rte_bbdev_dec_op_free_bulk(tp->dec_ops, deq);
        } else if (test_vector.op_type == RTE_BBDEV_OP_TURBO_ENC) {
                struct rte_bbdev_enc_op *ref_op = tp->op_params->ref_enc_op;
-               ret = validate_enc_op(enc_ops, num_ops, ref_op);
-               rte_bbdev_enc_op_free_bulk(enc_ops, deq);
+               ret = validate_enc_op(tp->enc_ops, num_ops, ref_op);
+               rte_bbdev_enc_op_free_bulk(tp->enc_ops, deq);
        }
 
        if (ret) {
@@ -1258,9 +1305,9 @@ dequeue_event_callback(uint16_t dev_id,
                return;
        }
 
-       tp->ops_per_sec = ((double)num_ops) /
+       tp->ops_per_sec += ((double)num_ops) /
                        ((double)total_time / (double)rte_get_tsc_hz());
-       tp->mbps = (((double)(num_ops * tb_len_bits)) / 1000000.0) /
+       tp->mbps += (((double)(num_ops * tb_len_bits)) / 1000000.0) /
                        ((double)total_time / (double)rte_get_tsc_hz());
 
        rte_atomic16_add(&tp->nb_dequeued, deq);
@@ -1277,8 +1324,8 @@ throughput_intr_lcore_dec(void *arg)
        struct rte_bbdev_dec_op *ops[num_to_process];
        struct test_buffers *bufs = NULL;
        struct rte_bbdev_info info;
-       int ret;
-       uint16_t num_to_enq;
+       int ret, i, j;
+       uint16_t num_to_enq, enq;
 
        TEST_ASSERT_SUCCESS((burst_sz > MAX_BURST),
                        "BURST_SIZE should be <= %u", MAX_BURST);
@@ -1310,16 +1357,47 @@ throughput_intr_lcore_dec(void *arg)
                                bufs->hard_outputs, bufs->soft_outputs,
                                tp->op_params->ref_dec_op);
 
-       tp->start_time = rte_rdtsc_precise();
-       for (enqueued = 0; enqueued < num_to_process;) {
+       /* Set counter to validate the ordering */
+       for (j = 0; j < num_to_process; ++j)
+               ops[j]->opaque_data = (void *)(uintptr_t)j;
 
-               num_to_enq = burst_sz;
+       for (j = 0; j < TEST_REPETITIONS; ++j) {
+               for (i = 0; i < num_to_process; ++i)
+                       rte_pktmbuf_reset(ops[i]->turbo_dec.hard_output.data);
 
-               if (unlikely(num_to_process - enqueued < num_to_enq))
-                       num_to_enq = num_to_process - enqueued;
+               tp->start_time = rte_rdtsc_precise();
+               for (enqueued = 0; enqueued < num_to_process;) {
+                       num_to_enq = burst_sz;
 
-               enqueued += rte_bbdev_enqueue_dec_ops(tp->dev_id, queue_id,
-                               &ops[enqueued], num_to_enq);
+                       if (unlikely(num_to_process - enqueued < num_to_enq))
+                               num_to_enq = num_to_process - enqueued;
+
+                       enq = 0;
+                       do {
+                               enq += rte_bbdev_enqueue_dec_ops(tp->dev_id,
+                                       queue_id, &ops[enqueued],
+                                       num_to_enq);
+                       } while (unlikely(num_to_enq != enq));
+                       enqueued += enq;
+
+                       /* Write to thread burst_sz current number of enqueued
+                        * descriptors. It ensures that proper number of
+                        * descriptors will be dequeued in callback
+                        * function - needed for last batch in case where
+                        * the number of operations is not a multiple of
+                        * burst size.
+                        */
+                       rte_atomic16_set(&tp->burst_sz, num_to_enq);
+
+                       /* Wait until processing of previous batch is
+                        * completed.
+                        */
+                       while (rte_atomic16_read(&tp->nb_dequeued) !=
+                                       (int16_t) enqueued)
+                               rte_pause();
+               }
+               if (j != TEST_REPETITIONS - 1)
+                       rte_atomic16_clear(&tp->nb_dequeued);
        }
 
        return TEST_SUCCESS;
@@ -1336,8 +1414,8 @@ throughput_intr_lcore_enc(void *arg)
        struct rte_bbdev_enc_op *ops[num_to_process];
        struct test_buffers *bufs = NULL;
        struct rte_bbdev_info info;
-       int ret;
-       uint16_t num_to_enq;
+       int ret, i, j;
+       uint16_t num_to_enq, enq;
 
        TEST_ASSERT_SUCCESS((burst_sz > MAX_BURST),
                        "BURST_SIZE should be <= %u", MAX_BURST);
@@ -1368,16 +1446,47 @@ throughput_intr_lcore_enc(void *arg)
                copy_reference_enc_op(ops, num_to_process, 0, bufs->inputs,
                                bufs->hard_outputs, tp->op_params->ref_enc_op);
 
-       tp->start_time = rte_rdtsc_precise();
-       for (enqueued = 0; enqueued < num_to_process;) {
+       /* Set counter to validate the ordering */
+       for (j = 0; j < num_to_process; ++j)
+               ops[j]->opaque_data = (void *)(uintptr_t)j;
+
+       for (j = 0; j < TEST_REPETITIONS; ++j) {
+               for (i = 0; i < num_to_process; ++i)
+                       rte_pktmbuf_reset(ops[i]->turbo_enc.output.data);
 
-               num_to_enq = burst_sz;
+               tp->start_time = rte_rdtsc_precise();
+               for (enqueued = 0; enqueued < num_to_process;) {
+                       num_to_enq = burst_sz;
 
-               if (unlikely(num_to_process - enqueued < num_to_enq))
-                       num_to_enq = num_to_process - enqueued;
+                       if (unlikely(num_to_process - enqueued < num_to_enq))
+                               num_to_enq = num_to_process - enqueued;
+
+                       enq = 0;
+                       do {
+                               enq += rte_bbdev_enqueue_enc_ops(tp->dev_id,
+                                               queue_id, &ops[enqueued],
+                                               num_to_enq);
+                       } while (unlikely(enq != num_to_enq));
+                       enqueued += enq;
+
+                       /* Write to thread burst_sz current number of enqueued
+                        * descriptors. It ensures that proper number of
+                        * descriptors will be dequeued in callback
+                        * function - needed for last batch in case where
+                        * the number of operations is not a multiple of
+                        * burst size.
+                        */
+                       rte_atomic16_set(&tp->burst_sz, num_to_enq);
 
-               enqueued += rte_bbdev_enqueue_enc_ops(tp->dev_id, queue_id,
-                               &ops[enqueued], num_to_enq);
+                       /* Wait until processing of previous batch is
+                        * completed.
+                        */
+                       while (rte_atomic16_read(&tp->nb_dequeued) !=
+                                       (int16_t) enqueued)
+                               rte_pause();
+               }
+               if (j != TEST_REPETITIONS - 1)
+                       rte_atomic16_clear(&tp->nb_dequeued);
        }
 
        return TEST_SUCCESS;
@@ -1427,10 +1536,8 @@ throughput_pmd_lcore_dec(void *arg)
 
        for (i = 0; i < TEST_REPETITIONS; ++i) {
 
-               for (j = 0; j < num_ops; ++j) {
-                       struct rte_bbdev_dec_op *op = ops_enq[j];
-                       rte_pktmbuf_reset(op->turbo_dec.hard_output.data);
-               }
+               for (j = 0; j < num_ops; ++j)
+                       mbuf_reset(ops_enq[j]->turbo_dec.hard_output.data);
 
                start_time = rte_rdtsc_precise();
 
@@ -1529,8 +1636,7 @@ throughput_pmd_lcore_enc(void *arg)
 
                if (test_vector.op_type != RTE_BBDEV_OP_NONE)
                        for (j = 0; j < num_ops; ++j)
-                               rte_pktmbuf_reset(
-                                       ops_enq[j]->turbo_enc.output.data);
+                               mbuf_reset(ops_enq[j]->turbo_enc.output.data);
 
                start_time = rte_rdtsc_precise();
 
@@ -1575,18 +1681,16 @@ throughput_pmd_lcore_enc(void *arg)
 static void
 print_enc_throughput(struct thread_params *t_params, unsigned int used_cores)
 {
-       unsigned int lcore_id, iter = 0;
+       unsigned int iter = 0;
        double total_mops = 0, total_mbps = 0;
 
-       RTE_LCORE_FOREACH(lcore_id) {
-               if (iter++ >= used_cores)
-                       break;
+       for (iter = 0; iter < used_cores; iter++) {
                printf(
-                               "Throughput for core (%u): %.8lg Ops/s, %.8lg Mbps\n",
-                               lcore_id, t_params[lcore_id].ops_per_sec,
-                               t_params[lcore_id].mbps);
-               total_mops += t_params[lcore_id].ops_per_sec;
-               total_mbps += t_params[lcore_id].mbps;
+                       "Throughput for core (%u): %.8lg Ops/s, %.8lg Mbps\n",
+                       t_params[iter].lcore_id, t_params[iter].ops_per_sec,
+                       t_params[iter].mbps);
+               total_mops += t_params[iter].ops_per_sec;
+               total_mbps += t_params[iter].mbps;
        }
        printf(
                "\nTotal throughput for %u cores: %.8lg MOPS, %.8lg Mbps\n",
@@ -1596,21 +1700,18 @@ print_enc_throughput(struct thread_params *t_params, unsigned int used_cores)
 static void
 print_dec_throughput(struct thread_params *t_params, unsigned int used_cores)
 {
-       unsigned int lcore_id, iter = 0;
+       unsigned int iter = 0;
        double total_mops = 0, total_mbps = 0;
        uint8_t iter_count = 0;
 
-       RTE_LCORE_FOREACH(lcore_id) {
-               if (iter++ >= used_cores)
-                       break;
+       for (iter = 0; iter < used_cores; iter++) {
                printf(
-                               "Throughput for core (%u): %.8lg Ops/s, %.8lg Mbps @ max %u iterations\n",
-                               lcore_id, t_params[lcore_id].ops_per_sec,
-                               t_params[lcore_id].mbps,
-                               t_params[lcore_id].iter_count);
-               total_mops += t_params[lcore_id].ops_per_sec;
-               total_mbps += t_params[lcore_id].mbps;
-               iter_count = RTE_MAX(iter_count, t_params[lcore_id].iter_count);
+                       "Throughput for core (%u): %.8lg Ops/s, %.8lg Mbps @ max %u iterations\n",
+                       t_params[iter].lcore_id, t_params[iter].ops_per_sec,
+                       t_params[iter].mbps, t_params[iter].iter_count);
+               total_mops += t_params[iter].ops_per_sec;
+               total_mbps += t_params[iter].mbps;
+               iter_count = RTE_MAX(iter_count, t_params[iter].iter_count);
        }
        printf(
                "\nTotal throughput for %u cores: %.8lg MOPS, %.8lg Mbps @ max %u iterations\n",
@@ -1627,10 +1728,9 @@ throughput_test(struct active_device *ad,
 {
        int ret;
        unsigned int lcore_id, used_cores = 0;
-       struct thread_params t_params[MAX_QUEUES];
+       struct thread_params *t_params, *tp;
        struct rte_bbdev_info info;
        lcore_function_t *throughput_function;
-       struct thread_params *tp;
        uint16_t num_lcores;
        const char *op_type_str;
 
@@ -1653,6 +1753,13 @@ throughput_test(struct active_device *ad,
                        ? ad->nb_queues
                        : op_params->num_lcores;
 
+       /* Allocate memory for thread parameters structure */
+       t_params = rte_zmalloc(NULL, num_lcores * sizeof(struct thread_params),
+                       RTE_CACHE_LINE_SIZE);
+       TEST_ASSERT_NOT_NULL(t_params, "Failed to alloc %zuB for t_params",
+                       RTE_ALIGN(sizeof(struct thread_params) * num_lcores,
+                               RTE_CACHE_LINE_SIZE));
+
        if (intr_enabled) {
                if (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC)
                        throughput_function = throughput_intr_lcore_dec;
@@ -1662,9 +1769,11 @@ throughput_test(struct active_device *ad,
                /* Dequeue interrupt callback registration */
                ret = rte_bbdev_callback_register(ad->dev_id,
                                RTE_BBDEV_EVENT_DEQUEUE, dequeue_event_callback,
-                               &t_params);
-               if (ret < 0)
+                               t_params);
+               if (ret < 0) {
+                       rte_free(t_params);
                        return ret;
+               }
        } else {
                if (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC)
                        throughput_function = throughput_pmd_lcore_dec;
@@ -1674,38 +1783,39 @@ throughput_test(struct active_device *ad,
 
        rte_atomic16_set(&op_params->sync, SYNC_WAIT);
 
-       t_params[rte_lcore_id()].dev_id = ad->dev_id;
-       t_params[rte_lcore_id()].op_params = op_params;
-       t_params[rte_lcore_id()].queue_id =
-                       ad->queue_ids[used_cores++];
+       /* Master core is set at first entry */
+       t_params[0].dev_id = ad->dev_id;
+       t_params[0].lcore_id = rte_lcore_id();
+       t_params[0].op_params = op_params;
+       t_params[0].queue_id = ad->queue_ids[used_cores++];
+       t_params[0].iter_count = 0;
 
        RTE_LCORE_FOREACH_SLAVE(lcore_id) {
                if (used_cores >= num_lcores)
                        break;
 
-               t_params[lcore_id].dev_id = ad->dev_id;
-               t_params[lcore_id].op_params = op_params;
-               t_params[lcore_id].queue_id = ad->queue_ids[used_cores++];
+               t_params[used_cores].dev_id = ad->dev_id;
+               t_params[used_cores].lcore_id = lcore_id;
+               t_params[used_cores].op_params = op_params;
+               t_params[used_cores].queue_id = ad->queue_ids[used_cores];
+               t_params[used_cores].iter_count = 0;
 
-               rte_eal_remote_launch(throughput_function, &t_params[lcore_id],
-                               lcore_id);
+               rte_eal_remote_launch(throughput_function,
+                               &t_params[used_cores++], lcore_id);
        }
 
        rte_atomic16_set(&op_params->sync, SYNC_START);
-       ret = throughput_function(&t_params[rte_lcore_id()]);
+       ret = throughput_function(&t_params[0]);
 
        /* Master core is always used */
-       used_cores = 1;
-       RTE_LCORE_FOREACH_SLAVE(lcore_id) {
-               if (used_cores++ >= num_lcores)
-                       break;
-
-               ret |= rte_eal_wait_lcore(lcore_id);
-       }
+       for (used_cores = 1; used_cores < num_lcores; used_cores++)
+               ret |= rte_eal_wait_lcore(t_params[used_cores].lcore_id);
 
        /* Return if test failed */
-       if (ret)
+       if (ret) {
+               rte_free(t_params);
                return ret;
+       }
 
        /* Print throughput if interrupts are disabled and test passed */
        if (!intr_enabled) {
@@ -1713,6 +1823,7 @@ throughput_test(struct active_device *ad,
                        print_dec_throughput(t_params, num_lcores);
                else
                        print_enc_throughput(t_params, num_lcores);
+               rte_free(t_params);
                return ret;
        }
 
@@ -1721,21 +1832,20 @@ throughput_test(struct active_device *ad,
         * error using processing_status variable.
         * Wait for master lcore operations.
         */
-       tp = &t_params[rte_lcore_id()];
+       tp = &t_params[0];
        while ((rte_atomic16_read(&tp->nb_dequeued) <
                        op_params->num_to_process) &&
                        (rte_atomic16_read(&tp->processing_status) !=
                        TEST_FAILED))
                rte_pause();
 
+       tp->ops_per_sec /= TEST_REPETITIONS;
+       tp->mbps /= TEST_REPETITIONS;
        ret |= rte_atomic16_read(&tp->processing_status);
 
        /* Wait for slave lcores operations */
-       used_cores = 1;
-       RTE_LCORE_FOREACH_SLAVE(lcore_id) {
-               tp = &t_params[lcore_id];
-               if (used_cores++ >= num_lcores)
-                       break;
+       for (used_cores = 1; used_cores < num_lcores; used_cores++) {
+               tp = &t_params[used_cores];
 
                while ((rte_atomic16_read(&tp->nb_dequeued) <
                                op_params->num_to_process) &&
@@ -1743,6 +1853,8 @@ throughput_test(struct active_device *ad,
                                TEST_FAILED))
                        rte_pause();
 
+               tp->ops_per_sec /= TEST_REPETITIONS;
+               tp->mbps /= TEST_REPETITIONS;
                ret |= rte_atomic16_read(&tp->processing_status);
        }
 
@@ -1753,6 +1865,8 @@ throughput_test(struct active_device *ad,
                else if (test_vector.op_type == RTE_BBDEV_OP_TURBO_ENC)
                        print_enc_throughput(t_params, num_lcores);
        }
+
+       rte_free(t_params);
        return ret;
 }
 
@@ -2025,7 +2139,7 @@ offload_latency_test_dec(struct rte_mempool *mempool, struct test_buffers *bufs,
                time_st->enq_acc_total_time += stats.acc_offload_cycles;
 
                /* ensure enqueue has been completed */
-               rte_delay_ms(10);
+               rte_delay_us(200);
 
                /* Start time meas for dequeue function offload latency */
                deq_start_time = rte_rdtsc_precise();
@@ -2106,7 +2220,7 @@ offload_latency_test_enc(struct rte_mempool *mempool, struct test_buffers *bufs,
                time_st->enq_acc_total_time += stats.acc_offload_cycles;
 
                /* ensure enqueue has been completed */
-               rte_delay_ms(10);
+               rte_delay_us(200);
 
                /* Start time meas for dequeue function offload latency */
                deq_start_time = rte_rdtsc_precise();