From 452cd797f08b7d1b1bb787273a32fe402d1a0db1 Mon Sep 17 00:00:00 2001 From: Pavan Nikhilesh Date: Thu, 28 Dec 2017 16:26:53 +0530 Subject: [PATCH] app/eventdev: fix event device queue count Fix the event device queue count reported when producer type is Rx adapter for perfomance queue and atq test. Fixes: 20eb154e0435 ("app/testeventdev: add perf queue test") Signed-off-by: Pavan Nikhilesh Acked-by: Jerin Jacob --- app/test-eventdev/test_perf_atq.c | 6 +++--- app/test-eventdev/test_perf_queue.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c index 5a48ffdcf9..d07a054254 100644 --- a/app/test-eventdev/test_perf_atq.c +++ b/app/test-eventdev/test_perf_atq.c @@ -10,7 +10,8 @@ static inline int atq_nb_event_queues(struct evt_options *opt) { /* nb_queues = number of producers */ - return evt_nr_active_lcores(opt->plcores); + return opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? + rte_eth_dev_count() : evt_nr_active_lcores(opt->plcores); } static inline __attribute__((always_inline)) void @@ -165,8 +166,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt) nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 : evt_nr_active_lcores(opt->plcores); - nb_queues = opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? - rte_eth_dev_count() : atq_nb_event_queues(opt); + nb_queues = atq_nb_event_queues(opt); memset(&dev_info, 0, sizeof(struct rte_event_dev_info)); ret = rte_event_dev_info_get(opt->dev_id, &dev_info); diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c index 63379ce616..d5b8908761 100644 --- a/app/test-eventdev/test_perf_queue.c +++ b/app/test-eventdev/test_perf_queue.c @@ -10,7 +10,9 @@ static inline int perf_queue_nb_event_queues(struct evt_options *opt) { /* nb_queues = number of producers * number of stages */ - return evt_nr_active_lcores(opt->plcores) * opt->nb_stages; + uint8_t nb_prod = opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? + rte_eth_dev_count() : evt_nr_active_lcores(opt->plcores); + return nb_prod * opt->nb_stages; } static inline __attribute__((always_inline)) void @@ -162,9 +164,7 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt) nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 : evt_nr_active_lcores(opt->plcores); - nb_queues = opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? - rte_eth_dev_count() * nb_stages : - perf_queue_nb_event_queues(opt); + nb_queues = perf_queue_nb_event_queues(opt); memset(&dev_info, 0, sizeof(struct rte_event_dev_info)); ret = rte_event_dev_info_get(opt->dev_id, &dev_info); @@ -196,7 +196,7 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt) .nb_atomic_order_sequences = opt->nb_flows, }; /* queue configurations */ - for (queue = 0; queue < perf_queue_nb_event_queues(opt); queue++) { + for (queue = 0; queue < nb_queues; queue++) { q_conf.schedule_type = (opt->sched_type_list[queue % nb_stages]); -- 2.20.1