X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-eventdev%2Ftest_perf_atq.c;h=67ff681666943d420b87d36cbde7091a84454626;hb=a538d1d2d01e85429e7dd011806b52250d37c5dc;hp=73f31e564ae3c69e08d6639ae32ebbe9005b9bda;hpb=66b82db2ef7af55601165b944959645d77ee1f3c;p=dpdk.git diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c index 73f31e564a..67ff681666 100644 --- a/app/test-eventdev/test_perf_atq.c +++ b/app/test-eventdev/test_perf_atq.c @@ -14,7 +14,7 @@ atq_nb_event_queues(struct evt_options *opt) rte_eth_dev_count_avail() : evt_nr_active_lcores(opt->plcores); } -static inline __attribute__((always_inline)) void +static __rte_always_inline void atq_mark_fwd_latency(struct rte_event *const ev) { if (unlikely(ev->sub_event_type == 0)) { @@ -24,7 +24,7 @@ atq_mark_fwd_latency(struct rte_event *const ev) } } -static inline __attribute__((always_inline)) void +static __rte_always_inline void atq_fwd_event(struct rte_event *const ev, uint8_t *const sched_type_list, const uint8_t nb_stages) { @@ -48,6 +48,22 @@ perf_atq_worker(void *arg, const int enable_fwd_latency) continue; } + if (prod_crypto_type && + (ev.event_type == RTE_EVENT_TYPE_CRYPTODEV)) { + struct rte_crypto_op *op = ev.event_ptr; + + if (op->status == RTE_CRYPTO_OP_STATUS_SUCCESS) { + if (op->sym->m_dst == NULL) + ev.event_ptr = op->sym->m_src; + else + ev.event_ptr = op->sym->m_dst; + rte_crypto_op_free(op); + } else { + rte_crypto_op_free(op); + continue; + } + } + if (enable_fwd_latency && !prod_timer_type) /* first stage in pipeline, mark ts to compute fwd latency */ atq_mark_fwd_latency(&ev); @@ -87,6 +103,25 @@ perf_atq_worker_burst(void *arg, const int enable_fwd_latency) } for (i = 0; i < nb_rx; i++) { + if (prod_crypto_type && + (ev[i].event_type == RTE_EVENT_TYPE_CRYPTODEV)) { + struct rte_crypto_op *op = ev[i].event_ptr; + + if (op->status == + RTE_CRYPTO_OP_STATUS_SUCCESS) { + if (op->sym->m_dst == NULL) + ev[i].event_ptr = + op->sym->m_src; + else + ev[i].event_ptr = + op->sym->m_dst; + rte_crypto_op_free(op); + } else { + rte_crypto_op_free(op); + continue; + } + } + if (enable_fwd_latency && !prod_timer_type) { rte_prefetch0(ev[i+1].event_ptr); /* first stage in pipeline. @@ -175,18 +210,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt) return ret; } - const struct rte_event_dev_config config = { - .nb_event_queues = nb_queues, - .nb_event_ports = nb_ports, - .nb_events_limit = dev_info.max_num_events, - .nb_event_queue_flows = opt->nb_flows, - .nb_event_port_dequeue_depth = - dev_info.max_event_port_dequeue_depth, - .nb_event_port_enqueue_depth = - dev_info.max_event_port_enqueue_depth, - }; - - ret = rte_event_dev_configure(opt->dev_id, &config); + ret = evt_configure_eventdev(opt, nb_queues, nb_ports); if (ret) { evt_err("failed to configure eventdev %d", opt->dev_id); return ret; @@ -265,6 +289,18 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt) return ret; } } + } else if (opt->prod_type == EVT_PROD_TYPE_EVENT_CRYPTO_ADPTR) { + uint8_t cdev_id, cdev_count; + + cdev_count = rte_cryptodev_count(); + for (cdev_id = 0; cdev_id < cdev_count; cdev_id++) { + ret = rte_cryptodev_start(cdev_id); + if (ret) { + evt_err("Failed to start cryptodev %u", + cdev_id); + return ret; + } + } } return 0; @@ -306,12 +342,14 @@ static const struct evt_test_ops perf_atq = { .opt_dump = perf_atq_opt_dump, .test_setup = perf_test_setup, .ethdev_setup = perf_ethdev_setup, + .cryptodev_setup = perf_cryptodev_setup, .mempool_setup = perf_mempool_setup, .eventdev_setup = perf_atq_eventdev_setup, .launch_lcores = perf_atq_launch_lcores, .eventdev_destroy = perf_eventdev_destroy, .mempool_destroy = perf_mempool_destroy, .ethdev_destroy = perf_ethdev_destroy, + .cryptodev_destroy = perf_cryptodev_destroy, .test_result = perf_test_result, .test_destroy = perf_test_destroy, };