DPDK patches and discussions
 help / color / mirror / Atom feed
From: <pbhagavatula@marvell.com>
To: <jerinj@marvell.com>, <sthotton@marvell.com>,
	<abdullah.sevincer@intel.com>, <hemant.agrawal@nxp.com>,
	<sachin.saxena@oss.nxp.com>, <harry.van.haaren@intel.com>,
	<mattias.ronnblom@ericsson.com>, <liangma@liangbit.com>,
	<peter.mccarthy@intel.com>
Cc: <dev@dpdk.org>, Pavan Nikhilesh <pbhagavatula@marvell.com>
Subject: [PATCH v5 5/6] app/test-eventdev: add pre-scheduling support
Date: Fri, 4 Oct 2024 21:54:50 +0530	[thread overview]
Message-ID: <20241004162451.6842-6-pbhagavatula@marvell.com> (raw)
In-Reply-To: <20241004162451.6842-1-pbhagavatula@marvell.com>

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add support to configure pre-scheduling for eventdev
test application.
Option `--preschedule`
  0 - Disable pre-scheduling.
  1 - Enable pre-scheduling.
  2 - Enable pre-schedule with adaptive mode (Default).

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 app/test-eventdev/evt_common.h    | 45 ++++++++++++++++++++++++-------
 app/test-eventdev/evt_options.c   | 17 ++++++++++++
 app/test-eventdev/evt_options.h   |  1 +
 doc/guides/tools/testeventdev.rst |  6 +++++
 4 files changed, 59 insertions(+), 10 deletions(-)

diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h
index dbe1e5c0c4..901b8ba55d 100644
--- a/app/test-eventdev/evt_common.h
+++ b/app/test-eventdev/evt_common.h
@@ -64,6 +64,8 @@ struct evt_options {
 	uint8_t nb_timer_adptrs;
 	uint8_t timdev_use_burst;
 	uint8_t per_port_pool;
+	uint8_t preschedule;
+	uint8_t preschedule_opted;
 	uint8_t sched_type_list[EVT_MAX_STAGES];
 	uint16_t mbuf_sz;
 	uint16_t wkr_deq_dep;
@@ -184,6 +186,30 @@ evt_configure_eventdev(struct evt_options *opt, uint8_t nb_queues,
 		return ret;
 	}
 
+	if (opt->preschedule_opted && opt->preschedule) {
+		switch (opt->preschedule) {
+		case RTE_EVENT_PRESCHEDULE_ADAPTIVE:
+			if (!(info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE)) {
+				evt_err("Preschedule type %d not supported", opt->preschedule);
+				return -EINVAL;
+			}
+			break;
+		case RTE_EVENT_PRESCHEDULE:
+			if (!(info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE)) {
+				evt_err("Preschedule type %d not supported", opt->preschedule);
+				return -EINVAL;
+			}
+			break;
+		default:
+			break;
+		}
+	}
+
+	if (!opt->preschedule_opted) {
+		if (info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE)
+			opt->preschedule = RTE_EVENT_PRESCHEDULE_ADAPTIVE;
+	}
+
 	if (opt->deq_tmo_nsec) {
 		if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) {
 			opt->deq_tmo_nsec = info.min_dequeue_timeout_ns;
@@ -198,16 +224,15 @@ evt_configure_eventdev(struct evt_options *opt, uint8_t nb_queues,
 	}
 
 	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_single_link_event_port_queues = 0,
-			.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,
+		.dequeue_timeout_ns = opt->deq_tmo_nsec,
+		.nb_event_queues = nb_queues,
+		.nb_event_ports = nb_ports,
+		.nb_single_link_event_port_queues = 0,
+		.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,
+		.preschedule_type = opt->preschedule,
 	};
 
 	return rte_event_dev_configure(opt->dev_id, &config);
diff --git a/app/test-eventdev/evt_options.c b/app/test-eventdev/evt_options.c
index fb5a0a255f..323d1e724d 100644
--- a/app/test-eventdev/evt_options.c
+++ b/app/test-eventdev/evt_options.c
@@ -130,6 +130,17 @@ evt_parse_tx_pkt_sz(struct evt_options *opt, const char *arg __rte_unused)
 	return ret;
 }
 
+static int
+evt_parse_preschedule(struct evt_options *opt, const char *arg __rte_unused)
+{
+	int ret;
+
+	ret = parser_read_uint8(&(opt->preschedule), arg);
+	opt->preschedule_opted = 1;
+
+	return ret;
+}
+
 static int
 evt_parse_timer_prod_type(struct evt_options *opt, const char *arg __rte_unused)
 {
@@ -510,6 +521,10 @@ usage(char *program)
 		"                       across all the ethernet devices before\n"
 		"                       event workers start.\n"
 		"\t--tx_pkt_sz        : Packet size to use with Tx first."
+		"\t--preschedule      : Pre-schedule type to use.\n"
+		"                       0 - disable pre-schedule\n"
+		"                       1 - pre-schedule\n"
+		"                       2 - pre-schedule adaptive (Default)\n"
 		);
 	printf("available tests:\n");
 	evt_test_dump_names();
@@ -598,6 +613,7 @@ static struct option lgopts[] = {
 	{ EVT_HELP,                0, 0, 0 },
 	{ EVT_TX_FIRST,            1, 0, 0 },
 	{ EVT_TX_PKT_SZ,           1, 0, 0 },
+	{ EVT_PRESCHEDULE,         1, 0, 0 },
 	{ NULL,                    0, 0, 0 }
 };
 
@@ -647,6 +663,7 @@ evt_opts_parse_long(int opt_idx, struct evt_options *opt)
 		{ EVT_PER_PORT_POOL, evt_parse_per_port_pool},
 		{ EVT_TX_FIRST, evt_parse_tx_first},
 		{ EVT_TX_PKT_SZ, evt_parse_tx_pkt_sz},
+		{ EVT_PRESCHEDULE, evt_parse_preschedule},
 	};
 
 	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 646060c7c6..18a893b704 100644
--- a/app/test-eventdev/evt_options.h
+++ b/app/test-eventdev/evt_options.h
@@ -59,6 +59,7 @@
 #define EVT_PER_PORT_POOL	 ("per_port_pool")
 #define EVT_TX_FIRST		 ("tx_first")
 #define EVT_TX_PKT_SZ		 ("tx_pkt_sz")
+#define EVT_PRESCHEDULE          ("preschedule")
 #define EVT_HELP                 ("help")
 
 void evt_options_default(struct evt_options *opt);
diff --git a/doc/guides/tools/testeventdev.rst b/doc/guides/tools/testeventdev.rst
index 00eb702571..38e2ec0c36 100644
--- a/doc/guides/tools/testeventdev.rst
+++ b/doc/guides/tools/testeventdev.rst
@@ -236,6 +236,12 @@ The following are the application command-line options:
        Packet size to use for `--tx_first`.
        Only applicable for `pipeline_atq` and `pipeline_queue` tests.
 
+* ``--preschedule``
+
+       Enable pre-scheduling of events.
+       0 - Disable pre-scheduling.
+       1 - Enable pre-scheduling.
+       2 - Enable pre-schedule with adaptive mode (Default).
 
 Eventdev Tests
 --------------
-- 
2.25.1


  parent reply	other threads:[~2024-10-04 16:26 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10  8:31 [RFC 0/3] Introduce event prefetching pbhagavatula
2024-09-10  8:31 ` [RFC 1/3] eventdev: introduce " pbhagavatula
2024-09-10  8:31 ` [RFC 2/3] eventdev: allow event ports to modified prefetches pbhagavatula
2024-09-10  8:31 ` [RFC 3/3] eventdev: add SW event prefetch hint pbhagavatula
2024-09-10  9:08 ` [RFC 0/3] Introduce event prefetching Mattias Rönnblom
2024-09-10 11:53   ` [EXTERNAL] " Pavan Nikhilesh Bhagavatula
2024-09-17  7:11 ` [PATCH v2 0/3] Introduce event pre-scheduling pbhagavatula
2024-09-17  7:11   ` [PATCH v2 1/3] eventdev: introduce " pbhagavatula
2024-09-18 22:38     ` Pathak, Pravin
2024-09-19 13:13       ` Pavan Nikhilesh Bhagavatula
2024-09-23  8:57         ` Mattias Rönnblom
2024-09-25 10:30           ` [EXTERNAL] " Pavan Nikhilesh Bhagavatula
2024-09-26  2:54             ` Pathak, Pravin
2024-09-26 10:03               ` Pavan Nikhilesh Bhagavatula
2024-09-27  3:31                 ` Pathak, Pravin
2024-09-17  7:11   ` [PATCH v2 2/3] eventdev: add event port pre-schedule modify pbhagavatula
2024-09-17  7:11   ` [PATCH v2 3/3] eventdev: add SW event preschedule hint pbhagavatula
2024-10-01  6:14   ` [PATCH v3 0/6] Introduce event pre-scheduling pbhagavatula
2024-10-01  6:14     ` [PATCH v3 1/6] eventdev: introduce " pbhagavatula
2024-10-01  6:14     ` [PATCH v3 2/6] eventdev: add event port pre-schedule modify pbhagavatula
2024-10-01  6:14     ` [PATCH v3 3/6] eventdev: add SW event preschedule hint pbhagavatula
2024-10-01  6:14     ` [PATCH v3 4/6] event/cnkx: add pre-schedule support pbhagavatula
2024-10-01  6:14     ` [PATCH v3 5/6] app/test-eventdev: add pre-scheduling support pbhagavatula
2024-10-01  6:14     ` [PATCH v3 6/6] examples: use eventdev pre-scheduling pbhagavatula
2024-10-01 13:18     ` [PATCH v4 0/6] Introduce event pre-scheduling pbhagavatula
2024-10-01 13:18       ` [PATCH v4 1/6] eventdev: introduce " pbhagavatula
2024-10-04  4:47         ` Jerin Jacob
2024-10-01 13:18       ` [PATCH v4 2/6] eventdev: add event port pre-schedule modify pbhagavatula
2024-10-04  5:02         ` Jerin Jacob
2024-10-01 13:18       ` [PATCH v4 3/6] eventdev: add SW event preschedule hint pbhagavatula
2024-10-04  5:14         ` Jerin Jacob
2024-10-01 13:18       ` [PATCH v4 4/6] event/cnkx: add pre-schedule support pbhagavatula
2024-10-01 13:19       ` [PATCH v4 5/6] app/test-eventdev: add pre-scheduling support pbhagavatula
2024-10-01 13:19       ` [PATCH v4 6/6] examples: use eventdev pre-scheduling pbhagavatula
2024-10-01 15:33       ` [PATCH v4 0/6] Introduce event pre-scheduling Stephen Hemminger
2024-10-03  5:46         ` [EXTERNAL] " Pavan Nikhilesh Bhagavatula
2024-10-04 16:24       ` [PATCH v5 " pbhagavatula
2024-10-04 16:24         ` [PATCH v5 1/6] eventdev: introduce " pbhagavatula
2024-10-04 16:24         ` [PATCH v5 2/6] eventdev: add event port pre-schedule modify pbhagavatula
2024-10-04 16:24         ` [PATCH v5 3/6] eventdev: add event preschedule hint pbhagavatula
2024-10-04 16:24         ` [PATCH v5 4/6] event/cnkx: add pre-schedule support pbhagavatula
2024-10-04 16:24         ` pbhagavatula [this message]
2024-10-04 16:24         ` [PATCH v5 6/6] examples: use eventdev pre-scheduling pbhagavatula
2024-10-04 16:35         ` [PATCH v5 0/6] Introduce event pre-scheduling Stephen Hemminger
2024-10-04 16:50           ` [EXTERNAL] " Pavan Nikhilesh Bhagavatula
2024-10-05  7:25         ` [PATCH v6 " pbhagavatula
2024-10-05  7:25           ` [PATCH v6 1/6] eventdev: introduce " pbhagavatula
2024-10-05  7:25           ` [PATCH v6 2/6] eventdev: add event port pre-schedule modify pbhagavatula
2024-10-05  7:25           ` [PATCH v6 3/6] eventdev: add event preschedule hint pbhagavatula
2024-10-05  7:25           ` [PATCH v6 4/6] event/cnkx: add pre-schedule support pbhagavatula
2024-10-05  7:25           ` [PATCH v6 5/6] app/test-eventdev: add pre-scheduling support pbhagavatula
2024-10-05  7:26           ` [PATCH v6 6/6] examples: use eventdev pre-scheduling pbhagavatula
2024-10-05  7:59           ` [PATCH v7 0/6] Introduce event pre-scheduling pbhagavatula
2024-10-05  7:59             ` [PATCH v7 1/6] eventdev: introduce " pbhagavatula
2024-10-05 16:11               ` Stephen Hemminger
2024-10-06 17:03                 ` [EXTERNAL] " Pavan Nikhilesh Bhagavatula
2024-10-05  7:59             ` [PATCH v7 2/6] eventdev: add event port pre-schedule modify pbhagavatula
2024-10-05  7:59             ` [PATCH v7 3/6] eventdev: add event preschedule hint pbhagavatula
2024-10-05  7:59             ` [PATCH v7 4/6] event/cnkx: add pre-schedule support pbhagavatula
2024-10-05  8:00             ` [PATCH v7 5/6] app/test-eventdev: add pre-scheduling support pbhagavatula
2024-10-05  8:00             ` [PATCH v7 6/6] examples: use eventdev pre-scheduling pbhagavatula
2024-10-06 17:06             ` [PATCH v8 0/6] Introduce event pre-scheduling pbhagavatula
2024-10-06 17:06               ` [PATCH v8 1/6] eventdev: introduce " pbhagavatula
2024-10-06 17:06               ` [PATCH v8 2/6] eventdev: add event port pre-schedule modify pbhagavatula
2024-10-06 17:06               ` [PATCH v8 3/6] eventdev: add event preschedule hint pbhagavatula
2024-10-07 12:24                 ` Jerin Jacob
2024-10-06 17:06               ` [PATCH v8 4/6] event/cnkx: add pre-schedule support pbhagavatula
2024-10-06 17:06               ` [PATCH v8 5/6] app/test-eventdev: add pre-scheduling support pbhagavatula
2024-10-06 17:06               ` [PATCH v8 6/6] examples: use eventdev pre-scheduling pbhagavatula
2024-10-07 13:09               ` [PATCH v9 0/6] Introduce event pre-scheduling pbhagavatula
2024-10-07 13:09                 ` [PATCH v9 1/6] eventdev: introduce " pbhagavatula
2024-10-07 13:09                 ` [PATCH v9 2/6] eventdev: add event port pre-schedule modify pbhagavatula
2024-10-07 13:09                 ` [PATCH v9 3/6] eventdev: add event preschedule hint pbhagavatula
2024-10-07 13:09                 ` [PATCH v9 4/6] event/cnkx: add pre-schedule support pbhagavatula
2024-10-07 13:09                 ` [PATCH v9 5/6] app/test-eventdev: add pre-scheduling support pbhagavatula
2024-10-07 13:09                 ` [PATCH v9 6/6] examples: use eventdev pre-scheduling pbhagavatula
2024-10-08  5:17                 ` [PATCH v9 0/6] Introduce event pre-scheduling 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=20241004162451.6842-6-pbhagavatula@marvell.com \
    --to=pbhagavatula@marvell.com \
    --cc=abdullah.sevincer@intel.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerinj@marvell.com \
    --cc=liangma@liangbit.com \
    --cc=mattias.ronnblom@ericsson.com \
    --cc=peter.mccarthy@intel.com \
    --cc=sachin.saxena@oss.nxp.com \
    --cc=sthotton@marvell.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).