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>, Radu Nicolau <radu.nicolau@intel.com>,
	"Akhil Goyal" <gakhil@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	"Pavan Nikhilesh" <pbhagavatula@marvell.com>
Cc: <dev@dpdk.org>
Subject: [PATCH v3 6/6] examples: use eventdev pre-scheduling
Date: Tue, 1 Oct 2024 11:44:11 +0530	[thread overview]
Message-ID: <20241001061411.2537-7-pbhagavatula@marvell.com> (raw)
In-Reply-To: <20241001061411.2537-1-pbhagavatula@marvell.com>

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Enable event pre-scheduling if supported by the event device.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/pipeline_worker_generic.c | 6 ++++++
 examples/eventdev_pipeline/pipeline_worker_tx.c      | 6 ++++++
 examples/ipsec-secgw/event_helper.c                  | 6 ++++++
 examples/l2fwd-event/l2fwd_event_generic.c           | 6 ++++++
 examples/l2fwd-event/l2fwd_event_internal_port.c     | 6 ++++++
 examples/l3fwd/l3fwd_event_generic.c                 | 6 ++++++
 examples/l3fwd/l3fwd_event_internal_port.c           | 6 ++++++
 7 files changed, 42 insertions(+)

diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c
index 783f68c91e..8052e2df86 100644
--- a/examples/eventdev_pipeline/pipeline_worker_generic.c
+++ b/examples/eventdev_pipeline/pipeline_worker_generic.c
@@ -188,6 +188,12 @@ setup_eventdev_generic(struct worker_data *worker_data)
 		config.nb_event_port_enqueue_depth =
 				dev_info.max_event_port_enqueue_depth;
 
+	if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE)
+		config.preschedule_type = RTE_EVENT_DEV_PRESCHEDULE;
+
+	if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE)
+		config.preschedule_type = RTE_EVENT_DEV_PRESCHEDULE_ADAPTIVE;
+
 	ret = rte_event_dev_configure(dev_id, &config);
 	if (ret < 0) {
 		printf("%d: Error configuring device\n", __LINE__);
diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c
index 98a52f3892..077b902bdb 100644
--- a/examples/eventdev_pipeline/pipeline_worker_tx.c
+++ b/examples/eventdev_pipeline/pipeline_worker_tx.c
@@ -505,6 +505,12 @@ setup_eventdev_worker_tx_enq(struct worker_data *worker_data)
 		config.nb_event_port_enqueue_depth =
 				dev_info.max_event_port_enqueue_depth;
 
+	if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE)
+		config.preschedule_type = RTE_EVENT_DEV_PRESCHEDULE;
+
+	if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE)
+		config.preschedule_type = RTE_EVENT_DEV_PRESCHEDULE_ADAPTIVE;
+
 	ret = rte_event_dev_configure(dev_id, &config);
 	if (ret < 0) {
 		printf("%d: Error configuring device\n", __LINE__);
diff --git a/examples/ipsec-secgw/event_helper.c b/examples/ipsec-secgw/event_helper.c
index 89fb7e62a5..61133607d6 100644
--- a/examples/ipsec-secgw/event_helper.c
+++ b/examples/ipsec-secgw/event_helper.c
@@ -669,6 +669,12 @@ eh_initialize_eventdev(struct eventmode_conf *em_conf)
 		eventdev_conf.nb_event_port_enqueue_depth =
 				evdev_default_conf.max_event_port_enqueue_depth;
 
+		if (evdev_default_conf.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE)
+			eventdev_conf.preschedule_type = RTE_EVENT_DEV_PRESCHEDULE;
+
+		if (evdev_default_conf.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE)
+			eventdev_conf.preschedule_type = RTE_EVENT_DEV_PRESCHEDULE_ADAPTIVE;
+
 		/* Configure event device */
 		ret = rte_event_dev_configure(eventdev_id, &eventdev_conf);
 		if (ret < 0) {
diff --git a/examples/l2fwd-event/l2fwd_event_generic.c b/examples/l2fwd-event/l2fwd_event_generic.c
index 1977e23261..d5a3cd9984 100644
--- a/examples/l2fwd-event/l2fwd_event_generic.c
+++ b/examples/l2fwd-event/l2fwd_event_generic.c
@@ -86,6 +86,12 @@ l2fwd_event_device_setup_generic(struct l2fwd_resources *rsrc)
 	evt_rsrc->has_burst = !!(dev_info.event_dev_cap &
 				    RTE_EVENT_DEV_CAP_BURST_MODE);
 
+	if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE)
+		event_d_conf.preschedule_type = RTE_EVENT_DEV_PRESCHEDULE;
+
+	if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE)
+		event_d_conf.preschedule_type = RTE_EVENT_DEV_PRESCHEDULE_ADAPTIVE;
+
 	ret = rte_event_dev_configure(event_d_id, &event_d_conf);
 	if (ret < 0)
 		rte_panic("Error in configuring event device\n");
diff --git a/examples/l2fwd-event/l2fwd_event_internal_port.c b/examples/l2fwd-event/l2fwd_event_internal_port.c
index 717a7bceb8..0b619afe91 100644
--- a/examples/l2fwd-event/l2fwd_event_internal_port.c
+++ b/examples/l2fwd-event/l2fwd_event_internal_port.c
@@ -82,6 +82,12 @@ l2fwd_event_device_setup_internal_port(struct l2fwd_resources *rsrc)
 	evt_rsrc->has_burst = !!(dev_info.event_dev_cap &
 				    RTE_EVENT_DEV_CAP_BURST_MODE);
 
+	if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE)
+		event_d_conf.preschedule_type = RTE_EVENT_DEV_PRESCHEDULE;
+
+	if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE)
+		event_d_conf.preschedule_type = RTE_EVENT_DEV_PRESCHEDULE_ADAPTIVE;
+
 	ret = rte_event_dev_configure(event_d_id, &event_d_conf);
 	if (ret < 0)
 		rte_panic("Error in configuring event device\n");
diff --git a/examples/l3fwd/l3fwd_event_generic.c b/examples/l3fwd/l3fwd_event_generic.c
index ddb6e5c38d..333c87b01c 100644
--- a/examples/l3fwd/l3fwd_event_generic.c
+++ b/examples/l3fwd/l3fwd_event_generic.c
@@ -74,6 +74,12 @@ l3fwd_event_device_setup_generic(void)
 	evt_rsrc->has_burst = !!(dev_info.event_dev_cap &
 				    RTE_EVENT_DEV_CAP_BURST_MODE);
 
+	if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE)
+		event_d_conf.preschedule_type = RTE_EVENT_DEV_PRESCHEDULE;
+
+	if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE)
+		event_d_conf.preschedule_type = RTE_EVENT_DEV_PRESCHEDULE_ADAPTIVE;
+
 	ret = rte_event_dev_configure(event_d_id, &event_d_conf);
 	if (ret < 0)
 		rte_panic("Error in configuring event device\n");
diff --git a/examples/l3fwd/l3fwd_event_internal_port.c b/examples/l3fwd/l3fwd_event_internal_port.c
index cb49a8b9fa..32354fc09f 100644
--- a/examples/l3fwd/l3fwd_event_internal_port.c
+++ b/examples/l3fwd/l3fwd_event_internal_port.c
@@ -73,6 +73,12 @@ l3fwd_event_device_setup_internal_port(void)
 	evt_rsrc->has_burst = !!(dev_info.event_dev_cap &
 				    RTE_EVENT_DEV_CAP_BURST_MODE);
 
+	if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE)
+		event_d_conf.preschedule_type = RTE_EVENT_DEV_PRESCHEDULE;
+
+	if (dev_info.event_dev_cap & RTE_EVENT_DEV_CAP_EVENT_PRESCHEDULE_ADAPTIVE)
+		event_d_conf.preschedule_type = RTE_EVENT_DEV_PRESCHEDULE_ADAPTIVE;
+
 	ret = rte_event_dev_configure(event_d_id, &event_d_conf);
 	if (ret < 0)
 		rte_panic("Error in configuring event device\n");
-- 
2.25.1


      parent reply	other threads:[~2024-10-01  6:15 UTC|newest]

Thread overview: 24+ 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     ` pbhagavatula [this message]

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=20241001061411.2537-7-pbhagavatula@marvell.com \
    --to=pbhagavatula@marvell.com \
    --cc=abdullah.sevincer@intel.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --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=radu.nicolau@intel.com \
    --cc=sachin.saxena@oss.nxp.com \
    --cc=skori@marvell.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).