DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
To: jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com,
	harry.van.haaren@intel.com, gage.eads@intel.com,
	hemant.agrawal@nxp.com, nipun.gupta@nxp.com,
	nikhil.rao@intel.com, santosh.shukla@caviumnetworks.com
Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Subject: [dpdk-dev] [PATCH v3 2/8] app/eventdev: modify app setup to support ethdev
Date: Mon, 11 Dec 2017 20:43:40 +0530	[thread overview]
Message-ID: <20171211151346.14405-2-pbhagavatula@caviumnetworks.com> (raw)
In-Reply-To: <20171211151346.14405-1-pbhagavatula@caviumnetworks.com>

Modify app setup to accommodate event port and queue setup based on the
number of ethernet ports.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---

 v2 Changes:
   - Removed unnecessary RTE_SET_USED() macros.

 app/test-eventdev/test_perf_atq.c    | 17 +++++++++++++----
 app/test-eventdev/test_perf_common.c | 26 ++++++++++++++++++++------
 app/test-eventdev/test_perf_common.h |  1 +
 app/test-eventdev/test_perf_queue.c  | 16 +++++++++++++---
 4 files changed, 47 insertions(+), 13 deletions(-)

diff --git a/app/test-eventdev/test_perf_atq.c b/app/test-eventdev/test_perf_atq.c
index 0e9f2db0e..6082d4ff3 100644
--- a/app/test-eventdev/test_perf_atq.c
+++ b/app/test-eventdev/test_perf_atq.c
@@ -185,10 +185,19 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 {
 	int ret;
 	uint8_t queue;
+	uint8_t nb_queues;
+	uint8_t nb_ports;
+
+	nb_ports = evt_nr_active_lcores(opt->wlcores);
+	nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 :
+		evt_nr_active_lcores(opt->plcores);
+
+	nb_queues = opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ?
+		rte_eth_dev_count() : atq_nb_event_queues(opt);

 	const struct rte_event_dev_config config = {
-			.nb_event_queues = atq_nb_event_queues(opt),
-			.nb_event_ports = perf_nb_event_ports(opt),
+			.nb_event_queues = nb_queues,
+			.nb_event_ports = nb_ports,
 			.nb_events_limit  = 4096,
 			.nb_event_queue_flows = opt->nb_flows,
 			.nb_event_port_dequeue_depth = 128,
@@ -208,7 +217,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 			.nb_atomic_order_sequences = opt->nb_flows,
 	};
 	/* queue configurations */
-	for (queue = 0; queue < atq_nb_event_queues(opt); queue++) {
+	for (queue = 0; queue < nb_queues; queue++) {
 		ret = rte_event_queue_setup(opt->dev_id, queue, &q_conf);
 		if (ret) {
 			evt_err("failed to setup queue=%d", queue);
@@ -217,7 +226,7 @@ perf_atq_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	}

 	ret = perf_event_dev_port_setup(test, opt, 1 /* stride */,
-					atq_nb_event_queues(opt));
+					nb_queues);
 	if (ret)
 		return ret;

diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index 9d2865ed5..114210ea6 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -88,6 +88,17 @@ perf_producer(void *arg)
 	return 0;
 }

+static int
+perf_producer_wrapper(void *arg)
+{
+	struct prod_data *p  = arg;
+	struct test_perf *t = p->t;
+	/* Launch the producer function only in case of synthetic producer. */
+	if (t->opt->prod_type == EVT_PROD_TYPE_SYNT)
+		return perf_producer(arg);
+	return 0;
+}
+
 static inline uint64_t
 processed_pkts(struct test_perf *t)
 {
@@ -142,8 +153,8 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
 		if (!(opt->plcores[lcore_id]))
 			continue;

-		ret = rte_eal_remote_launch(perf_producer, &t->prod[port_idx],
-					 lcore_id);
+		ret = rte_eal_remote_launch(perf_producer_wrapper,
+				&t->prod[port_idx], lcore_id);
 		if (ret) {
 			evt_err("failed to launch perf_producer %d", lcore_id);
 			return ret;
@@ -193,14 +204,17 @@ perf_launch_lcores(struct evt_test *test, struct evt_options *opt,
 			fflush(stdout);

 			if (remaining <= 0) {
-				t->done = true;
 				t->result = EVT_TEST_SUCCESS;
-				rte_smp_wmb();
-				break;
+				if (opt->prod_type == EVT_PROD_TYPE_SYNT) {
+					t->done = true;
+					rte_smp_wmb();
+					break;
+				}
 			}
 		}

-		if (new_cycles - dead_lock_cycles > dead_lock_sample) {
+		if (new_cycles - dead_lock_cycles > dead_lock_sample &&
+				opt->prod_type == EVT_PROD_TYPE_SYNT) {
 			remaining = t->outstand_pkts - processed_pkts(t);
 			if (dead_lock_remaining == remaining) {
 				rte_event_dev_dump(opt->dev_id, stdout);
diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h
index c6fc70cd7..ab2e59988 100644
--- a/app/test-eventdev/test_perf_common.h
+++ b/app/test-eventdev/test_perf_common.h
@@ -38,6 +38,7 @@
 #include <unistd.h>

 #include <rte_cycles.h>
+#include <rte_ethdev.h>
 #include <rte_eventdev.h>
 #include <rte_lcore.h>
 #include <rte_malloc.h>
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index d843eea17..0caf5757c 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -182,10 +182,20 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	uint8_t queue;
 	int nb_stages = opt->nb_stages;
 	int ret;
+	int nb_ports;
+	int nb_queues;
+
+	nb_ports = evt_nr_active_lcores(opt->wlcores);
+	nb_ports += opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ? 0 :
+		evt_nr_active_lcores(opt->plcores);
+
+	nb_queues = opt->prod_type == EVT_PROD_TYPE_ETH_RX_ADPTR ?
+		rte_eth_dev_count() * nb_stages :
+		perf_queue_nb_event_queues(opt);

 	const struct rte_event_dev_config config = {
-			.nb_event_queues = perf_queue_nb_event_queues(opt),
-			.nb_event_ports = perf_nb_event_ports(opt),
+			.nb_event_queues = nb_queues,
+			.nb_event_ports = nb_ports,
 			.nb_events_limit  = 4096,
 			.nb_event_queue_flows = opt->nb_flows,
 			.nb_event_port_dequeue_depth = 128,
@@ -228,7 +238,7 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	}

 	ret = perf_event_dev_port_setup(test, opt, nb_stages /* stride */,
-					perf_queue_nb_event_queues(opt));
+					nb_queues);
 	if (ret)
 		return ret;

--
2.14.1

  reply	other threads:[~2017-12-11 15:14 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-18 12:39 [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Pavan Nikhilesh
2017-10-18 12:39 ` [dpdk-dev] [PATCH 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
2017-12-10  8:34   ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 2/8] app/eventdev: modify app setup to support ethdev Pavan Nikhilesh
2017-12-10 11:56   ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 3/8] app/eventdev: add pktmbuf pool for ethdev Pavan Nikhilesh
2017-12-10 12:01   ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 4/8] app/eventdev: add ethernet device setup helpers Pavan Nikhilesh
2017-12-10 12:09   ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 5/8] app/eventdev: add ethernet device tear down Pavan Nikhilesh
2017-12-10 12:10   ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 6/8] app/eventdev: add event Rx adapter setup Pavan Nikhilesh
2017-12-10 12:13   ` Jerin Jacob
2017-10-18 12:39 ` [dpdk-dev] [PATCH 7/8] app/eventdev: add service core configuration Pavan Nikhilesh
2017-10-18 12:39 ` [dpdk-dev] [PATCH 8/8] doc: update app eventdev options Pavan Nikhilesh
2017-10-18 18:33   ` Mcnamara, John
2017-12-10 12:16   ` Jerin Jacob
2017-12-10  8:28 ` [dpdk-dev] [PATCH 0/8] app/eventdev: add event eth Rx adapter support Jerin Jacob
2017-12-11  7:37   ` Pavan Nikhilesh Bhagavatula
2017-12-11 11:12 ` [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option Pavan Nikhilesh
2017-12-11 11:12   ` [dpdk-dev] [PATCH v2 2/8] app/eventdev: modify app setup to support ethdev Pavan Nikhilesh
2017-12-11 11:12   ` [dpdk-dev] [PATCH v2 3/8] app/eventdev: add pktmbuf pool for ethdev Pavan Nikhilesh
2017-12-11 11:12   ` [dpdk-dev] [PATCH v2 4/8] app/eventdev: add ethernet device setup helpers Pavan Nikhilesh
2017-12-11 11:12   ` [dpdk-dev] [PATCH v2 5/8] app/eventdev: add ethernet device tear down Pavan Nikhilesh
2017-12-11 11:12   ` [dpdk-dev] [PATCH v2 6/8] app/eventdev: add event Rx adapter setup Pavan Nikhilesh
2017-12-11 11:12   ` [dpdk-dev] [PATCH v2 7/8] app/eventdev: add service core configuration Pavan Nikhilesh
2017-12-11 11:12   ` [dpdk-dev] [PATCH v2 8/8] doc: update app eventdev options Pavan Nikhilesh
2017-12-16  9:34   ` [dpdk-dev] [PATCH v2 1/8] app/eventdev: add ethernet device producer option Jerin Jacob
2017-12-11 15:13 ` [dpdk-dev] [PATCH v3 " Pavan Nikhilesh
2017-12-11 15:13   ` Pavan Nikhilesh [this message]
2017-12-11 15:13   ` [dpdk-dev] [PATCH v3 3/8] app/eventdev: add pktmbuf pool for ethdev Pavan Nikhilesh
2017-12-11 15:13   ` [dpdk-dev] [PATCH v3 4/8] app/eventdev: add ethernet device setup helpers Pavan Nikhilesh
2017-12-11 15:13   ` [dpdk-dev] [PATCH v3 5/8] app/eventdev: add ethernet device tear down Pavan Nikhilesh
2017-12-11 15:13   ` [dpdk-dev] [PATCH v3 6/8] app/eventdev: add event Rx adapter setup Pavan Nikhilesh
2017-12-11 15:13   ` [dpdk-dev] [PATCH v3 7/8] app/eventdev: add service core configuration Pavan Nikhilesh
2017-12-19 10:25     ` Van Haaren, Harry
2017-12-11 15:13   ` [dpdk-dev] [PATCH v3 8/8] doc: update app eventdev options Pavan Nikhilesh
2017-12-11 17:34     ` Eads, Gage
2017-12-12  7:19       ` Pavan Nikhilesh Bhagavatula
2017-12-16  9:32       ` Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171211151346.14405-2-pbhagavatula@caviumnetworks.com \
    --to=pbhagavatula@caviumnetworks.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=gage.eads@intel.com \
    --cc=harry.van.haaren@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=nikhil.rao@intel.com \
    --cc=nipun.gupta@nxp.com \
    --cc=santosh.shukla@caviumnetworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).