DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
To: 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,
	jerin.jacob@caviumnetworks.com
Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Subject: [dpdk-dev] [PATCH 1/8] app/eventdev: add ethernet device producer option
Date: Wed, 18 Oct 2017 18:09:01 +0530	[thread overview]
Message-ID: <1508330348-30060-2-git-send-email-pbhagavatula@caviumnetworks.com> (raw)
In-Reply-To: <1508330348-30060-1-git-send-email-pbhagavatula@caviumnetworks.com>

Add command line option --prod_type_ethdev to specify that the events
are generated by ethernet device.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 app/test-eventdev/evt_options.c      | 11 +++++++++++
 app/test-eventdev/evt_options.h      | 29 +++++++++++++++++++++++++++++
 app/test-eventdev/test_perf_common.c | 34 ++++++++++++++++++++--------------
 3 files changed, 60 insertions(+), 14 deletions(-)

diff --git a/app/test-eventdev/evt_options.c b/app/test-eventdev/evt_options.c
index e2187df..7db7cd9 100644
--- a/app/test-eventdev/evt_options.c
+++ b/app/test-eventdev/evt_options.c
@@ -55,6 +55,7 @@ evt_options_default(struct evt_options *opt)
 	opt->pool_sz = 16 * 1024;
 	opt->wkr_deq_dep = 16;
 	opt->nb_pkts = (1ULL << 26); /* do ~64M packets */
+	opt->prod_type = EVT_PROD_TYPE_SYNT;
 }
 
 typedef int (*option_parser_t)(struct evt_options *opt,
@@ -107,6 +108,13 @@ evt_parse_queue_priority(struct evt_options *opt, const char *arg __rte_unused)
 }
 
 static int
+evt_parse_prod_type(struct evt_options *opt, const char *arg __rte_unused)
+{
+	opt->prod_type = EVT_PROD_TYPE_ETH_RX_ADPTR;
+	return 0;
+}
+
+static int
 evt_parse_test_name(struct evt_options *opt, const char *arg)
 {
 	snprintf(opt->test_name, EVT_TEST_NAME_MAX_LEN, "%s", arg);
@@ -189,6 +197,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--prod_type_ethdev : use ethernet device as producer\n."
 		);
 	printf("available tests:\n");
 	evt_test_dump_names();
@@ -249,6 +258,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_PROD_ETHDEV,      0, 0, 0 },
 	{ EVT_HELP,             0, 0, 0 },
 	{ NULL,                 0, 0, 0 }
 };
@@ -272,6 +282,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_PROD_ETHDEV, evt_parse_prod_type},
 	};
 
 	for (i = 0; i < RTE_DIM(parsermap); i++) {
diff --git a/app/test-eventdev/evt_options.h b/app/test-eventdev/evt_options.h
index a9a9125..a6607e1 100644
--- a/app/test-eventdev/evt_options.h
+++ b/app/test-eventdev/evt_options.h
@@ -58,8 +58,16 @@
 #define EVT_SCHED_TYPE_LIST      ("stlist")
 #define EVT_FWD_LATENCY          ("fwd_latency")
 #define EVT_QUEUE_PRIORITY       ("queue_priority")
+#define EVT_PROD_ETHDEV          ("prod_type_ethdev")
 #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_MAX,
+};
+
 struct evt_options {
 #define EVT_TEST_NAME_MAX_LEN     32
 	char test_name[EVT_TEST_NAME_MAX_LEN];
@@ -76,6 +84,7 @@ struct evt_options {
 	uint8_t dev_id;
 	uint32_t fwd_latency:1;
 	uint32_t q_priority:1;
+	enum evt_prod_type prod_type;
 };
 
 void evt_options_default(struct evt_options *opt);
@@ -266,4 +275,24 @@ evt_dump_sched_type_list(struct evt_options *opt)
 	evt_dump_end;
 }
 
+#define EVT_PROD_MAX_NAME_LEN 50
+static inline void
+evt_dump_producer_type(struct evt_options *opt)
+{
+	char name[EVT_PROD_MAX_NAME_LEN];
+
+	switch (opt->prod_type) {
+		default:
+		case EVT_PROD_TYPE_SYNT:
+			snprintf(name, EVT_PROD_MAX_NAME_LEN,
+					"Synthetic producer lcores");
+			break;
+		case EVT_PROD_TYPE_ETH_RX_ADPTR:
+			snprintf(name, EVT_PROD_MAX_NAME_LEN,
+					"Rx Adapter producers");
+			break;
+	}
+	evt_dump("prod_type", "%s", name);
+}
+
 #endif /* _EVT_OPTIONS_ */
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index e77b472..9d2865e 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -287,8 +287,10 @@ perf_opt_check(struct evt_options *opt, uint64_t nb_queues)
 {
 	unsigned int lcores;
 
-	/* N producer + N worker + 1 master */
-	lcores = 3;
+	/* N producer + N worker + 1 master when producer cores are used
+	 * Else N worker + 1 master when Rx adapter is used
+	 */
+	lcores = opt->prod_type == EVT_PROD_TYPE_SYNT ? 3 : 2;
 
 	if (rte_lcore_count() < lcores) {
 		evt_err("test need minimum %d lcores", lcores);
@@ -313,18 +315,21 @@ perf_opt_check(struct evt_options *opt, uint64_t nb_queues)
 		return -1;
 	}
 
-	/* Validate producer lcores */
-	if (evt_lcores_has_overlap(opt->plcores, rte_get_master_lcore())) {
-		evt_err("producer lcores overlaps with master lcore");
-		return -1;
-	}
-	if (evt_has_disabled_lcore(opt->plcores)) {
-		evt_err("one or more producer lcores are not enabled");
-		return -1;
-	}
-	if (!evt_has_active_lcore(opt->plcores)) {
-		evt_err("minimum one producer is required");
-		return -1;
+	if (opt->prod_type == EVT_PROD_TYPE_SYNT) {
+		/* Validate producer lcores */
+		if (evt_lcores_has_overlap(opt->plcores,
+					rte_get_master_lcore())) {
+			evt_err("producer lcores overlaps with master lcore");
+			return -1;
+		}
+		if (evt_has_disabled_lcore(opt->plcores)) {
+			evt_err("one or more producer lcores are not enabled");
+			return -1;
+		}
+		if (!evt_has_active_lcore(opt->plcores)) {
+			evt_err("minimum one producer is required");
+			return -1;
+		}
 	}
 
 	if (evt_has_invalid_stage(opt))
@@ -369,6 +374,7 @@ perf_opt_dump(struct evt_options *opt, uint8_t nb_queues)
 	evt_dump("nb_evdev_queues", "%d", nb_queues);
 	evt_dump_queue_priority(opt);
 	evt_dump_sched_type_list(opt);
+	evt_dump_producer_type(opt);
 }
 
 void
-- 
2.7.4

  reply	other threads:[~2017-10-18 12:40 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 ` Pavan Nikhilesh [this message]
2017-12-10  8:34   ` [dpdk-dev] [PATCH 1/8] app/eventdev: add ethernet device producer option 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   ` [dpdk-dev] [PATCH v3 2/8] app/eventdev: modify app setup to support ethdev Pavan Nikhilesh
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=1508330348-30060-2-git-send-email-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).