DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] app/eventdev: start event producers after eventdev is started
@ 2019-02-27 20:00 Pavan Nikhilesh Bhagavatula
  2019-02-27 20:00 ` [dpdk-dev] [PATCH 2/2] doc: add notes regarding eventdev producer consumer dependency Pavan Nikhilesh Bhagavatula
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-02-27 20:00 UTC (permalink / raw)
  To: Jerin Jacob Kollanukkaran; +Cc: john.mcnamara, dev, Pavan Nikhilesh Bhagavatula

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Start event producers after eventdev i.e. consumer is started as in some
architectures it might lead to undefined behaviour or events being
dropped.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 app/test-eventdev/test_perf_atq.c       | 31 +++++++++++++++++++++++++
 app/test-eventdev/test_perf_common.c    | 21 -----------------
 app/test-eventdev/test_perf_queue.c     | 31 +++++++++++++++++++++++++
 app/test-eventdev/test_pipeline_atq.c   | 13 ++++++-----
 app/test-eventdev/test_pipeline_queue.c | 13 ++++++-----
 5 files changed, 76 insertions(+), 33 deletions(-)

diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index b76ca605b..73f31e564 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -157,7 +157,9 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	uint8_t queue;
 	uint8_t nb_queues;
 	uint8_t nb_ports;
+	uint16_t prod;
 	struct rte_event_dev_info dev_info;
+	struct test_perf *t = evt_test_priv(test);
 
 	nb_ports = evt_nr_active_lcores(opt->wlcores);
 	nb_ports += (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ||
@@ -236,6 +238,35 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 		return ret;
 	}
 
+	if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
+		RTE_ETH_FOREACH_DEV(prod) {
+			ret = rte_eth_dev_start(prod);
+			if (ret) {
+				evt_err("Ethernet dev [%d] failed to start. Using synthetic producer",
+						prod);
+				return ret;
+			}
+
+			ret = rte_event_eth_rx_adapter_start(prod);
+			if (ret) {
+				evt_err("Rx adapter[%d] start failed", prod);
+				return ret;
+			}
+			printf("%s: Port[%d] using Rx adapter[%d] started\n",
+					__func__, prod, prod);
+		}
+	} else if (opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR) {
+		for (prod = 0; prod < opt->nb_timer_adptrs; prod++) {
+			ret = rte_event_timer_adapter_start(
+					t->timer_adptr[prod]);
+			if (ret) {
+				evt_err("failed to Start event timer adapter %d"
+						, prod);
+				return ret;
+			}
+		}
+	}
+
 	return 0;
 }
 
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index f99a6a607..24ece75c3 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -393,21 +393,6 @@ perf_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride,
 				return ret;
 			}
 		}
-
-		ret = rte_eth_dev_start(prod);
-		if (ret) {
-			evt_err("Ethernet dev [%d] failed to start."
-					" Using synthetic producer", prod);
-			return ret;
-		}
-
-		ret = rte_event_eth_rx_adapter_start(prod);
-		if (ret) {
-			evt_err("Rx adapter[%d] start failed", prod);
-			return ret;
-		}
-		printf("%s: Port[%d] using Rx adapter[%d] started\n", __func__,
-				prod, prod);
 	}
 
 	return ret;
@@ -461,12 +446,6 @@ perf_event_timer_adapter_setup(struct test_perf *t)
 			}
 			rte_service_runstate_set(service_id, 1);
 		}
-
-		ret = rte_event_timer_adapter_start(wl);
-		if (ret) {
-			evt_err("failed to Start event timer adapter %d", i);
-			return ret;
-		}
 		t->timer_adptr[i] = wl;
 	}
 	return 0;
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index 8efdec6f9..d89491364 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -158,7 +158,9 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	int ret;
 	int nb_ports;
 	int nb_queues;
+	uint16_t prod;
 	struct rte_event_dev_info dev_info;
+	struct test_perf *t = evt_test_priv(test);
 
 	nb_ports = evt_nr_active_lcores(opt->wlcores);
 	nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ||
@@ -251,6 +253,35 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 		return ret;
 	}
 
+	if (opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR) {
+		RTE_ETH_FOREACH_DEV(prod) {
+			ret = rte_eth_dev_start(prod);
+			if (ret) {
+				evt_err("Ethernet dev [%d] failed to start. Using synthetic producer",
+						prod);
+				return ret;
+			}
+
+			ret = rte_event_eth_rx_adapter_start(prod);
+			if (ret) {
+				evt_err("Rx adapter[%d] start failed", prod);
+				return ret;
+			}
+			printf("%s: Port[%d] using Rx adapter[%d] started\n",
+					__func__, prod, prod);
+		}
+	} else if (opt->prod_type == EVT_PROD_TYPE_EVENT_TIMER_ADPTR) {
+		for (prod = 0; prod < opt->nb_timer_adptrs; prod++) {
+			ret = rte_event_timer_adapter_start(
+					t->timer_adptr[prod]);
+			if (ret) {
+				evt_err("failed to Start event timer adapter %d"
+						, prod);
+				return ret;
+			}
+		}
+	}
+
 	return 0;
 }
 
diff --git a/app/test-eventdev/test_pipeline_atq.c b/app/test-eventdev/test_pipeline_atq.c
index fc4cb3bb7..998a56cfd 100644
--- a/app/test-eventdev/test_pipeline_atq.c
+++ b/app/test-eventdev/test_pipeline_atq.c
@@ -442,6 +442,13 @@ pipeline_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 		}
 	}
 
+	ret = rte_event_dev_start(opt->dev_id);
+	if (ret) {
+		evt_err("failed to start eventdev %d", opt->dev_id);
+		return ret;
+	}
+
+
 	RTE_ETH_FOREACH_DEV(prod) {
 		ret = rte_eth_dev_start(prod);
 		if (ret) {
@@ -451,12 +458,6 @@ pipeline_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 		}
 	}
 
-	ret = rte_event_dev_start(opt->dev_id);
-	if (ret) {
-		evt_err("failed to start eventdev %d", opt->dev_id);
-		return ret;
-	}
-
 	RTE_ETH_FOREACH_DEV(prod) {
 		ret = rte_event_eth_rx_adapter_start(prod);
 		if (ret) {
diff --git a/app/test-eventdev/test_pipeline_queue.c b/app/test-eventdev/test_pipeline_queue.c
index e35e9eb4c..7da89dad5 100644
--- a/app/test-eventdev/test_pipeline_queue.c
+++ b/app/test-eventdev/test_pipeline_queue.c
@@ -456,6 +456,13 @@ pipeline_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 		}
 	}
 
+	ret = rte_event_dev_start(opt->dev_id);
+	if (ret) {
+		evt_err("failed to start eventdev %d", opt->dev_id);
+		return ret;
+	}
+
+
 	RTE_ETH_FOREACH_DEV(prod) {
 		ret = rte_eth_dev_start(prod);
 		if (ret) {
@@ -466,12 +473,6 @@ pipeline_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 
 	}
 
-	ret = rte_event_dev_start(opt->dev_id);
-	if (ret) {
-		evt_err("failed to start eventdev %d", opt->dev_id);
-		return ret;
-	}
-
 	RTE_ETH_FOREACH_DEV(prod) {
 		ret = rte_event_eth_rx_adapter_start(prod);
 		if (ret) {
-- 
2.21.0

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

end of thread, other threads:[~2019-03-14 16:17 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-27 20:00 [dpdk-dev] [PATCH 1/2] app/eventdev: start event producers after eventdev is started Pavan Nikhilesh Bhagavatula
2019-02-27 20:00 ` [dpdk-dev] [PATCH 2/2] doc: add notes regarding eventdev producer consumer dependency Pavan Nikhilesh Bhagavatula
2019-03-05 15:15   ` Jerin Jacob Kollanukkaran
2019-03-05 23:52     ` Carrillo, Erik G
2019-03-06  5:32     ` Gujjar, Abhinandan S
2019-03-08 18:24 ` [dpdk-dev] [PATCH 1/2] app/eventdev: start event producers after eventdev is started Jerin Jacob Kollanukkaran
2019-03-11  7:59 ` [dpdk-dev] [PATCH v2 1/2] app/eventdev: start event producers after eventdev Pavan Nikhilesh Bhagavatula
2019-03-11  7:59   ` [dpdk-dev] [PATCH v2 2/2] doc: add notes about eventdev producer consumer dependency Pavan Nikhilesh Bhagavatula
2019-03-12 20:41 ` [dpdk-dev] [PATCH v3 1/3] app/eventdev: start event producers after eventdev Pavan Nikhilesh Bhagavatula
2019-03-12 20:41   ` [dpdk-dev] [PATCH v3 2/3] examples/eventdev: start ethdev after eth adapter setup Pavan Nikhilesh Bhagavatula
2019-03-13 13:10     ` Rao, Nikhil
2019-03-12 20:41   ` [dpdk-dev] [PATCH v3 3/3] doc: add notes about eventdev producer consumer dependency Pavan Nikhilesh Bhagavatula
2019-03-13 22:22     ` Carrillo, Erik G
2019-03-13 22:22       ` Carrillo, Erik G
2019-03-14 16:17       ` Jerin Jacob Kollanukkaran
2019-03-14 16:17         ` Jerin Jacob Kollanukkaran
2019-03-14  5:03     ` Gujjar, Abhinandan S
2019-03-14  5:03       ` Gujjar, Abhinandan S

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