[dpdk-dev] [PATCH 09/20] eventdev: add option to specify schedule mode for app stage
Anoob Joseph
anoob.joseph at caviumnetworks.com
Fri Jun 8 19:24:08 CEST 2018
Scheduling mode for each event queue is dependent on the same of app
stage. Configure event queue taking this also into account.
Signed-off-by: Anoob Joseph <anoob.joseph at caviumnetworks.com>
---
lib/librte_eventdev/rte_eventmode_helper.c | 23 ++++++++++++++++++++--
.../rte_eventmode_helper_internal.h | 10 ++++++++++
2 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/lib/librte_eventdev/rte_eventmode_helper.c b/lib/librte_eventdev/rte_eventmode_helper.c
index b3469f9..1c4d88d 100644
--- a/lib/librte_eventdev/rte_eventmode_helper.c
+++ b/lib/librte_eventdev/rte_eventmode_helper.c
@@ -103,6 +103,8 @@ em_parse_transfer_mode(struct rte_eventmode_helper_conf *conf,
static void
em_initialize_helper_conf(struct rte_eventmode_helper_conf *conf)
{
+ struct eventmode_conf *em_conf = NULL;
+
/* Set default conf */
/* Packet transfer mode: poll */
@@ -110,6 +112,12 @@ em_initialize_helper_conf(struct rte_eventmode_helper_conf *conf)
/* Keep all ethernet ports enabled by default */
conf->eth_portmask = -1;
+
+ /* Get eventmode conf */
+ em_conf = (struct eventmode_conf *)(conf->mode_params);
+
+ /* Stage 1 schedule type: atomic */
+ em_conf->ext_params.s1_sched_type = RTE_SCHED_TYPE_ATOMIC;
}
struct rte_eventmode_helper_conf *
@@ -249,8 +257,19 @@ rte_eventmode_helper_initialize_eventdev(struct eventmode_conf *em_conf)
eventq_conf.event_queue_cfg =
eventdev_config->ev_queue_mode;
- /* Set schedule type as ATOMIC */
- eventq_conf.schedule_type = RTE_SCHED_TYPE_ATOMIC;
+ /*
+ * All queues need to be set with sched_type as
+ * schedule type for the application stage. One queue
+ * would be reserved for the final eth tx stage. This
+ * will be an atomic queue.
+ */
+ if (j == nb_eventqueue-1) {
+ eventq_conf.schedule_type =
+ RTE_SCHED_TYPE_ATOMIC;
+ } else {
+ eventq_conf.schedule_type =
+ em_conf->ext_params.s1_sched_type;
+ }
/* Set max atomic flows to 1024 */
eventq_conf.nb_atomic_flows = 1024;
diff --git a/lib/librte_eventdev/rte_eventmode_helper_internal.h b/lib/librte_eventdev/rte_eventmode_helper_internal.h
index 36e2a5f..e9c1b4f 100644
--- a/lib/librte_eventdev/rte_eventmode_helper_internal.h
+++ b/lib/librte_eventdev/rte_eventmode_helper_internal.h
@@ -56,6 +56,16 @@ struct eventmode_conf {
struct rte_eventmode_helper_event_link_info
link[EVENT_MODE_MAX_LCORE_LINKS];
/**< Per link conf */
+ union {
+ struct {
+ uint64_t s1_sched_type : 2;
+ /**< Stage 1 schedule type */
+ uint64_t s2_sched_type : 2;
+ /**< Stage 2 schedule type */
+ };
+ uint64_t u64;
+ } ext_params;
+ /**< 64 bit field to specify extended params */
};
#endif /* _RTE_EVENTMODE_HELPER_INTERNAL_H_ */
--
2.7.4
More information about the dev
mailing list