[v3,6/6] examples: use eventdev pre-scheduling

Message ID 20241001061411.2537-7-pbhagavatula@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series Introduce event pre-scheduling |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation fail Compilation issues
ci/github-robot: build fail github build: failed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-sample-apps-testing warning Testing issues
ci/iol-unit-amd64-testing warning Testing issues
ci/iol-compile-amd64-testing fail Testing issues
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Pavan Nikhilesh Bhagavatula Oct. 1, 2024, 6:14 a.m. UTC
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(+)
  

Patch

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");