diff mbox series

app/eventdev: add option to set global dequeue tmo

Message ID 20190319061845.12343-1-pbhagavatula@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers show
Series app/eventdev: add option to set global dequeue tmo | expand

Checks

Context Check Description
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Pavan Nikhilesh Bhagavatula March 19, 2019, 6:21 a.m. UTC
From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add option to provide a global dequeue timeout that is used to create
the eventdev.
The dequeue timeout provided will be common across all the worker
ports. If the eventdev hardware supports power management through
dequeue timeout then this option can be used for verifying power
demands at various packet rates.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 app/test-eventdev/evt_options.c         | 13 +++++++++++++
 app/test-eventdev/evt_options.h         |  2 ++
 app/test-eventdev/test_order_atq.c      |  1 +
 app/test-eventdev/test_order_queue.c    |  1 +
 app/test-eventdev/test_perf_atq.c       |  1 +
 app/test-eventdev/test_perf_queue.c     |  1 +
 app/test-eventdev/test_pipeline_atq.c   |  1 +
 app/test-eventdev/test_pipeline_queue.c |  1 +
 8 files changed, 21 insertions(+)

Comments

Jerin Jacob Kollanukkaran March 19, 2019, 9:45 a.m. UTC | #1
On Tue, 2019-03-19 at 06:21 +0000, Pavan Nikhilesh Bhagavatula wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Add option to provide a global dequeue timeout that is used to create
> the eventdev.
> The dequeue timeout provided will be common across all the worker
> ports. If the eventdev hardware supports power management through
> dequeue timeout then this option can be used for verifying power
> demands at various packet rates.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

1) Please update the doc/guides/tools/testeventdev.rst for new
commandline option
2) Instead of driver returns the error for unsupported timeout value,
Does it makes sense to clamp up or down the value based on
struct rte_event_dev_info::min_dequeue_timeout_ns
struct rte_event_dev_info::max_dequeue_timeout_ns
Pavan Nikhilesh Bhagavatula March 25, 2019, 9:47 a.m. UTC | #2
> -----Original Message-----
> From: Jerin Jacob Kollanukkaran
> Sent: Tuesday, March 19, 2019 3:16 PM
> To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] app/eventdev: add option to set global
> dequeue tmo
> 
> On Tue, 2019-03-19 at 06:21 +0000, Pavan Nikhilesh Bhagavatula wrote:
> > From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >
> > Add option to provide a global dequeue timeout that is used to create
> > the eventdev.
> > The dequeue timeout provided will be common across all the worker
> > ports. If the eventdev hardware supports power management through
> > dequeue timeout then this option can be used for verifying power
> > demands at various packet rates.
> >
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> 1) Please update the doc/guides/tools/testeventdev.rst for new
> commandline option

Will update in v2

> 2) Instead of driver returns the error for unsupported timeout value, Does it
> makes sense to clamp up or down the value based on struct
> rte_event_dev_info::min_dequeue_timeout_ns
> struct rte_event_dev_info::max_dequeue_timeout_ns

Will do this in v2.

> 
>
diff mbox series

Patch

diff --git a/app/test-eventdev/evt_options.c b/app/test-eventdev/evt_options.c
index cfa43a165..af5c08bac 100644
--- a/app/test-eventdev/evt_options.c
+++ b/app/test-eventdev/evt_options.c
@@ -84,6 +84,16 @@  evt_parse_queue_priority(struct evt_options *opt, const char *arg __rte_unused)
 	return 0;
 }
 
+static int
+evt_parse_deq_tmo_nsec(struct evt_options *opt, const char *arg)
+{
+	int ret;
+
+	ret = parser_read_uint32(&(opt->deq_tmo_nsec), arg);
+
+	return ret;
+}
+
 static int
 evt_parse_eth_prod_type(struct evt_options *opt, const char *arg __rte_unused)
 {
@@ -240,6 +250,7 @@  usage(char *program)
 		"\t--worker_deq_depth : dequeue depth of the worker\n"
 		"\t--fwd_latency      : perform fwd_latency measurement\n"
 		"\t--queue_priority   : enable queue priority\n"
+		"\t--deq_tmo_nsec     : global dequeue timeout\n"
 		"\t--prod_type_ethdev : use ethernet device as producer.\n"
 		"\t--prod_type_timerdev : use event timer device as producer.\n"
 		"\t                     expity_nsec would be the timeout\n"
@@ -311,6 +322,7 @@  static struct option lgopts[] = {
 	{ EVT_SCHED_TYPE_LIST,     1, 0, 0 },
 	{ EVT_FWD_LATENCY,         0, 0, 0 },
 	{ EVT_QUEUE_PRIORITY,      0, 0, 0 },
+	{ EVT_DEQ_TMO_NSEC,        1, 0, 0 },
 	{ EVT_PROD_ETHDEV,         0, 0, 0 },
 	{ EVT_PROD_TIMERDEV,       0, 0, 0 },
 	{ EVT_PROD_TIMERDEV_BURST, 0, 0, 0 },
@@ -342,6 +354,7 @@  evt_opts_parse_long(int opt_idx, struct evt_options *opt)
 		{ EVT_SCHED_TYPE_LIST, evt_parse_sched_type_list},
 		{ EVT_FWD_LATENCY, evt_parse_fwd_latency},
 		{ EVT_QUEUE_PRIORITY, evt_parse_queue_priority},
+		{ EVT_DEQ_TMO_NSEC, evt_parse_deq_tmo_nsec},
 		{ EVT_PROD_ETHDEV, evt_parse_eth_prod_type},
 		{ EVT_PROD_TIMERDEV, evt_parse_timer_prod_type},
 		{ EVT_PROD_TIMERDEV_BURST, evt_parse_timer_prod_type_burst},
diff --git a/app/test-eventdev/evt_options.h b/app/test-eventdev/evt_options.h
index f3de48a17..c486c4185 100644
--- a/app/test-eventdev/evt_options.h
+++ b/app/test-eventdev/evt_options.h
@@ -31,6 +31,7 @@ 
 #define EVT_SCHED_TYPE_LIST      ("stlist")
 #define EVT_FWD_LATENCY          ("fwd_latency")
 #define EVT_QUEUE_PRIORITY       ("queue_priority")
+#define EVT_DEQ_TMO_NSEC         ("deq_tmo_nsec")
 #define EVT_PROD_ETHDEV          ("prod_type_ethdev")
 #define EVT_PROD_TIMERDEV        ("prod_type_timerdev")
 #define EVT_PROD_TIMERDEV_BURST  ("prod_type_timerdev_burst")
@@ -71,6 +72,7 @@  struct evt_options {
 	uint8_t dev_id;
 	uint32_t fwd_latency:1;
 	uint32_t q_priority:1;
+	uint32_t deq_tmo_nsec;
 	enum evt_prod_type prod_type;
 	uint8_t timdev_use_burst;
 	uint8_t timdev_cnt;
diff --git a/app/test-eventdev/test_order_atq.c b/app/test-eventdev/test_order_atq.c
index 4a8546e7f..94e51161a 100644
--- a/app/test-eventdev/test_order_atq.c
+++ b/app/test-eventdev/test_order_atq.c
@@ -119,6 +119,7 @@  order_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	const uint8_t nb_ports = nb_workers + 1;
 
 	const struct rte_event_dev_config config = {
+			.dequeue_timeout_ns = opt->deq_tmo_nsec,
 			.nb_event_queues = NB_QUEUES,/* one all types queue */
 			.nb_event_ports = nb_ports,
 			.nb_events_limit  = 4096,
diff --git a/app/test-eventdev/test_order_queue.c b/app/test-eventdev/test_order_queue.c
index a272c7a57..f643fc64a 100644
--- a/app/test-eventdev/test_order_queue.c
+++ b/app/test-eventdev/test_order_queue.c
@@ -119,6 +119,7 @@  order_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	const uint8_t nb_ports = nb_workers + 1;
 
 	const struct rte_event_dev_config config = {
+			.dequeue_timeout_ns = opt->deq_tmo_nsec,
 			.nb_event_queues = NB_QUEUES,/* q0 ordered, q1 atomic */
 			.nb_event_ports = nb_ports,
 			.nb_events_limit  = 4096,
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index 73f31e564..9cb1dd344 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -176,6 +176,7 @@  perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	}
 
 	const struct rte_event_dev_config config = {
+			.dequeue_timeout_ns = opt->deq_tmo_nsec,
 			.nb_event_queues = nb_queues,
 			.nb_event_ports = nb_ports,
 			.nb_events_limit  = dev_info.max_num_events,
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index d89491364..50cd51b07 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -177,6 +177,7 @@  perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	}
 
 	const struct rte_event_dev_config config = {
+			.dequeue_timeout_ns = opt->deq_tmo_nsec,
 			.nb_event_queues = nb_queues,
 			.nb_event_ports = nb_ports,
 			.nb_events_limit  = dev_info.max_num_events,
diff --git a/app/test-eventdev/test_pipeline_atq.c b/app/test-eventdev/test_pipeline_atq.c
index 998a56cfd..0b7f92f95 100644
--- a/app/test-eventdev/test_pipeline_atq.c
+++ b/app/test-eventdev/test_pipeline_atq.c
@@ -315,6 +315,7 @@  pipeline_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	rte_event_dev_info_get(opt->dev_id, &info);
 
 	const struct rte_event_dev_config config = {
+		.dequeue_timeout_ns = opt->deq_tmo_nsec,
 		.nb_event_queues = nb_queues,
 		.nb_event_ports = nb_ports,
 		.nb_events_limit  = info.max_num_events,
diff --git a/app/test-eventdev/test_pipeline_queue.c b/app/test-eventdev/test_pipeline_queue.c
index 7da89dad5..31f3dbad9 100644
--- a/app/test-eventdev/test_pipeline_queue.c
+++ b/app/test-eventdev/test_pipeline_queue.c
@@ -335,6 +335,7 @@  pipeline_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 
 	rte_event_dev_info_get(opt->dev_id, &info);
 	const struct rte_event_dev_config config = {
+			.dequeue_timeout_ns = opt->deq_tmo_nsec,
 			.nb_event_queues = nb_queues,
 			.nb_event_ports = nb_ports,
 			.nb_events_limit  = info.max_num_events,