DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/eventdev: add option to set global dequeue tmo
@ 2019-03-19  6:21 Pavan Nikhilesh Bhagavatula
  2019-03-19  6:21 ` Pavan Nikhilesh Bhagavatula
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-03-19  6:21 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran; +Cc: dev, Pavan Nikhilesh Bhagavatula

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(+)

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,
-- 
2.21.0

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [dpdk-dev] [PATCH] app/eventdev: add option to set global dequeue tmo
  2019-03-19  6:21 [dpdk-dev] [PATCH] app/eventdev: add option to set global dequeue tmo Pavan Nikhilesh Bhagavatula
@ 2019-03-19  6:21 ` Pavan Nikhilesh Bhagavatula
  2019-03-19  9:45 ` Jerin Jacob Kollanukkaran
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 16+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-03-19  6:21 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran; +Cc: dev, Pavan Nikhilesh Bhagavatula

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(+)

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,
-- 
2.21.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH] app/eventdev: add option to set global dequeue tmo
  2019-03-19  6:21 [dpdk-dev] [PATCH] app/eventdev: add option to set global dequeue tmo Pavan Nikhilesh Bhagavatula
  2019-03-19  6:21 ` Pavan Nikhilesh Bhagavatula
@ 2019-03-19  9:45 ` Jerin Jacob Kollanukkaran
  2019-03-19  9:45   ` Jerin Jacob Kollanukkaran
  2019-03-25  9:47   ` Pavan Nikhilesh Bhagavatula
  2019-03-27 17:07 ` [dpdk-dev] [PATCH v2] " Pavan Nikhilesh Bhagavatula
  2019-03-29  7:11 ` [dpdk-dev] [PATCH v3] " Pavan Nikhilesh Bhagavatula
  3 siblings, 2 replies; 16+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-03-19  9:45 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula; +Cc: dev

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




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH] app/eventdev: add option to set global dequeue tmo
  2019-03-19  9:45 ` Jerin Jacob Kollanukkaran
@ 2019-03-19  9:45   ` Jerin Jacob Kollanukkaran
  2019-03-25  9:47   ` Pavan Nikhilesh Bhagavatula
  1 sibling, 0 replies; 16+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-03-19  9:45 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula; +Cc: dev

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




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH] app/eventdev: add option to set global dequeue tmo
  2019-03-19  9:45 ` Jerin Jacob Kollanukkaran
  2019-03-19  9:45   ` Jerin Jacob Kollanukkaran
@ 2019-03-25  9:47   ` Pavan Nikhilesh Bhagavatula
  2019-03-25  9:47     ` Pavan Nikhilesh Bhagavatula
  1 sibling, 1 reply; 16+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-03-25  9:47 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran; +Cc: dev

> -----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.

> 
> 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH] app/eventdev: add option to set global dequeue tmo
  2019-03-25  9:47   ` Pavan Nikhilesh Bhagavatula
@ 2019-03-25  9:47     ` Pavan Nikhilesh Bhagavatula
  0 siblings, 0 replies; 16+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-03-25  9:47 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran; +Cc: dev

> -----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.

> 
> 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [dpdk-dev] [PATCH v2] app/eventdev: add option to set global dequeue tmo
  2019-03-19  6:21 [dpdk-dev] [PATCH] app/eventdev: add option to set global dequeue tmo Pavan Nikhilesh Bhagavatula
  2019-03-19  6:21 ` Pavan Nikhilesh Bhagavatula
  2019-03-19  9:45 ` Jerin Jacob Kollanukkaran
@ 2019-03-27 17:07 ` Pavan Nikhilesh Bhagavatula
  2019-03-27 17:07   ` Pavan Nikhilesh Bhagavatula
  2019-03-28  5:26   ` Jerin Jacob Kollanukkaran
  2019-03-29  7:11 ` [dpdk-dev] [PATCH v3] " Pavan Nikhilesh Bhagavatula
  3 siblings, 2 replies; 16+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-03-27 17:07 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran; +Cc: dev, Pavan Nikhilesh Bhagavatula

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>
---
 v2 Changes:
 - Update documentation and fix indentation.
 - Add check to see if provided dequeue timeout is within range and adjust as
 required

 app/test-eventdev/evt_options.c         | 13 ++++++++
 app/test-eventdev/evt_options.h         |  2 ++
 app/test-eventdev/test_order_atq.c      | 25 ++++++++++++---
 app/test-eventdev/test_order_queue.c    | 25 ++++++++++++---
 app/test-eventdev/test_perf_atq.c       | 14 +++++++++
 app/test-eventdev/test_perf_queue.c     | 14 +++++++++
 app/test-eventdev/test_pipeline_atq.c   | 14 +++++++++
 app/test-eventdev/test_pipeline_queue.c | 15 +++++++++
 doc/guides/tools/testeventdev.rst       | 41 ++++++++++++++++---------
 9 files changed, 141 insertions(+), 22 deletions(-)

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..0e98cc07e 100644
--- a/app/test-eventdev/test_order_atq.c
+++ b/app/test-eventdev/test_order_atq.c
@@ -113,18 +113,35 @@ static int
 order_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 {
 	int ret;
-
 	const uint8_t nb_workers = evt_nr_active_lcores(opt->wlcores);
 	/* number of active worker cores + 1 producer */
 	const uint8_t nb_ports = nb_workers + 1;
+	struct rte_event_dev_info info;
+
+	rte_event_dev_info_get(opt->dev_id, &info);
+	if (opt->deq_tmo_nsec) {
+		if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.min_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too low, using %d",
+					opt->deq_tmo_nsec);
+		}
+		if (opt->deq_tmo_nsec > info.max_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.max_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too high, using %d",
+					opt->deq_tmo_nsec);
+		}
+	}

 	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,
+			.nb_events_limit  = info.max_num_events,
 			.nb_event_queue_flows = opt->nb_flows,
-			.nb_event_port_dequeue_depth = 128,
-			.nb_event_port_enqueue_depth = 128,
+			.nb_event_port_dequeue_depth =
+				info.max_event_port_dequeue_depth,
+			.nb_event_port_enqueue_depth =
+				info.max_event_port_enqueue_depth,
 	};

 	ret = rte_event_dev_configure(opt->dev_id, &config);
diff --git a/app/test-eventdev/test_order_queue.c b/app/test-eventdev/test_order_queue.c
index a272c7a57..aba824a96 100644
--- a/app/test-eventdev/test_order_queue.c
+++ b/app/test-eventdev/test_order_queue.c
@@ -113,18 +113,35 @@ static int
 order_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 {
 	int ret;
-
 	const uint8_t nb_workers = evt_nr_active_lcores(opt->wlcores);
 	/* number of active worker cores + 1 producer */
 	const uint8_t nb_ports = nb_workers + 1;
+	struct rte_event_dev_info info;
+
+	rte_event_dev_info_get(opt->dev_id, &info);
+	if (opt->deq_tmo_nsec) {
+		if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.min_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too low, using %d",
+					opt->deq_tmo_nsec);
+		}
+		if (opt->deq_tmo_nsec > info.max_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.max_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too high, using %d",
+					opt->deq_tmo_nsec);
+		}
+	}

 	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,
+			.nb_events_limit  = info.max_num_events,
 			.nb_event_queue_flows = opt->nb_flows,
-			.nb_event_port_dequeue_depth = 128,
-			.nb_event_port_enqueue_depth = 128,
+			.nb_event_port_dequeue_depth =
+				info.max_event_port_dequeue_depth,
+			.nb_event_port_enqueue_depth =
+				info.max_event_port_enqueue_depth,
 	};

 	ret = rte_event_dev_configure(opt->dev_id, &config);
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index 73f31e564..a762370f5 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -175,7 +175,21 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 		return ret;
 	}

+	if (opt->deq_tmo_nsec) {
+		if (opt->deq_tmo_nsec < dev_info.min_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = dev_info.min_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too low, using %d",
+					opt->deq_tmo_nsec);
+		}
+		if (opt->deq_tmo_nsec > dev_info.max_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = dev_info.max_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too high, using %d",
+					opt->deq_tmo_nsec);
+		}
+	}
+
 	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..5d5f8cada 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -176,7 +176,21 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 		return ret;
 	}

+	if (opt->deq_tmo_nsec) {
+		if (opt->deq_tmo_nsec < dev_info.min_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = dev_info.min_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too low, using %d",
+					opt->deq_tmo_nsec);
+		}
+		if (opt->deq_tmo_nsec > dev_info.max_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = dev_info.max_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too high, using %d",
+					opt->deq_tmo_nsec);
+		}
+	}
+
 	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..a05170353 100644
--- a/app/test-eventdev/test_pipeline_atq.c
+++ b/app/test-eventdev/test_pipeline_atq.c
@@ -314,7 +314,21 @@ pipeline_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)

 	rte_event_dev_info_get(opt->dev_id, &info);

+	if (opt->deq_tmo_nsec) {
+		if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.min_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too low, using %d",
+					opt->deq_tmo_nsec);
+		}
+		if (opt->deq_tmo_nsec > info.max_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.max_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too high, using %d",
+					opt->deq_tmo_nsec);
+		}
+	}
+
 	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..c1b190777 100644
--- a/app/test-eventdev/test_pipeline_queue.c
+++ b/app/test-eventdev/test_pipeline_queue.c
@@ -334,7 +334,22 @@ pipeline_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	memset(queue_arr, 0, sizeof(uint8_t) * RTE_EVENT_MAX_QUEUES_PER_DEV);

 	rte_event_dev_info_get(opt->dev_id, &info);
+
+	if (opt->deq_tmo_nsec) {
+		if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.min_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too low, using %d",
+					opt->deq_tmo_nsec);
+		}
+		if (opt->deq_tmo_nsec > info.max_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.max_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too high, using %d",
+					opt->deq_tmo_nsec);
+		}
+	}
+
 	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/doc/guides/tools/testeventdev.rst b/doc/guides/tools/testeventdev.rst
index cddba3be0..db5c4378b 100644
--- a/doc/guides/tools/testeventdev.rst
+++ b/doc/guides/tools/testeventdev.rst
@@ -129,31 +129,38 @@ The following are the application command-line options:

         Use event timer adapter as producer.

- * ``--prod_type_timerdev_burst``
+* ``--prod_type_timerdev_burst``

-        Use burst mode event timer adapter as producer.
+       Use burst mode event timer adapter as producer.

- * ``--timer_tick_nsec``
+* ``--timer_tick_nsec``

-        Used to dictate number of nano seconds between bucket traversal of the
-        event timer adapter. Refer `rte_event_timer_adapter_conf`.
+       Used to dictate number of nano seconds between bucket traversal of the
+       event timer adapter. Refer `rte_event_timer_adapter_conf`.

- * ``--max_tmo_nsec``
+* ``--max_tmo_nsec``

-        Used to configure event timer adapter max arm timeout in nano seconds.
+       Used to configure event timer adapter max arm timeout in nano seconds.

- * ``--expiry_nsec``
+* ``--expiry_nsec``

-        Dictate the number of nano seconds after which the event timer expires.
+       Dictate the number of nano seconds after which the event timer expires.

- * ``--nb_timers``
+* ``--nb_timers``

-        Number of event timers each producer core will generate.
+       Number of event timers each producer core will generate.

- * ``--nb_timer_adptrs``
+* ``--nb_timer_adptrs``
+
+       Number of event timer adapters to be used. Each adapter is used in
+       round robin manner by the producer cores.
+
+* ``--deq_tmo_nsec``
+
+       Global dequeue timeout for all the event ports if the provided dequeue
+       timeout is out of the supported range of event device it will be
+       adjusted to the highest/lowest supported dequeue timeout supported.

-        Number of event timer adapters to be used. Each adapter is used in
-        round robin manner by the producer cores.

 Eventdev Tests
 --------------
@@ -225,6 +232,7 @@ Supported application command line options are following::
    --nb_flows
    --nb_pkts
    --worker_deq_depth
+   --deq_tmo_nsec

 Example
 ^^^^^^^
@@ -287,6 +295,7 @@ Supported application command line options are following::
    --nb_flows
    --nb_pkts
    --worker_deq_depth
+   --deq_tmo_nsec

 Example
 ^^^^^^^
@@ -386,6 +395,7 @@ Supported application command line options are following::
         --expiry_nsec
         --nb_timers
         --nb_timer_adptrs
+        --deq_tmo_nsec

 Example
 ^^^^^^^
@@ -485,6 +495,7 @@ Supported application command line options are following::
         --expiry_nsec
         --nb_timers
         --nb_timer_adptrs
+        --deq_tmo_nsec

 Example
 ^^^^^^^
@@ -598,6 +609,7 @@ Supported application command line options are following::
         --stlist
         --worker_deq_depth
         --prod_type_ethdev
+        --deq_tmo_nsec


 .. Note::
@@ -689,6 +701,7 @@ Supported application command line options are following::
         --stlist
         --worker_deq_depth
         --prod_type_ethdev
+        --deq_tmo_nsec


 .. Note::
--
2.21.0

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [dpdk-dev] [PATCH v2] app/eventdev: add option to set global dequeue tmo
  2019-03-27 17:07 ` [dpdk-dev] [PATCH v2] " Pavan Nikhilesh Bhagavatula
@ 2019-03-27 17:07   ` Pavan Nikhilesh Bhagavatula
  2019-03-28  5:26   ` Jerin Jacob Kollanukkaran
  1 sibling, 0 replies; 16+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-03-27 17:07 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran; +Cc: dev, Pavan Nikhilesh Bhagavatula

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>
---
 v2 Changes:
 - Update documentation and fix indentation.
 - Add check to see if provided dequeue timeout is within range and adjust as
 required

 app/test-eventdev/evt_options.c         | 13 ++++++++
 app/test-eventdev/evt_options.h         |  2 ++
 app/test-eventdev/test_order_atq.c      | 25 ++++++++++++---
 app/test-eventdev/test_order_queue.c    | 25 ++++++++++++---
 app/test-eventdev/test_perf_atq.c       | 14 +++++++++
 app/test-eventdev/test_perf_queue.c     | 14 +++++++++
 app/test-eventdev/test_pipeline_atq.c   | 14 +++++++++
 app/test-eventdev/test_pipeline_queue.c | 15 +++++++++
 doc/guides/tools/testeventdev.rst       | 41 ++++++++++++++++---------
 9 files changed, 141 insertions(+), 22 deletions(-)

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..0e98cc07e 100644
--- a/app/test-eventdev/test_order_atq.c
+++ b/app/test-eventdev/test_order_atq.c
@@ -113,18 +113,35 @@ static int
 order_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 {
 	int ret;
-
 	const uint8_t nb_workers = evt_nr_active_lcores(opt->wlcores);
 	/* number of active worker cores + 1 producer */
 	const uint8_t nb_ports = nb_workers + 1;
+	struct rte_event_dev_info info;
+
+	rte_event_dev_info_get(opt->dev_id, &info);
+	if (opt->deq_tmo_nsec) {
+		if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.min_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too low, using %d",
+					opt->deq_tmo_nsec);
+		}
+		if (opt->deq_tmo_nsec > info.max_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.max_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too high, using %d",
+					opt->deq_tmo_nsec);
+		}
+	}

 	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,
+			.nb_events_limit  = info.max_num_events,
 			.nb_event_queue_flows = opt->nb_flows,
-			.nb_event_port_dequeue_depth = 128,
-			.nb_event_port_enqueue_depth = 128,
+			.nb_event_port_dequeue_depth =
+				info.max_event_port_dequeue_depth,
+			.nb_event_port_enqueue_depth =
+				info.max_event_port_enqueue_depth,
 	};

 	ret = rte_event_dev_configure(opt->dev_id, &config);
diff --git a/app/test-eventdev/test_order_queue.c b/app/test-eventdev/test_order_queue.c
index a272c7a57..aba824a96 100644
--- a/app/test-eventdev/test_order_queue.c
+++ b/app/test-eventdev/test_order_queue.c
@@ -113,18 +113,35 @@ static int
 order_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 {
 	int ret;
-
 	const uint8_t nb_workers = evt_nr_active_lcores(opt->wlcores);
 	/* number of active worker cores + 1 producer */
 	const uint8_t nb_ports = nb_workers + 1;
+	struct rte_event_dev_info info;
+
+	rte_event_dev_info_get(opt->dev_id, &info);
+	if (opt->deq_tmo_nsec) {
+		if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.min_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too low, using %d",
+					opt->deq_tmo_nsec);
+		}
+		if (opt->deq_tmo_nsec > info.max_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.max_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too high, using %d",
+					opt->deq_tmo_nsec);
+		}
+	}

 	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,
+			.nb_events_limit  = info.max_num_events,
 			.nb_event_queue_flows = opt->nb_flows,
-			.nb_event_port_dequeue_depth = 128,
-			.nb_event_port_enqueue_depth = 128,
+			.nb_event_port_dequeue_depth =
+				info.max_event_port_dequeue_depth,
+			.nb_event_port_enqueue_depth =
+				info.max_event_port_enqueue_depth,
 	};

 	ret = rte_event_dev_configure(opt->dev_id, &config);
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index 73f31e564..a762370f5 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -175,7 +175,21 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 		return ret;
 	}

+	if (opt->deq_tmo_nsec) {
+		if (opt->deq_tmo_nsec < dev_info.min_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = dev_info.min_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too low, using %d",
+					opt->deq_tmo_nsec);
+		}
+		if (opt->deq_tmo_nsec > dev_info.max_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = dev_info.max_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too high, using %d",
+					opt->deq_tmo_nsec);
+		}
+	}
+
 	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..5d5f8cada 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -176,7 +176,21 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 		return ret;
 	}

+	if (opt->deq_tmo_nsec) {
+		if (opt->deq_tmo_nsec < dev_info.min_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = dev_info.min_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too low, using %d",
+					opt->deq_tmo_nsec);
+		}
+		if (opt->deq_tmo_nsec > dev_info.max_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = dev_info.max_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too high, using %d",
+					opt->deq_tmo_nsec);
+		}
+	}
+
 	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..a05170353 100644
--- a/app/test-eventdev/test_pipeline_atq.c
+++ b/app/test-eventdev/test_pipeline_atq.c
@@ -314,7 +314,21 @@ pipeline_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)

 	rte_event_dev_info_get(opt->dev_id, &info);

+	if (opt->deq_tmo_nsec) {
+		if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.min_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too low, using %d",
+					opt->deq_tmo_nsec);
+		}
+		if (opt->deq_tmo_nsec > info.max_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.max_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too high, using %d",
+					opt->deq_tmo_nsec);
+		}
+	}
+
 	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..c1b190777 100644
--- a/app/test-eventdev/test_pipeline_queue.c
+++ b/app/test-eventdev/test_pipeline_queue.c
@@ -334,7 +334,22 @@ pipeline_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	memset(queue_arr, 0, sizeof(uint8_t) * RTE_EVENT_MAX_QUEUES_PER_DEV);

 	rte_event_dev_info_get(opt->dev_id, &info);
+
+	if (opt->deq_tmo_nsec) {
+		if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.min_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too low, using %d",
+					opt->deq_tmo_nsec);
+		}
+		if (opt->deq_tmo_nsec > info.max_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.max_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too high, using %d",
+					opt->deq_tmo_nsec);
+		}
+	}
+
 	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/doc/guides/tools/testeventdev.rst b/doc/guides/tools/testeventdev.rst
index cddba3be0..db5c4378b 100644
--- a/doc/guides/tools/testeventdev.rst
+++ b/doc/guides/tools/testeventdev.rst
@@ -129,31 +129,38 @@ The following are the application command-line options:

         Use event timer adapter as producer.

- * ``--prod_type_timerdev_burst``
+* ``--prod_type_timerdev_burst``

-        Use burst mode event timer adapter as producer.
+       Use burst mode event timer adapter as producer.

- * ``--timer_tick_nsec``
+* ``--timer_tick_nsec``

-        Used to dictate number of nano seconds between bucket traversal of the
-        event timer adapter. Refer `rte_event_timer_adapter_conf`.
+       Used to dictate number of nano seconds between bucket traversal of the
+       event timer adapter. Refer `rte_event_timer_adapter_conf`.

- * ``--max_tmo_nsec``
+* ``--max_tmo_nsec``

-        Used to configure event timer adapter max arm timeout in nano seconds.
+       Used to configure event timer adapter max arm timeout in nano seconds.

- * ``--expiry_nsec``
+* ``--expiry_nsec``

-        Dictate the number of nano seconds after which the event timer expires.
+       Dictate the number of nano seconds after which the event timer expires.

- * ``--nb_timers``
+* ``--nb_timers``

-        Number of event timers each producer core will generate.
+       Number of event timers each producer core will generate.

- * ``--nb_timer_adptrs``
+* ``--nb_timer_adptrs``
+
+       Number of event timer adapters to be used. Each adapter is used in
+       round robin manner by the producer cores.
+
+* ``--deq_tmo_nsec``
+
+       Global dequeue timeout for all the event ports if the provided dequeue
+       timeout is out of the supported range of event device it will be
+       adjusted to the highest/lowest supported dequeue timeout supported.

-        Number of event timer adapters to be used. Each adapter is used in
-        round robin manner by the producer cores.

 Eventdev Tests
 --------------
@@ -225,6 +232,7 @@ Supported application command line options are following::
    --nb_flows
    --nb_pkts
    --worker_deq_depth
+   --deq_tmo_nsec

 Example
 ^^^^^^^
@@ -287,6 +295,7 @@ Supported application command line options are following::
    --nb_flows
    --nb_pkts
    --worker_deq_depth
+   --deq_tmo_nsec

 Example
 ^^^^^^^
@@ -386,6 +395,7 @@ Supported application command line options are following::
         --expiry_nsec
         --nb_timers
         --nb_timer_adptrs
+        --deq_tmo_nsec

 Example
 ^^^^^^^
@@ -485,6 +495,7 @@ Supported application command line options are following::
         --expiry_nsec
         --nb_timers
         --nb_timer_adptrs
+        --deq_tmo_nsec

 Example
 ^^^^^^^
@@ -598,6 +609,7 @@ Supported application command line options are following::
         --stlist
         --worker_deq_depth
         --prod_type_ethdev
+        --deq_tmo_nsec


 .. Note::
@@ -689,6 +701,7 @@ Supported application command line options are following::
         --stlist
         --worker_deq_depth
         --prod_type_ethdev
+        --deq_tmo_nsec


 .. Note::
--
2.21.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH v2] app/eventdev: add option to set global dequeue tmo
  2019-03-27 17:07 ` [dpdk-dev] [PATCH v2] " Pavan Nikhilesh Bhagavatula
  2019-03-27 17:07   ` Pavan Nikhilesh Bhagavatula
@ 2019-03-28  5:26   ` Jerin Jacob Kollanukkaran
  2019-03-28  5:26     ` Jerin Jacob Kollanukkaran
  2019-03-28 13:16     ` Pavan Nikhilesh Bhagavatula
  1 sibling, 2 replies; 16+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-03-28  5:26 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula; +Cc: dev

On Wed, 2019-03-27 at 17:07 +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>
> ---
> 
> +
> +	rte_event_dev_info_get(opt->dev_id, &info);
> +	if (opt->deq_tmo_nsec) {
> +		if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) {
> +			opt->deq_tmo_nsec =
> info.min_dequeue_timeout_ns;
> +			evt_info("dequeue_timeout_ns too low, using
> %d",
> +					opt->deq_tmo_nsec);
> +		}
> +		if (opt->deq_tmo_nsec > info.max_dequeue_timeout_ns) {
> +			opt->deq_tmo_nsec =
> info.max_dequeue_timeout_ns;
> +			evt_info("dequeue_timeout_ns too high, using
> %d",
> +					opt->deq_tmo_nsec);
> +		}
> +	}

This code is repeating in multiple palaces, Move this as a function as
use everywhere. Other than this, it looks good to me.






^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH v2] app/eventdev: add option to set global dequeue tmo
  2019-03-28  5:26   ` Jerin Jacob Kollanukkaran
@ 2019-03-28  5:26     ` Jerin Jacob Kollanukkaran
  2019-03-28 13:16     ` Pavan Nikhilesh Bhagavatula
  1 sibling, 0 replies; 16+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-03-28  5:26 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula; +Cc: dev

On Wed, 2019-03-27 at 17:07 +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>
> ---
> 
> +
> +	rte_event_dev_info_get(opt->dev_id, &info);
> +	if (opt->deq_tmo_nsec) {
> +		if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) {
> +			opt->deq_tmo_nsec =
> info.min_dequeue_timeout_ns;
> +			evt_info("dequeue_timeout_ns too low, using
> %d",
> +					opt->deq_tmo_nsec);
> +		}
> +		if (opt->deq_tmo_nsec > info.max_dequeue_timeout_ns) {
> +			opt->deq_tmo_nsec =
> info.max_dequeue_timeout_ns;
> +			evt_info("dequeue_timeout_ns too high, using
> %d",
> +					opt->deq_tmo_nsec);
> +		}
> +	}

This code is repeating in multiple palaces, Move this as a function as
use everywhere. Other than this, it looks good to me.






^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH v2] app/eventdev: add option to set global dequeue tmo
  2019-03-28  5:26   ` Jerin Jacob Kollanukkaran
  2019-03-28  5:26     ` Jerin Jacob Kollanukkaran
@ 2019-03-28 13:16     ` Pavan Nikhilesh Bhagavatula
  2019-03-28 13:16       ` Pavan Nikhilesh Bhagavatula
  1 sibling, 1 reply; 16+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-03-28 13:16 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran; +Cc: dev



> -----Original Message-----
> From: Jerin Jacob Kollanukkaran
> Sent: Thursday, March 28, 2019 10:56 AM
> To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] app/eventdev: add option to set global
> dequeue tmo
> 
> On Wed, 2019-03-27 at 17:07 +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>
> > ---
> >
> > +
> > +	rte_event_dev_info_get(opt->dev_id, &info);
> > +	if (opt->deq_tmo_nsec) {
> > +		if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) {
> > +			opt->deq_tmo_nsec =
> > info.min_dequeue_timeout_ns;
> > +			evt_info("dequeue_timeout_ns too low, using
> > %d",
> > +					opt->deq_tmo_nsec);
> > +		}
> > +		if (opt->deq_tmo_nsec > info.max_dequeue_timeout_ns) {
> > +			opt->deq_tmo_nsec =
> > info.max_dequeue_timeout_ns;
> > +			evt_info("dequeue_timeout_ns too high, using
> > %d",
> > +					opt->deq_tmo_nsec);
> > +		}
> > +	}
> 
> This code is repeating in multiple palaces, Move this as a function as use
> everywhere. Other than this, it looks good to me.

Ack will move it to common file and send the next version.

> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH v2] app/eventdev: add option to set global dequeue tmo
  2019-03-28 13:16     ` Pavan Nikhilesh Bhagavatula
@ 2019-03-28 13:16       ` Pavan Nikhilesh Bhagavatula
  0 siblings, 0 replies; 16+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-03-28 13:16 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran; +Cc: dev



> -----Original Message-----
> From: Jerin Jacob Kollanukkaran
> Sent: Thursday, March 28, 2019 10:56 AM
> To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] app/eventdev: add option to set global
> dequeue tmo
> 
> On Wed, 2019-03-27 at 17:07 +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>
> > ---
> >
> > +
> > +	rte_event_dev_info_get(opt->dev_id, &info);
> > +	if (opt->deq_tmo_nsec) {
> > +		if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) {
> > +			opt->deq_tmo_nsec =
> > info.min_dequeue_timeout_ns;
> > +			evt_info("dequeue_timeout_ns too low, using
> > %d",
> > +					opt->deq_tmo_nsec);
> > +		}
> > +		if (opt->deq_tmo_nsec > info.max_dequeue_timeout_ns) {
> > +			opt->deq_tmo_nsec =
> > info.max_dequeue_timeout_ns;
> > +			evt_info("dequeue_timeout_ns too high, using
> > %d",
> > +					opt->deq_tmo_nsec);
> > +		}
> > +	}
> 
> This code is repeating in multiple palaces, Move this as a function as use
> everywhere. Other than this, it looks good to me.

Ack will move it to common file and send the next version.

> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [dpdk-dev] [PATCH v3] app/eventdev: add option to set global dequeue tmo
  2019-03-19  6:21 [dpdk-dev] [PATCH] app/eventdev: add option to set global dequeue tmo Pavan Nikhilesh Bhagavatula
                   ` (2 preceding siblings ...)
  2019-03-27 17:07 ` [dpdk-dev] [PATCH v2] " Pavan Nikhilesh Bhagavatula
@ 2019-03-29  7:11 ` Pavan Nikhilesh Bhagavatula
  2019-03-29  7:11   ` Pavan Nikhilesh Bhagavatula
  2019-03-31 11:31   ` Jerin Jacob Kollanukkaran
  3 siblings, 2 replies; 16+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-03-29  7:11 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran; +Cc: dev, Pavan Nikhilesh Bhagavatula

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>
---
 v3 Changes:
 - Move common changes to evt_common.h.

 v2 Changes:
 - Update documentation and fix indentation.
 - Add check to see if provided dequeue timeout is within range and adjust as
 required

 app/test-eventdev/evt_common.h          | 79 +++++++++++++++++++++++++
 app/test-eventdev/evt_options.c         | 13 ++++
 app/test-eventdev/evt_options.h         | 36 +----------
 app/test-eventdev/test_order_atq.c      | 11 +---
 app/test-eventdev/test_order_queue.c    | 11 +---
 app/test-eventdev/test_perf_atq.c       | 13 +---
 app/test-eventdev/test_perf_queue.c     | 15 +----
 app/test-eventdev/test_pipeline_atq.c   | 12 +---
 app/test-eventdev/test_pipeline_queue.c | 12 +---
 doc/guides/tools/testeventdev.rst       | 41 ++++++++-----
 10 files changed, 127 insertions(+), 116 deletions(-)

diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h
index 21d3c103e..1c3522ff4 100644
--- a/app/test-eventdev/evt_common.h
+++ b/app/test-eventdev/evt_common.h
@@ -34,6 +34,43 @@
 #define EVT_MAX_PORTS            256
 #define EVT_MAX_QUEUES           256

+enum evt_prod_type {
+	EVT_PROD_TYPE_NONE,
+	EVT_PROD_TYPE_SYNT,          /* Producer type Synthetic i.e. CPU. */
+	EVT_PROD_TYPE_ETH_RX_ADPTR,  /* Producer type Eth Rx Adapter. */
+	EVT_PROD_TYPE_EVENT_TIMER_ADPTR,  /* Producer type Timer Adapter. */
+	EVT_PROD_TYPE_MAX,
+};
+
+struct evt_options {
+#define EVT_TEST_NAME_MAX_LEN     32
+	char test_name[EVT_TEST_NAME_MAX_LEN];
+	bool plcores[RTE_MAX_LCORE];
+	bool wlcores[RTE_MAX_LCORE];
+	uint8_t sched_type_list[EVT_MAX_STAGES];
+	uint32_t nb_flows;
+	int socket_id;
+	int pool_sz;
+	int nb_stages;
+	int verbose_level;
+	uint64_t nb_pkts;
+	uint8_t nb_timer_adptrs;
+	uint64_t nb_timers;
+	uint64_t timer_tick_nsec;
+	uint64_t optm_timer_tick_nsec;
+	uint64_t max_tmo_nsec;
+	uint64_t expiry_nsec;
+	uint16_t wkr_deq_dep;
+	uint8_t dev_id;
+	uint32_t tx_first;
+	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;
+};
+
 static inline bool
 evt_has_distributed_sched(uint8_t dev_id)
 {
@@ -99,4 +136,46 @@ evt_service_setup(uint32_t service_id)
 	return 0;
 }

+static inline int
+evt_configure_eventdev(struct evt_options *opt, uint8_t nb_queues,
+		uint8_t nb_ports)
+{
+	struct rte_event_dev_info info;
+	int ret;
+
+	memset(&info, 0, sizeof(struct rte_event_dev_info));
+	ret = rte_event_dev_info_get(opt->dev_id, &info);
+	if (ret) {
+		evt_err("failed to get eventdev info %d", opt->dev_id);
+		return ret;
+	}
+
+	if (opt->deq_tmo_nsec) {
+		if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.min_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too low, using %d",
+					opt->deq_tmo_nsec);
+		}
+		if (opt->deq_tmo_nsec > info.max_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.max_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too high, using %d",
+					opt->deq_tmo_nsec);
+		}
+	}
+
+	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,
+			.nb_event_queue_flows = opt->nb_flows,
+			.nb_event_port_dequeue_depth =
+				info.max_event_port_dequeue_depth,
+			.nb_event_port_enqueue_depth =
+				info.max_event_port_enqueue_depth,
+	};
+
+	return rte_event_dev_configure(opt->dev_id, &config);
+}
+
 #endif /*  _EVT_COMMON_*/
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..845d3199a 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")
@@ -41,41 +42,6 @@
 #define EVT_EXPIRY_NSEC          ("expiry_nsec")
 #define EVT_HELP                 ("help")

-enum evt_prod_type {
-	EVT_PROD_TYPE_NONE,
-	EVT_PROD_TYPE_SYNT,          /* Producer type Synthetic i.e. CPU. */
-	EVT_PROD_TYPE_ETH_RX_ADPTR,  /* Producer type Eth Rx Adapter. */
-	EVT_PROD_TYPE_EVENT_TIMER_ADPTR,  /* Producer type Timer Adapter. */
-	EVT_PROD_TYPE_MAX,
-};
-
-struct evt_options {
-#define EVT_TEST_NAME_MAX_LEN     32
-	char test_name[EVT_TEST_NAME_MAX_LEN];
-	bool plcores[RTE_MAX_LCORE];
-	bool wlcores[RTE_MAX_LCORE];
-	uint8_t sched_type_list[EVT_MAX_STAGES];
-	uint32_t nb_flows;
-	int socket_id;
-	int pool_sz;
-	int nb_stages;
-	int verbose_level;
-	uint64_t nb_pkts;
-	uint8_t nb_timer_adptrs;
-	uint64_t nb_timers;
-	uint64_t timer_tick_nsec;
-	uint64_t optm_timer_tick_nsec;
-	uint64_t max_tmo_nsec;
-	uint64_t expiry_nsec;
-	uint16_t wkr_deq_dep;
-	uint8_t dev_id;
-	uint32_t fwd_latency:1;
-	uint32_t q_priority:1;
-	enum evt_prod_type prod_type;
-	uint8_t timdev_use_burst;
-	uint8_t timdev_cnt;
-};
-
 void evt_options_default(struct evt_options *opt);
 int evt_options_parse(struct evt_options *opt, int argc, char **argv);
 void evt_options_dump(struct evt_options *opt);
diff --git a/app/test-eventdev/test_order_atq.c b/app/test-eventdev/test_order_atq.c
index 4a8546e7f..abccbccac 100644
--- a/app/test-eventdev/test_order_atq.c
+++ b/app/test-eventdev/test_order_atq.c
@@ -118,16 +118,7 @@ order_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	/* number of active worker cores + 1 producer */
 	const uint8_t nb_ports = nb_workers + 1;

-	const struct rte_event_dev_config config = {
-			.nb_event_queues = NB_QUEUES,/* one all types queue */
-			.nb_event_ports = nb_ports,
-			.nb_events_limit  = 4096,
-			.nb_event_queue_flows = opt->nb_flows,
-			.nb_event_port_dequeue_depth = 128,
-			.nb_event_port_enqueue_depth = 128,
-	};
-
-	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;
diff --git a/app/test-eventdev/test_order_queue.c b/app/test-eventdev/test_order_queue.c
index a272c7a57..7ac570c73 100644
--- a/app/test-eventdev/test_order_queue.c
+++ b/app/test-eventdev/test_order_queue.c
@@ -118,16 +118,7 @@ order_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	/* number of active worker cores + 1 producer */
 	const uint8_t nb_ports = nb_workers + 1;

-	const struct rte_event_dev_config config = {
-			.nb_event_queues = NB_QUEUES,/* q0 ordered, q1 atomic */
-			.nb_event_ports = nb_ports,
-			.nb_events_limit  = 4096,
-			.nb_event_queue_flows = opt->nb_flows,
-			.nb_event_port_dequeue_depth = 128,
-			.nb_event_port_enqueue_depth = 128,
-	};
-
-	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;
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index 73f31e564..d0241ec4a 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -175,18 +175,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;
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index d89491364..29098580e 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -164,7 +164,7 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)

 	nb_ports = evt_nr_active_lcores(opt->wlcores);
 	nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ||
-		 opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR ? 0 :
+		opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR ? 0 :
 		evt_nr_active_lcores(opt->plcores);

 	nb_queues = perf_queue_nb_event_queues(opt);
@@ -176,18 +176,7 @@ perf_queue_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;
diff --git a/app/test-eventdev/test_pipeline_atq.c b/app/test-eventdev/test_pipeline_atq.c
index 998a56cfd..8e8686c14 100644
--- a/app/test-eventdev/test_pipeline_atq.c
+++ b/app/test-eventdev/test_pipeline_atq.c
@@ -314,17 +314,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 = {
-		.nb_event_queues = nb_queues,
-		.nb_event_ports = nb_ports,
-		.nb_events_limit  = info.max_num_events,
-		.nb_event_queue_flows = opt->nb_flows,
-		.nb_event_port_dequeue_depth =
-			info.max_event_port_dequeue_depth,
-		.nb_event_port_enqueue_depth =
-			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;
diff --git a/app/test-eventdev/test_pipeline_queue.c b/app/test-eventdev/test_pipeline_queue.c
index 7da89dad5..7bebac34f 100644
--- a/app/test-eventdev/test_pipeline_queue.c
+++ b/app/test-eventdev/test_pipeline_queue.c
@@ -334,17 +334,7 @@ pipeline_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	memset(queue_arr, 0, sizeof(uint8_t) * RTE_EVENT_MAX_QUEUES_PER_DEV);

 	rte_event_dev_info_get(opt->dev_id, &info);
-	const struct rte_event_dev_config config = {
-			.nb_event_queues = nb_queues,
-			.nb_event_ports = nb_ports,
-			.nb_events_limit  = info.max_num_events,
-			.nb_event_queue_flows = opt->nb_flows,
-			.nb_event_port_dequeue_depth =
-				info.max_event_port_dequeue_depth,
-			.nb_event_port_enqueue_depth =
-				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;
diff --git a/doc/guides/tools/testeventdev.rst b/doc/guides/tools/testeventdev.rst
index cddba3be0..db5c4378b 100644
--- a/doc/guides/tools/testeventdev.rst
+++ b/doc/guides/tools/testeventdev.rst
@@ -129,31 +129,38 @@ The following are the application command-line options:

         Use event timer adapter as producer.

- * ``--prod_type_timerdev_burst``
+* ``--prod_type_timerdev_burst``

-        Use burst mode event timer adapter as producer.
+       Use burst mode event timer adapter as producer.

- * ``--timer_tick_nsec``
+* ``--timer_tick_nsec``

-        Used to dictate number of nano seconds between bucket traversal of the
-        event timer adapter. Refer `rte_event_timer_adapter_conf`.
+       Used to dictate number of nano seconds between bucket traversal of the
+       event timer adapter. Refer `rte_event_timer_adapter_conf`.

- * ``--max_tmo_nsec``
+* ``--max_tmo_nsec``

-        Used to configure event timer adapter max arm timeout in nano seconds.
+       Used to configure event timer adapter max arm timeout in nano seconds.

- * ``--expiry_nsec``
+* ``--expiry_nsec``

-        Dictate the number of nano seconds after which the event timer expires.
+       Dictate the number of nano seconds after which the event timer expires.

- * ``--nb_timers``
+* ``--nb_timers``

-        Number of event timers each producer core will generate.
+       Number of event timers each producer core will generate.

- * ``--nb_timer_adptrs``
+* ``--nb_timer_adptrs``
+
+       Number of event timer adapters to be used. Each adapter is used in
+       round robin manner by the producer cores.
+
+* ``--deq_tmo_nsec``
+
+       Global dequeue timeout for all the event ports if the provided dequeue
+       timeout is out of the supported range of event device it will be
+       adjusted to the highest/lowest supported dequeue timeout supported.

-        Number of event timer adapters to be used. Each adapter is used in
-        round robin manner by the producer cores.

 Eventdev Tests
 --------------
@@ -225,6 +232,7 @@ Supported application command line options are following::
    --nb_flows
    --nb_pkts
    --worker_deq_depth
+   --deq_tmo_nsec

 Example
 ^^^^^^^
@@ -287,6 +295,7 @@ Supported application command line options are following::
    --nb_flows
    --nb_pkts
    --worker_deq_depth
+   --deq_tmo_nsec

 Example
 ^^^^^^^
@@ -386,6 +395,7 @@ Supported application command line options are following::
         --expiry_nsec
         --nb_timers
         --nb_timer_adptrs
+        --deq_tmo_nsec

 Example
 ^^^^^^^
@@ -485,6 +495,7 @@ Supported application command line options are following::
         --expiry_nsec
         --nb_timers
         --nb_timer_adptrs
+        --deq_tmo_nsec

 Example
 ^^^^^^^
@@ -598,6 +609,7 @@ Supported application command line options are following::
         --stlist
         --worker_deq_depth
         --prod_type_ethdev
+        --deq_tmo_nsec


 .. Note::
@@ -689,6 +701,7 @@ Supported application command line options are following::
         --stlist
         --worker_deq_depth
         --prod_type_ethdev
+        --deq_tmo_nsec


 .. Note::
--
2.21.0

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [dpdk-dev] [PATCH v3] app/eventdev: add option to set global dequeue tmo
  2019-03-29  7:11 ` [dpdk-dev] [PATCH v3] " Pavan Nikhilesh Bhagavatula
@ 2019-03-29  7:11   ` Pavan Nikhilesh Bhagavatula
  2019-03-31 11:31   ` Jerin Jacob Kollanukkaran
  1 sibling, 0 replies; 16+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-03-29  7:11 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran; +Cc: dev, Pavan Nikhilesh Bhagavatula

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>
---
 v3 Changes:
 - Move common changes to evt_common.h.

 v2 Changes:
 - Update documentation and fix indentation.
 - Add check to see if provided dequeue timeout is within range and adjust as
 required

 app/test-eventdev/evt_common.h          | 79 +++++++++++++++++++++++++
 app/test-eventdev/evt_options.c         | 13 ++++
 app/test-eventdev/evt_options.h         | 36 +----------
 app/test-eventdev/test_order_atq.c      | 11 +---
 app/test-eventdev/test_order_queue.c    | 11 +---
 app/test-eventdev/test_perf_atq.c       | 13 +---
 app/test-eventdev/test_perf_queue.c     | 15 +----
 app/test-eventdev/test_pipeline_atq.c   | 12 +---
 app/test-eventdev/test_pipeline_queue.c | 12 +---
 doc/guides/tools/testeventdev.rst       | 41 ++++++++-----
 10 files changed, 127 insertions(+), 116 deletions(-)

diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h
index 21d3c103e..1c3522ff4 100644
--- a/app/test-eventdev/evt_common.h
+++ b/app/test-eventdev/evt_common.h
@@ -34,6 +34,43 @@
 #define EVT_MAX_PORTS            256
 #define EVT_MAX_QUEUES           256

+enum evt_prod_type {
+	EVT_PROD_TYPE_NONE,
+	EVT_PROD_TYPE_SYNT,          /* Producer type Synthetic i.e. CPU. */
+	EVT_PROD_TYPE_ETH_RX_ADPTR,  /* Producer type Eth Rx Adapter. */
+	EVT_PROD_TYPE_EVENT_TIMER_ADPTR,  /* Producer type Timer Adapter. */
+	EVT_PROD_TYPE_MAX,
+};
+
+struct evt_options {
+#define EVT_TEST_NAME_MAX_LEN     32
+	char test_name[EVT_TEST_NAME_MAX_LEN];
+	bool plcores[RTE_MAX_LCORE];
+	bool wlcores[RTE_MAX_LCORE];
+	uint8_t sched_type_list[EVT_MAX_STAGES];
+	uint32_t nb_flows;
+	int socket_id;
+	int pool_sz;
+	int nb_stages;
+	int verbose_level;
+	uint64_t nb_pkts;
+	uint8_t nb_timer_adptrs;
+	uint64_t nb_timers;
+	uint64_t timer_tick_nsec;
+	uint64_t optm_timer_tick_nsec;
+	uint64_t max_tmo_nsec;
+	uint64_t expiry_nsec;
+	uint16_t wkr_deq_dep;
+	uint8_t dev_id;
+	uint32_t tx_first;
+	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;
+};
+
 static inline bool
 evt_has_distributed_sched(uint8_t dev_id)
 {
@@ -99,4 +136,46 @@ evt_service_setup(uint32_t service_id)
 	return 0;
 }

+static inline int
+evt_configure_eventdev(struct evt_options *opt, uint8_t nb_queues,
+		uint8_t nb_ports)
+{
+	struct rte_event_dev_info info;
+	int ret;
+
+	memset(&info, 0, sizeof(struct rte_event_dev_info));
+	ret = rte_event_dev_info_get(opt->dev_id, &info);
+	if (ret) {
+		evt_err("failed to get eventdev info %d", opt->dev_id);
+		return ret;
+	}
+
+	if (opt->deq_tmo_nsec) {
+		if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.min_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too low, using %d",
+					opt->deq_tmo_nsec);
+		}
+		if (opt->deq_tmo_nsec > info.max_dequeue_timeout_ns) {
+			opt->deq_tmo_nsec = info.max_dequeue_timeout_ns;
+			evt_info("dequeue_timeout_ns too high, using %d",
+					opt->deq_tmo_nsec);
+		}
+	}
+
+	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,
+			.nb_event_queue_flows = opt->nb_flows,
+			.nb_event_port_dequeue_depth =
+				info.max_event_port_dequeue_depth,
+			.nb_event_port_enqueue_depth =
+				info.max_event_port_enqueue_depth,
+	};
+
+	return rte_event_dev_configure(opt->dev_id, &config);
+}
+
 #endif /*  _EVT_COMMON_*/
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..845d3199a 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")
@@ -41,41 +42,6 @@
 #define EVT_EXPIRY_NSEC          ("expiry_nsec")
 #define EVT_HELP                 ("help")

-enum evt_prod_type {
-	EVT_PROD_TYPE_NONE,
-	EVT_PROD_TYPE_SYNT,          /* Producer type Synthetic i.e. CPU. */
-	EVT_PROD_TYPE_ETH_RX_ADPTR,  /* Producer type Eth Rx Adapter. */
-	EVT_PROD_TYPE_EVENT_TIMER_ADPTR,  /* Producer type Timer Adapter. */
-	EVT_PROD_TYPE_MAX,
-};
-
-struct evt_options {
-#define EVT_TEST_NAME_MAX_LEN     32
-	char test_name[EVT_TEST_NAME_MAX_LEN];
-	bool plcores[RTE_MAX_LCORE];
-	bool wlcores[RTE_MAX_LCORE];
-	uint8_t sched_type_list[EVT_MAX_STAGES];
-	uint32_t nb_flows;
-	int socket_id;
-	int pool_sz;
-	int nb_stages;
-	int verbose_level;
-	uint64_t nb_pkts;
-	uint8_t nb_timer_adptrs;
-	uint64_t nb_timers;
-	uint64_t timer_tick_nsec;
-	uint64_t optm_timer_tick_nsec;
-	uint64_t max_tmo_nsec;
-	uint64_t expiry_nsec;
-	uint16_t wkr_deq_dep;
-	uint8_t dev_id;
-	uint32_t fwd_latency:1;
-	uint32_t q_priority:1;
-	enum evt_prod_type prod_type;
-	uint8_t timdev_use_burst;
-	uint8_t timdev_cnt;
-};
-
 void evt_options_default(struct evt_options *opt);
 int evt_options_parse(struct evt_options *opt, int argc, char **argv);
 void evt_options_dump(struct evt_options *opt);
diff --git a/app/test-eventdev/test_order_atq.c b/app/test-eventdev/test_order_atq.c
index 4a8546e7f..abccbccac 100644
--- a/app/test-eventdev/test_order_atq.c
+++ b/app/test-eventdev/test_order_atq.c
@@ -118,16 +118,7 @@ order_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	/* number of active worker cores + 1 producer */
 	const uint8_t nb_ports = nb_workers + 1;

-	const struct rte_event_dev_config config = {
-			.nb_event_queues = NB_QUEUES,/* one all types queue */
-			.nb_event_ports = nb_ports,
-			.nb_events_limit  = 4096,
-			.nb_event_queue_flows = opt->nb_flows,
-			.nb_event_port_dequeue_depth = 128,
-			.nb_event_port_enqueue_depth = 128,
-	};
-
-	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;
diff --git a/app/test-eventdev/test_order_queue.c b/app/test-eventdev/test_order_queue.c
index a272c7a57..7ac570c73 100644
--- a/app/test-eventdev/test_order_queue.c
+++ b/app/test-eventdev/test_order_queue.c
@@ -118,16 +118,7 @@ order_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	/* number of active worker cores + 1 producer */
 	const uint8_t nb_ports = nb_workers + 1;

-	const struct rte_event_dev_config config = {
-			.nb_event_queues = NB_QUEUES,/* q0 ordered, q1 atomic */
-			.nb_event_ports = nb_ports,
-			.nb_events_limit  = 4096,
-			.nb_event_queue_flows = opt->nb_flows,
-			.nb_event_port_dequeue_depth = 128,
-			.nb_event_port_enqueue_depth = 128,
-	};
-
-	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;
diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index 73f31e564..d0241ec4a 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -175,18 +175,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;
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index d89491364..29098580e 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -164,7 +164,7 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)

 	nb_ports = evt_nr_active_lcores(opt->wlcores);
 	nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ||
-		 opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR ? 0 :
+		opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR ? 0 :
 		evt_nr_active_lcores(opt->plcores);

 	nb_queues = perf_queue_nb_event_queues(opt);
@@ -176,18 +176,7 @@ perf_queue_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;
diff --git a/app/test-eventdev/test_pipeline_atq.c b/app/test-eventdev/test_pipeline_atq.c
index 998a56cfd..8e8686c14 100644
--- a/app/test-eventdev/test_pipeline_atq.c
+++ b/app/test-eventdev/test_pipeline_atq.c
@@ -314,17 +314,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 = {
-		.nb_event_queues = nb_queues,
-		.nb_event_ports = nb_ports,
-		.nb_events_limit  = info.max_num_events,
-		.nb_event_queue_flows = opt->nb_flows,
-		.nb_event_port_dequeue_depth =
-			info.max_event_port_dequeue_depth,
-		.nb_event_port_enqueue_depth =
-			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;
diff --git a/app/test-eventdev/test_pipeline_queue.c b/app/test-eventdev/test_pipeline_queue.c
index 7da89dad5..7bebac34f 100644
--- a/app/test-eventdev/test_pipeline_queue.c
+++ b/app/test-eventdev/test_pipeline_queue.c
@@ -334,17 +334,7 @@ pipeline_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	memset(queue_arr, 0, sizeof(uint8_t) * RTE_EVENT_MAX_QUEUES_PER_DEV);

 	rte_event_dev_info_get(opt->dev_id, &info);
-	const struct rte_event_dev_config config = {
-			.nb_event_queues = nb_queues,
-			.nb_event_ports = nb_ports,
-			.nb_events_limit  = info.max_num_events,
-			.nb_event_queue_flows = opt->nb_flows,
-			.nb_event_port_dequeue_depth =
-				info.max_event_port_dequeue_depth,
-			.nb_event_port_enqueue_depth =
-				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;
diff --git a/doc/guides/tools/testeventdev.rst b/doc/guides/tools/testeventdev.rst
index cddba3be0..db5c4378b 100644
--- a/doc/guides/tools/testeventdev.rst
+++ b/doc/guides/tools/testeventdev.rst
@@ -129,31 +129,38 @@ The following are the application command-line options:

         Use event timer adapter as producer.

- * ``--prod_type_timerdev_burst``
+* ``--prod_type_timerdev_burst``

-        Use burst mode event timer adapter as producer.
+       Use burst mode event timer adapter as producer.

- * ``--timer_tick_nsec``
+* ``--timer_tick_nsec``

-        Used to dictate number of nano seconds between bucket traversal of the
-        event timer adapter. Refer `rte_event_timer_adapter_conf`.
+       Used to dictate number of nano seconds between bucket traversal of the
+       event timer adapter. Refer `rte_event_timer_adapter_conf`.

- * ``--max_tmo_nsec``
+* ``--max_tmo_nsec``

-        Used to configure event timer adapter max arm timeout in nano seconds.
+       Used to configure event timer adapter max arm timeout in nano seconds.

- * ``--expiry_nsec``
+* ``--expiry_nsec``

-        Dictate the number of nano seconds after which the event timer expires.
+       Dictate the number of nano seconds after which the event timer expires.

- * ``--nb_timers``
+* ``--nb_timers``

-        Number of event timers each producer core will generate.
+       Number of event timers each producer core will generate.

- * ``--nb_timer_adptrs``
+* ``--nb_timer_adptrs``
+
+       Number of event timer adapters to be used. Each adapter is used in
+       round robin manner by the producer cores.
+
+* ``--deq_tmo_nsec``
+
+       Global dequeue timeout for all the event ports if the provided dequeue
+       timeout is out of the supported range of event device it will be
+       adjusted to the highest/lowest supported dequeue timeout supported.

-        Number of event timer adapters to be used. Each adapter is used in
-        round robin manner by the producer cores.

 Eventdev Tests
 --------------
@@ -225,6 +232,7 @@ Supported application command line options are following::
    --nb_flows
    --nb_pkts
    --worker_deq_depth
+   --deq_tmo_nsec

 Example
 ^^^^^^^
@@ -287,6 +295,7 @@ Supported application command line options are following::
    --nb_flows
    --nb_pkts
    --worker_deq_depth
+   --deq_tmo_nsec

 Example
 ^^^^^^^
@@ -386,6 +395,7 @@ Supported application command line options are following::
         --expiry_nsec
         --nb_timers
         --nb_timer_adptrs
+        --deq_tmo_nsec

 Example
 ^^^^^^^
@@ -485,6 +495,7 @@ Supported application command line options are following::
         --expiry_nsec
         --nb_timers
         --nb_timer_adptrs
+        --deq_tmo_nsec

 Example
 ^^^^^^^
@@ -598,6 +609,7 @@ Supported application command line options are following::
         --stlist
         --worker_deq_depth
         --prod_type_ethdev
+        --deq_tmo_nsec


 .. Note::
@@ -689,6 +701,7 @@ Supported application command line options are following::
         --stlist
         --worker_deq_depth
         --prod_type_ethdev
+        --deq_tmo_nsec


 .. Note::
--
2.21.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH v3] app/eventdev: add option to set global dequeue tmo
  2019-03-29  7:11 ` [dpdk-dev] [PATCH v3] " Pavan Nikhilesh Bhagavatula
  2019-03-29  7:11   ` Pavan Nikhilesh Bhagavatula
@ 2019-03-31 11:31   ` Jerin Jacob Kollanukkaran
  2019-03-31 11:31     ` Jerin Jacob Kollanukkaran
  1 sibling, 1 reply; 16+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-03-31 11:31 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula; +Cc: dev

On Fri, 2019-03-29 at 07:11 +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>
> ---
>  v3 Changes:
>  - Move common changes to evt_common.h.
> 
>  v2 Changes:
>  - Update documentation and fix indentation.
>  - Add check to see if provided dequeue timeout is within range and
> adjust as
>  required

Applied to dpdk-next-eventdev/master. Thanks.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [dpdk-dev] [PATCH v3] app/eventdev: add option to set global dequeue tmo
  2019-03-31 11:31   ` Jerin Jacob Kollanukkaran
@ 2019-03-31 11:31     ` Jerin Jacob Kollanukkaran
  0 siblings, 0 replies; 16+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2019-03-31 11:31 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula; +Cc: dev

On Fri, 2019-03-29 at 07:11 +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>
> ---
>  v3 Changes:
>  - Move common changes to evt_common.h.
> 
>  v2 Changes:
>  - Update documentation and fix indentation.
>  - Add check to see if provided dequeue timeout is within range and
> adjust as
>  required

Applied to dpdk-next-eventdev/master. Thanks.



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-03-31 11:31 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19  6:21 [dpdk-dev] [PATCH] app/eventdev: add option to set global dequeue tmo Pavan Nikhilesh Bhagavatula
2019-03-19  6:21 ` Pavan Nikhilesh Bhagavatula
2019-03-19  9:45 ` Jerin Jacob Kollanukkaran
2019-03-19  9:45   ` Jerin Jacob Kollanukkaran
2019-03-25  9:47   ` Pavan Nikhilesh Bhagavatula
2019-03-25  9:47     ` Pavan Nikhilesh Bhagavatula
2019-03-27 17:07 ` [dpdk-dev] [PATCH v2] " Pavan Nikhilesh Bhagavatula
2019-03-27 17:07   ` Pavan Nikhilesh Bhagavatula
2019-03-28  5:26   ` Jerin Jacob Kollanukkaran
2019-03-28  5:26     ` Jerin Jacob Kollanukkaran
2019-03-28 13:16     ` Pavan Nikhilesh Bhagavatula
2019-03-28 13:16       ` Pavan Nikhilesh Bhagavatula
2019-03-29  7:11 ` [dpdk-dev] [PATCH v3] " Pavan Nikhilesh Bhagavatula
2019-03-29  7:11   ` Pavan Nikhilesh Bhagavatula
2019-03-31 11:31   ` Jerin Jacob Kollanukkaran
2019-03-31 11:31     ` Jerin Jacob Kollanukkaran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).