DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config
@ 2017-10-12 13:15 Pavan Nikhilesh
  2017-10-12 13:15 ` [dpdk-dev] [PATCH 2/3] eventdev: extend queue attribute get function Pavan Nikhilesh
                   ` (5 more replies)
  0 siblings, 6 replies; 27+ messages in thread
From: Pavan Nikhilesh @ 2017-10-12 13:15 UTC (permalink / raw)
  To: jerin.jacob, hemant.agrawal, harry.van.haaren; +Cc: dev, Pavan Nikhilesh

With the current scheme of event queue configuration the cfg schedule
type macros (RTE_EVENT_QUEUE_CFG_*_ONLY) are inconsistent with the
event schedule type (RTE_SCHED_TYPE_*) this requires unnecessary
conversion between the fastpath and slowpath API's while scheduling
events or configuring event queues.

This patch aims to fix such inconsistency by using event schedule
types (RTE_SCHED_TYPE_*) for event queue configuration.

This patch also fixes example/eventdev_pipeline_sw_pmd as it doesn't
convert RTE_EVENT_QUEUE_CFG_*_ONLY to RTE_SCHED_TYPE_* which leads to
improper events being enqueued to the eventdev.

Fixes: adb5d5486c39 ("examples/eventdev_pipeline_sw_pmd: add sample app")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 app/test-eventdev/evt_common.h           | 21 -------------
 app/test-eventdev/test_order_queue.c     |  4 +--
 app/test-eventdev/test_perf_queue.c      |  4 +--
 drivers/event/dpaa2/dpaa2_eventdev.c     |  4 +--
 drivers/event/sw/sw_evdev.c              | 28 +++++------------
 examples/eventdev_pipeline_sw_pmd/main.c | 18 +++++------
 lib/librte_eventdev/rte_eventdev.c       | 20 +++++-------
 lib/librte_eventdev/rte_eventdev.h       | 54 ++++++++++----------------------
 test/test/test_eventdev.c                | 12 +++----
 test/test/test_eventdev_sw.c             | 16 +++++-----
 10 files changed, 60 insertions(+), 121 deletions(-)

diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h
index 4102076..ee896a2 100644
--- a/app/test-eventdev/evt_common.h
+++ b/app/test-eventdev/evt_common.h
@@ -92,25 +92,4 @@ evt_has_all_types_queue(uint8_t dev_id)
 			true : false;
 }
 
-static inline uint32_t
-evt_sched_type2queue_cfg(uint8_t sched_type)
-{
-	uint32_t ret;
-
-	switch (sched_type) {
-	case RTE_SCHED_TYPE_ATOMIC:
-		ret = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY;
-		break;
-	case RTE_SCHED_TYPE_ORDERED:
-		ret = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY;
-		break;
-	case RTE_SCHED_TYPE_PARALLEL:
-		ret = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
-		break;
-	default:
-		rte_panic("Invalid sched_type %d\n", sched_type);
-	}
-	return ret;
-}
-
 #endif /*  _EVT_COMMON_*/
diff --git a/app/test-eventdev/test_order_queue.c b/app/test-eventdev/test_order_queue.c
index beadd9c..1fa4082 100644
--- a/app/test-eventdev/test_order_queue.c
+++ b/app/test-eventdev/test_order_queue.c
@@ -164,7 +164,7 @@ order_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	/* q0 (ordered queue) configuration */
 	struct rte_event_queue_conf q0_ordered_conf = {
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ORDERED,
 			.nb_atomic_flows = opt->nb_flows,
 			.nb_atomic_order_sequences = opt->nb_flows,
 	};
@@ -177,7 +177,7 @@ order_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	/* q1 (atomic queue) configuration */
 	struct rte_event_queue_conf q1_atomic_conf = {
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 			.nb_atomic_flows = opt->nb_flows,
 			.nb_atomic_order_sequences = opt->nb_flows,
 	};
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index 658c08a..28c2096 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -205,8 +205,8 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	};
 	/* queue configurations */
 	for (queue = 0; queue < perf_queue_nb_event_queues(opt); queue++) {
-		q_conf.event_queue_cfg =  evt_sched_type2queue_cfg
-				(opt->sched_type_list[queue % nb_stages]);
+		q_conf.event_queue_cfg =
+			(opt->sched_type_list[queue % nb_stages]);
 
 		if (opt->q_priority) {
 			uint8_t stage_pos = queue % nb_stages;
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 81286a8..3dbc337 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -378,8 +378,8 @@ dpaa2_eventdev_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id,
 	RTE_SET_USED(queue_conf);
 
 	queue_conf->nb_atomic_flows = DPAA2_EVENT_QUEUE_ATOMIC_FLOWS;
-	queue_conf->event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY |
-				      RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
+	queue_conf->schedule_type = RTE_SCHED_TYPE_ATOMIC |
+				      RTE_SCHED_TYPE_PARALLEL;
 	queue_conf->priority = RTE_EVENT_DEV_PRIORITY_NORMAL;
 }
 
diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index aed8b72..522cd71 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -345,28 +345,14 @@ sw_queue_setup(struct rte_eventdev *dev, uint8_t queue_id,
 {
 	int type;
 
-	/* SINGLE_LINK can be OR-ed with other types, so handle first */
+	type = conf->schedule_type;
+
 	if (RTE_EVENT_QUEUE_CFG_SINGLE_LINK & conf->event_queue_cfg) {
 		type = SW_SCHED_TYPE_DIRECT;
-	} else {
-		switch (conf->event_queue_cfg) {
-		case RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY:
-			type = RTE_SCHED_TYPE_ATOMIC;
-			break;
-		case RTE_EVENT_QUEUE_CFG_ORDERED_ONLY:
-			type = RTE_SCHED_TYPE_ORDERED;
-			break;
-		case RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY:
-			type = RTE_SCHED_TYPE_PARALLEL;
-			break;
-		case RTE_EVENT_QUEUE_CFG_ALL_TYPES:
-			SW_LOG_ERR("QUEUE_CFG_ALL_TYPES not supported\n");
-			return -ENOTSUP;
-		default:
-			SW_LOG_ERR("Unknown queue type %d requested\n",
-				   conf->event_queue_cfg);
-			return -EINVAL;
-		}
+	} else if (RTE_EVENT_QUEUE_CFG_ALL_TYPES
+			& conf->event_queue_cfg) {
+		SW_LOG_ERR("QUEUE_CFG_ALL_TYPES not supported\n");
+		return -ENOTSUP;
 	}
 
 	struct sw_evdev *sw = sw_pmd_priv(dev);
@@ -400,7 +386,7 @@ sw_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id,
 	static const struct rte_event_queue_conf default_conf = {
 		.nb_atomic_flows = 4096,
 		.nb_atomic_order_sequences = 1,
-		.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+		.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 		.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 	};
 
diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c
index 09b90c3..2e6787b 100644
--- a/examples/eventdev_pipeline_sw_pmd/main.c
+++ b/examples/eventdev_pipeline_sw_pmd/main.c
@@ -108,7 +108,7 @@ struct config_data {
 static struct config_data cdata = {
 	.num_packets = (1L << 25), /* do ~32M packets */
 	.num_fids = 512,
-	.queue_type = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+	.queue_type = RTE_SCHED_TYPE_ATOMIC,
 	.next_qid = {-1},
 	.qid = {-1},
 	.num_stages = 1,
@@ -490,10 +490,10 @@ parse_app_args(int argc, char **argv)
 			cdata.enable_queue_priorities = 1;
 			break;
 		case 'o':
-			cdata.queue_type = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY;
+			cdata.queue_type = RTE_SCHED_TYPE_ORDERED;
 			break;
 		case 'p':
-			cdata.queue_type = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
+			cdata.queue_type = RTE_SCHED_TYPE_PARALLEL;
 			break;
 		case 'q':
 			cdata.quiet = 1;
@@ -684,7 +684,7 @@ setup_eventdev(struct prod_data *prod_data,
 			.new_event_threshold = 4096,
 	};
 	struct rte_event_queue_conf wkr_q_conf = {
-			.event_queue_cfg = cdata.queue_type,
+			.schedule_type = cdata.queue_type,
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 			.nb_atomic_flows = 1024,
 			.nb_atomic_order_sequences = 1024,
@@ -751,11 +751,11 @@ setup_eventdev(struct prod_data *prod_data,
 		}
 
 		const char *type_str = "Atomic";
-		switch (wkr_q_conf.event_queue_cfg) {
-		case RTE_EVENT_QUEUE_CFG_ORDERED_ONLY:
+		switch (wkr_q_conf.schedule_type) {
+		case RTE_SCHED_TYPE_ORDERED:
 			type_str = "Ordered";
 			break;
-		case RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY:
+		case RTE_SCHED_TYPE_PARALLEL:
 			type_str = "Parallel";
 			break;
 		}
@@ -907,9 +907,9 @@ main(int argc, char **argv)
 		printf("\tworkers: %u\n", cdata.num_workers);
 		printf("\tpackets: %"PRIi64"\n", cdata.num_packets);
 		printf("\tQueue-prio: %u\n", cdata.enable_queue_priorities);
-		if (cdata.queue_type == RTE_EVENT_QUEUE_CFG_ORDERED_ONLY)
+		if (cdata.queue_type == RTE_SCHED_TYPE_ORDERED)
 			printf("\tqid0 type: ordered\n");
-		if (cdata.queue_type == RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY)
+		if (cdata.queue_type == RTE_SCHED_TYPE_ATOMIC)
 			printf("\tqid0 type: atomic\n");
 		printf("\tCores available: %u\n", rte_lcore_count());
 		printf("\tCores used: %u\n", cores_needed);
diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
index 378ccb5..db96552 100644
--- a/lib/librte_eventdev/rte_eventdev.c
+++ b/lib/librte_eventdev/rte_eventdev.c
@@ -517,13 +517,11 @@ is_valid_atomic_queue_conf(const struct rte_event_queue_conf *queue_conf)
 {
 	if (queue_conf &&
 		!(queue_conf->event_queue_cfg &
-		  RTE_EVENT_QUEUE_CFG_SINGLE_LINK) && (
+		  RTE_EVENT_QUEUE_CFG_SINGLE_LINK) &&
 		((queue_conf->event_queue_cfg &
-			RTE_EVENT_QUEUE_CFG_TYPE_MASK)
-			== RTE_EVENT_QUEUE_CFG_ALL_TYPES) ||
-		((queue_conf->event_queue_cfg &
-			RTE_EVENT_QUEUE_CFG_TYPE_MASK)
-			== RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY)
+			 RTE_EVENT_QUEUE_CFG_ALL_TYPES) ||
+		(queue_conf->schedule_type
+			== RTE_SCHED_TYPE_ATOMIC)
 		))
 		return 1;
 	else
@@ -535,13 +533,11 @@ is_valid_ordered_queue_conf(const struct rte_event_queue_conf *queue_conf)
 {
 	if (queue_conf &&
 		!(queue_conf->event_queue_cfg &
-		  RTE_EVENT_QUEUE_CFG_SINGLE_LINK) && (
-		((queue_conf->event_queue_cfg &
-			RTE_EVENT_QUEUE_CFG_TYPE_MASK)
-			== RTE_EVENT_QUEUE_CFG_ALL_TYPES) ||
+		  RTE_EVENT_QUEUE_CFG_SINGLE_LINK) &&
 		((queue_conf->event_queue_cfg &
-			RTE_EVENT_QUEUE_CFG_TYPE_MASK)
-			== RTE_EVENT_QUEUE_CFG_ORDERED_ONLY)
+			 RTE_EVENT_QUEUE_CFG_ALL_TYPES) ||
+		(queue_conf->schedule_type
+			== RTE_SCHED_TYPE_ORDERED)
 		))
 		return 1;
 	else
diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
index 1dbc872..fa16f82 100644
--- a/lib/librte_eventdev/rte_eventdev.h
+++ b/lib/librte_eventdev/rte_eventdev.h
@@ -270,9 +270,9 @@ struct rte_mbuf; /* we just use mbuf pointers; no need to include rte_mbuf.h */
 #define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES     (1ULL << 3)
 /**< Event device is capable of enqueuing events of any type to any queue.
  * If this capability is not set, the queue only supports events of the
- *  *RTE_EVENT_QUEUE_CFG_* type that it was created with.
+ *  *RTE_SCHED_TYPE_* type that it was created with.
  *
- * @see RTE_EVENT_QUEUE_CFG_* values
+ * @see RTE_SCHED_TYPE_* values
  */
 #define RTE_EVENT_DEV_CAP_BURST_MODE          (1ULL << 4)
 /**< Event device is capable of operating in burst mode for enqueue(forward,
@@ -515,39 +515,13 @@ rte_event_dev_configure(uint8_t dev_id,
 /* Event queue specific APIs */
 
 /* Event queue configuration bitmap flags */
-#define RTE_EVENT_QUEUE_CFG_TYPE_MASK          (3ULL << 0)
-/**< Mask for event queue schedule type configuration request */
-#define RTE_EVENT_QUEUE_CFG_ALL_TYPES          (0ULL << 0)
+#define RTE_EVENT_QUEUE_CFG_ALL_TYPES          (1ULL << 0)
 /**< Allow ATOMIC,ORDERED,PARALLEL schedule type enqueue
  *
  * @see RTE_SCHED_TYPE_ORDERED, RTE_SCHED_TYPE_ATOMIC, RTE_SCHED_TYPE_PARALLEL
  * @see rte_event_enqueue_burst()
  */
-#define RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY        (1ULL << 0)
-/**< Allow only ATOMIC schedule type enqueue
- *
- * The rte_event_enqueue_burst() result is undefined if the queue configured
- * with ATOMIC only and sched_type != RTE_SCHED_TYPE_ATOMIC
- *
- * @see RTE_SCHED_TYPE_ATOMIC, rte_event_enqueue_burst()
- */
-#define RTE_EVENT_QUEUE_CFG_ORDERED_ONLY       (2ULL << 0)
-/**< Allow only ORDERED schedule type enqueue
- *
- * The rte_event_enqueue_burst() result is undefined if the queue configured
- * with ORDERED only and sched_type != RTE_SCHED_TYPE_ORDERED
- *
- * @see RTE_SCHED_TYPE_ORDERED, rte_event_enqueue_burst()
- */
-#define RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY      (3ULL << 0)
-/**< Allow only PARALLEL schedule type enqueue
- *
- * The rte_event_enqueue_burst() result is undefined if the queue configured
- * with PARALLEL only and sched_type != RTE_SCHED_TYPE_PARALLEL
- *
- * @see RTE_SCHED_TYPE_PARALLEL, rte_event_enqueue_burst()
- */
-#define RTE_EVENT_QUEUE_CFG_SINGLE_LINK        (1ULL << 2)
+#define RTE_EVENT_QUEUE_CFG_SINGLE_LINK        (1ULL << 1)
 /**< This event queue links only to a single event port.
  *
  *  @see rte_event_port_setup(), rte_event_port_link()
@@ -558,8 +532,8 @@ struct rte_event_queue_conf {
 	uint32_t nb_atomic_flows;
 	/**< The maximum number of active flows this queue can track at any
 	 * given time. If the queue is configured for atomic scheduling (by
-	 * applying the RTE_EVENT_QUEUE_CFG_ALL_TYPES or
-	 * RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY flags to event_queue_cfg), then the
+	 * applying the RTE_EVENT_QUEUE_CFG_ALL_TYPES flag to event_queue_cfg
+	 * or RTE_SCHED_TYPE_ATOMIC flag to schedule_type), then the
 	 * value must be in the range of [1, nb_event_queue_flows], which was
 	 * previously provided in rte_event_dev_configure().
 	 */
@@ -572,12 +546,18 @@ struct rte_event_queue_conf {
 	 * event will be returned from dequeue until one or more entries are
 	 * freed up/released.
 	 * If the queue is configured for ordered scheduling (by applying the
-	 * RTE_EVENT_QUEUE_CFG_ALL_TYPES or RTE_EVENT_QUEUE_CFG_ORDERED_ONLY
-	 * flags to event_queue_cfg), then the value must be in the range of
-	 * [1, nb_event_queue_flows], which was previously supplied to
-	 * rte_event_dev_configure().
+	 * RTE_EVENT_QUEUE_CFG_ALL_TYPES flag to event_queue_cfg or
+	 * RTE_SCHED_TYPE_ORDERED flag to schedule_type), then the value must
+	 * be in the range of [1, nb_event_queue_flows], which was
+	 * previously supplied to rte_event_dev_configure().
+	 */
+	uint32_t event_queue_cfg;
+	/**< Queue cfg flags(EVENT_QUEUE_CFG_) */
+	uint8_t schedule_type;
+	/**< Queue schedule type(RTE_SCHED_TYPE_*).
+	 * Valid when RTE_EVENT_QUEUE_CFG_ALL_TYPES bit is not set in
+	 * event_queue_cfg.
 	 */
-	uint32_t event_queue_cfg; /**< Queue cfg flags(EVENT_QUEUE_CFG_) */
 	uint8_t priority;
 	/**< Priority for this event queue relative to other event queues.
 	 * The requested priority should in the range of
diff --git a/test/test/test_eventdev.c b/test/test/test_eventdev.c
index d6ade78..4118b75 100644
--- a/test/test/test_eventdev.c
+++ b/test/test/test_eventdev.c
@@ -300,15 +300,13 @@ test_eventdev_queue_setup(void)
 	/* Negative cases */
 	ret = rte_event_queue_default_conf_get(TEST_DEV_ID, 0, &qconf);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get queue0 info");
-	qconf.event_queue_cfg =	(RTE_EVENT_QUEUE_CFG_ALL_TYPES &
-		 RTE_EVENT_QUEUE_CFG_TYPE_MASK);
+	qconf.event_queue_cfg =	RTE_EVENT_QUEUE_CFG_ALL_TYPES;
 	qconf.nb_atomic_flows = info.max_event_queue_flows + 1;
 	ret = rte_event_queue_setup(TEST_DEV_ID, 0, &qconf);
 	TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret);
 
 	qconf.nb_atomic_flows = info.max_event_queue_flows;
-	qconf.event_queue_cfg =	(RTE_EVENT_QUEUE_CFG_ORDERED_ONLY &
-		 RTE_EVENT_QUEUE_CFG_TYPE_MASK);
+	qconf.schedule_type = RTE_SCHED_TYPE_ORDERED;
 	qconf.nb_atomic_order_sequences = info.max_event_queue_flows + 1;
 	ret = rte_event_queue_setup(TEST_DEV_ID, 0, &qconf);
 	TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret);
@@ -423,7 +421,7 @@ test_eventdev_queue_attr_nb_atomic_flows(void)
 		/* Assume PMD doesn't support atomic flows, return early */
 		return -ENOTSUP;
 
-	qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY;
+	qconf.schedule_type = RTE_SCHED_TYPE_ATOMIC;
 
 	for (i = 0; i < (int)queue_count; i++) {
 		ret = rte_event_queue_setup(TEST_DEV_ID, i, &qconf);
@@ -466,7 +464,7 @@ test_eventdev_queue_attr_nb_atomic_order_sequences(void)
 		/* Assume PMD doesn't support reordering */
 		return -ENOTSUP;
 
-	qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY;
+	qconf.schedule_type = RTE_SCHED_TYPE_ORDERED;
 
 	for (i = 0; i < (int)queue_count; i++) {
 		ret = rte_event_queue_setup(TEST_DEV_ID, i, &qconf);
@@ -507,7 +505,7 @@ test_eventdev_queue_attr_event_queue_cfg(void)
 	ret = rte_event_queue_default_conf_get(TEST_DEV_ID, 0, &qconf);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get queue0 def conf");
 
-	qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
+	qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_SINGLE_LINK;
 
 	for (i = 0; i < (int)queue_count; i++) {
 		ret = rte_event_queue_setup(TEST_DEV_ID, i, &qconf);
diff --git a/test/test/test_eventdev_sw.c b/test/test/test_eventdev_sw.c
index 7219886..dea302f 100644
--- a/test/test/test_eventdev_sw.c
+++ b/test/test/test_eventdev_sw.c
@@ -219,7 +219,7 @@ create_lb_qids(struct test *t, int num_qids, uint32_t flags)
 
 	/* Q creation */
 	const struct rte_event_queue_conf conf = {
-			.event_queue_cfg = flags,
+			.schedule_type = flags,
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 			.nb_atomic_flows = 1024,
 			.nb_atomic_order_sequences = 1024,
@@ -242,20 +242,20 @@ create_lb_qids(struct test *t, int num_qids, uint32_t flags)
 static inline int
 create_atomic_qids(struct test *t, int num_qids)
 {
-	return create_lb_qids(t, num_qids, RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY);
+	return create_lb_qids(t, num_qids, RTE_SCHED_TYPE_ATOMIC);
 }
 
 static inline int
 create_ordered_qids(struct test *t, int num_qids)
 {
-	return create_lb_qids(t, num_qids, RTE_EVENT_QUEUE_CFG_ORDERED_ONLY);
+	return create_lb_qids(t, num_qids, RTE_SCHED_TYPE_ORDERED);
 }
 
 
 static inline int
 create_unordered_qids(struct test *t, int num_qids)
 {
-	return create_lb_qids(t, num_qids, RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY);
+	return create_lb_qids(t, num_qids, RTE_SCHED_TYPE_PARALLEL);
 }
 
 static inline int
@@ -1238,7 +1238,7 @@ port_reconfig_credits(struct test *t)
 	const uint32_t NUM_ITERS = 32;
 	for (i = 0; i < NUM_ITERS; i++) {
 		const struct rte_event_queue_conf conf = {
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 			.nb_atomic_flows = 1024,
 			.nb_atomic_order_sequences = 1024,
@@ -1320,7 +1320,7 @@ port_single_lb_reconfig(struct test *t)
 
 	static const struct rte_event_queue_conf conf_lb_atomic = {
 		.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
-		.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+		.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 		.nb_atomic_flows = 1024,
 		.nb_atomic_order_sequences = 1024,
 	};
@@ -1818,7 +1818,7 @@ ordered_reconfigure(struct test *t)
 	}
 
 	const struct rte_event_queue_conf conf = {
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ORDERED,
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 			.nb_atomic_flows = 1024,
 			.nb_atomic_order_sequences = 1024,
@@ -1865,7 +1865,7 @@ qid_priorities(struct test *t)
 	for (i = 0; i < 3; i++) {
 		/* Create QID */
 		const struct rte_event_queue_conf conf = {
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 			/* increase priority (0 == highest), as we go */
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL - i,
 			.nb_atomic_flows = 1024,
-- 
2.7.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH 2/3] eventdev: extend queue attribute get function
  2017-10-12 13:15 [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config Pavan Nikhilesh
@ 2017-10-12 13:15 ` Pavan Nikhilesh
  2017-10-12 13:15 ` [dpdk-dev] [PATCH 3/3] doc: update eventdev programmers guide Pavan Nikhilesh
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 27+ messages in thread
From: Pavan Nikhilesh @ 2017-10-12 13:15 UTC (permalink / raw)
  To: jerin.jacob, hemant.agrawal, harry.van.haaren; +Cc: dev, Pavan Nikhilesh

Add schedule type queue attribute so that it can be queried along with
the queue config structure.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 lib/librte_eventdev/rte_eventdev.c | 3 +++
 lib/librte_eventdev/rte_eventdev.h | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
index db96552..bf2ec61 100644
--- a/lib/librte_eventdev/rte_eventdev.c
+++ b/lib/librte_eventdev/rte_eventdev.c
@@ -809,6 +809,9 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
 	case RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG:
 		*attr_value = conf->event_queue_cfg;
 		break;
+	case RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE:
+		*attr_value = conf->schedule_type;
+		break;
 	default:
 		return -EINVAL;
 	};
diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
index fa16f82..b5cc29a 100644
--- a/lib/librte_eventdev/rte_eventdev.h
+++ b/lib/librte_eventdev/rte_eventdev.h
@@ -632,6 +632,10 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,
  * The cfg flags for the queue.
  */
 #define RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG 3
+/**
+ * The schedule type of the queue.
+ */
+#define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4
 
 /**
  * Get an attribute from a queue.
-- 
2.7.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev]  [PATCH 3/3] doc: update eventdev programmers guide
  2017-10-12 13:15 [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config Pavan Nikhilesh
  2017-10-12 13:15 ` [dpdk-dev] [PATCH 2/3] eventdev: extend queue attribute get function Pavan Nikhilesh
@ 2017-10-12 13:15 ` Pavan Nikhilesh
  2017-10-20  9:54 ` [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config Van Haaren, Harry
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 27+ messages in thread
From: Pavan Nikhilesh @ 2017-10-12 13:15 UTC (permalink / raw)
  To: jerin.jacob, hemant.agrawal, harry.van.haaren; +Cc: dev, Pavan Nikhilesh

Update the guide with event queue configuration and event enqueue
operation.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 doc/guides/prog_guide/eventdev.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/guides/prog_guide/eventdev.rst b/doc/guides/prog_guide/eventdev.rst
index 908d123..be9fccd 100644
--- a/doc/guides/prog_guide/eventdev.rst
+++ b/doc/guides/prog_guide/eventdev.rst
@@ -217,7 +217,7 @@ calling the setup function. Repeat this step for each queue, starting from
 .. code-block:: c
 
         struct rte_event_queue_conf atomic_conf = {
-                .event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+                .schedule_type = RTE_SCHED_TYPE_ATOMIC,
                 .priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
                 .nb_atomic_flows = 1024,
                 .nb_atomic_order_sequences = 1024,
@@ -320,7 +320,7 @@ The following code shows how those packets can be enqueued into the eventdev:
         for (i = 0; i < nb_rx; i++) {
                 ev[i].flow_id = mbufs[i]->hash.rss;
                 ev[i].op = RTE_EVENT_OP_NEW;
-                ev[i].sched_type = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY;
+                ev[i].sched_type = RTE_SCHED_TYPE_ATOMIC;
                 ev[i].queue_id = 0;
                 ev[i].event_type = RTE_EVENT_TYPE_ETHDEV;
                 ev[i].sub_event_type = 0;
-- 
2.7.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config
  2017-10-12 13:15 [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config Pavan Nikhilesh
  2017-10-12 13:15 ` [dpdk-dev] [PATCH 2/3] eventdev: extend queue attribute get function Pavan Nikhilesh
  2017-10-12 13:15 ` [dpdk-dev] [PATCH 3/3] doc: update eventdev programmers guide Pavan Nikhilesh
@ 2017-10-20  9:54 ` Van Haaren, Harry
  2017-10-20 10:30   ` Pavan Nikhilesh Bhagavatula
  2017-10-23 16:29 ` [dpdk-dev] [PATCH v2 " Pavan Nikhilesh
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 27+ messages in thread
From: Van Haaren, Harry @ 2017-10-20  9:54 UTC (permalink / raw)
  To: Pavan Nikhilesh, jerin.jacob, hemant.agrawal; +Cc: dev

> From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> Sent: Thursday, October 12, 2017 2:16 PM
> To: jerin.jacob@caviumnetworks.com; hemant.agrawal@nxp.com; Van Haaren,
> Harry <harry.van.haaren@intel.com>
> Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue
> config
> 
> With the current scheme of event queue configuration the cfg schedule
> type macros (RTE_EVENT_QUEUE_CFG_*_ONLY) are inconsistent with the
> event schedule type (RTE_SCHED_TYPE_*) this requires unnecessary
> conversion between the fastpath and slowpath API's while scheduling
> events or configuring event queues.
>
> This patch aims to fix such inconsistency by using event schedule
> types (RTE_SCHED_TYPE_*) for event queue configuration.

True - worth cleaning up.

 
> This patch also fixes example/eventdev_pipeline_sw_pmd as it doesn't
> convert RTE_EVENT_QUEUE_CFG_*_ONLY to RTE_SCHED_TYPE_* which leads to
> improper events being enqueued to the eventdev.
> 
> Fixes: adb5d5486c39 ("examples/eventdev_pipeline_sw_pmd: add sample app")
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
>
>
>  app/test-eventdev/evt_common.h           | 21 -------------
>  app/test-eventdev/test_order_queue.c     |  4 +--
>  app/test-eventdev/test_perf_queue.c      |  4 +--
>  drivers/event/dpaa2/dpaa2_eventdev.c     |  4 +--
>  drivers/event/sw/sw_evdev.c              | 28 +++++------------
>  examples/eventdev_pipeline_sw_pmd/main.c | 18 +++++------
>  lib/librte_eventdev/rte_eventdev.c       | 20 +++++-------
>  lib/librte_eventdev/rte_eventdev.h       | 54 ++++++++++-------------------
> ---
>  test/test/test_eventdev.c                | 12 +++----
>  test/test/test_eventdev_sw.c             | 16 +++++-----
>  10 files changed, 60 insertions(+), 121 deletions(-)
> 
> diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h
> index 4102076..ee896a2 100644
> --- a/app/test-eventdev/evt_common.h
> +++ b/app/test-eventdev/evt_common.h
> @@ -92,25 +92,4 @@ evt_has_all_types_queue(uint8_t dev_id)
>  			true : false;
>  }
> 
> -static inline uint32_t
> -evt_sched_type2queue_cfg(uint8_t sched_type)
> -{
> -	uint32_t ret;
> -
> -	switch (sched_type) {
> -	case RTE_SCHED_TYPE_ATOMIC:
> -		ret = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY;
> -		break;
> -	case RTE_SCHED_TYPE_ORDERED:
> -		ret = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY;
> -		break;
> -	case RTE_SCHED_TYPE_PARALLEL:
> -		ret = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
> -		break;
> -	default:
> -		rte_panic("Invalid sched_type %d\n", sched_type);
> -	}
> -	return ret;
> -}


We should note here, that SCHED_TYPE are integer values:
#define RTE_SCHED_TYPE_ORDERED          0
#define RTE_SCHED_TYPE_ATOMIC           1
#define RTE_SCHED_TYPE_PARALLEL         2

While the EVENT_QUEUE_CFG_ types were bitmasks (before being removed in this patch)
#define RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY        (1ULL << 0)
#define RTE_EVENT_QUEUE_CFG_ORDERED_ONLY       (2ULL << 0)
#define RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY      (3ULL << 0)
#define RTE_EVENT_QUEUE_CFG_SINGLE_LINK        (1ULL << 2)


I'm not against this change - but we must be careful that if there was any bit-masking being used previously,
that that will subtly have broken if we change to sched types. I'm reviewing with that in mind..

The RTE_EVENT_QUEUE_CFG_ALL_TYPES  config flag now means that all SCHED_TYPEs
are valid. Previously this was contained in the bitmask.. this may lead to issues.

See patch 2/3, where *only* the schedule_type is read, and returned. What if it the "ALL_TYPES" flag is
set on the queue? It will be reported wrongly. Currently there is no integer value for "ALL_TYPES",
so we cannot represent "ALL TYPES" in the return value from get_attr().

Am I explaining my reasoning clearly enough? 


The patch correctly leaves QUEUE_CFG_SINGLE_LINK as a bitmask, so that bit is ok.



>  #endif /*  _EVT_COMMON_*/
> diff --git a/app/test-eventdev/test_order_queue.c b/app/test-
> eventdev/test_order_queue.c
> index beadd9c..1fa4082 100644


<snip> Remaining diff was updating the QUEUE_CFG to SCHED_TYPE </snip>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config
  2017-10-20  9:54 ` [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config Van Haaren, Harry
@ 2017-10-20 10:30   ` Pavan Nikhilesh Bhagavatula
  2017-10-20 16:38     ` Van Haaren, Harry
  0 siblings, 1 reply; 27+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2017-10-20 10:30 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: dev

On Fri, Oct 20, 2017 at 09:54:36AM +0000, Van Haaren, Harry wrote:
> > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> > Sent: Thursday, October 12, 2017 2:16 PM
> > To: jerin.jacob@caviumnetworks.com; hemant.agrawal@nxp.com; Van Haaren,
> > Harry <harry.van.haaren@intel.com>
> > Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > Subject: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue
> > config
> >
> > With the current scheme of event queue configuration the cfg schedule
> > type macros (RTE_EVENT_QUEUE_CFG_*_ONLY) are inconsistent with the
> > event schedule type (RTE_SCHED_TYPE_*) this requires unnecessary
> > conversion between the fastpath and slowpath API's while scheduling
> > events or configuring event queues.
> >
> > This patch aims to fix such inconsistency by using event schedule
> > types (RTE_SCHED_TYPE_*) for event queue configuration.
>
> True - worth cleaning up.
>
>
> > This patch also fixes example/eventdev_pipeline_sw_pmd as it doesn't
> > convert RTE_EVENT_QUEUE_CFG_*_ONLY to RTE_SCHED_TYPE_* which leads to
> > improper events being enqueued to the eventdev.
> >
> > Fixes: adb5d5486c39 ("examples/eventdev_pipeline_sw_pmd: add sample app")
> >
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> >
> >
> >  app/test-eventdev/evt_common.h           | 21 -------------
> >  app/test-eventdev/test_order_queue.c     |  4 +--
> >  app/test-eventdev/test_perf_queue.c      |  4 +--
> >  drivers/event/dpaa2/dpaa2_eventdev.c     |  4 +--
> >  drivers/event/sw/sw_evdev.c              | 28 +++++------------
> >  examples/eventdev_pipeline_sw_pmd/main.c | 18 +++++------
> >  lib/librte_eventdev/rte_eventdev.c       | 20 +++++-------
> >  lib/librte_eventdev/rte_eventdev.h       | 54 ++++++++++-------------------
> > ---
> >  test/test/test_eventdev.c                | 12 +++----
> >  test/test/test_eventdev_sw.c             | 16 +++++-----
> >  10 files changed, 60 insertions(+), 121 deletions(-)
> >
> > diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h
> > index 4102076..ee896a2 100644
> > --- a/app/test-eventdev/evt_common.h
> > +++ b/app/test-eventdev/evt_common.h
> > @@ -92,25 +92,4 @@ evt_has_all_types_queue(uint8_t dev_id)
> >  			true : false;
> >  }
> >
> > -static inline uint32_t
> > -evt_sched_type2queue_cfg(uint8_t sched_type)
> > -{
> > -	uint32_t ret;
> > -
> > -	switch (sched_type) {
> > -	case RTE_SCHED_TYPE_ATOMIC:
> > -		ret = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY;
> > -		break;
> > -	case RTE_SCHED_TYPE_ORDERED:
> > -		ret = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY;
> > -		break;
> > -	case RTE_SCHED_TYPE_PARALLEL:
> > -		ret = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
> > -		break;
> > -	default:
> > -		rte_panic("Invalid sched_type %d\n", sched_type);
> > -	}
> > -	return ret;
> > -}
>
>
> We should note here, that SCHED_TYPE are integer values:
> #define RTE_SCHED_TYPE_ORDERED          0
> #define RTE_SCHED_TYPE_ATOMIC           1
> #define RTE_SCHED_TYPE_PARALLEL         2
>
> While the EVENT_QUEUE_CFG_ types were bitmasks (before being removed in this patch)
> #define RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY        (1ULL << 0)
> #define RTE_EVENT_QUEUE_CFG_ORDERED_ONLY       (2ULL << 0)
> #define RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY      (3ULL << 0)
> #define RTE_EVENT_QUEUE_CFG_SINGLE_LINK        (1ULL << 2)
>
>
> I'm not against this change - but we must be careful that if there was any bit-masking being used previously,
> that that will subtly have broken if we change to sched types. I'm reviewing with that in mind..
>
> The RTE_EVENT_QUEUE_CFG_ALL_TYPES  config flag now means that all SCHED_TYPEs
> are valid. Previously this was contained in the bitmask.. this may lead to issues.
>
> See patch 2/3, where *only* the schedule_type is read, and returned. What if it the "ALL_TYPES" flag is
> set on the queue? It will be reported wrongly. Currently there is no integer value for "ALL_TYPES",
> so we cannot represent "ALL TYPES" in the return value from get_attr().
>
> Am I explaining my reasoning clearly enough?
>

Hey Harry,

I do understand what you mean, my initial thought was to include "ALL_TYPES" as
a schedule_type in queue config but this would just complicate things.

As these values are only used in config phase we could have a check to see if
event_queue_cfg is not "ALL_TYPES" and only then return the value of sched_type
else return a error value in case of get_attr().

I think most of the places this specific check is handled, one such missed
place would be get_attr(). If we could come to a conclusion to fix it in a
correct way I will send out a v2.

Thanks,
Pavan.

>
> The patch correctly leaves QUEUE_CFG_SINGLE_LINK as a bitmask, so that bit is ok.
>
>
>
> >  #endif /*  _EVT_COMMON_*/
> > diff --git a/app/test-eventdev/test_order_queue.c b/app/test-
> > eventdev/test_order_queue.c
> > index beadd9c..1fa4082 100644
>
>
> <snip> Remaining diff was updating the QUEUE_CFG to SCHED_TYPE </snip>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config
  2017-10-20 10:30   ` Pavan Nikhilesh Bhagavatula
@ 2017-10-20 16:38     ` Van Haaren, Harry
  2017-10-20 19:09       ` Pavan Nikhilesh Bhagavatula
  2017-10-21 15:05       ` Jerin Jacob
  0 siblings, 2 replies; 27+ messages in thread
From: Van Haaren, Harry @ 2017-10-20 16:38 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula; +Cc: dev

> From: Pavan Nikhilesh Bhagavatula [mailto:pbhagavatula@caviumnetworks.com]
> Sent: Friday, October 20, 2017 11:31 AM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event
> queue config
> 
> On Fri, Oct 20, 2017 at 09:54:36AM +0000, Van Haaren, Harry wrote:
> > > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> > > Sent: Thursday, October 12, 2017 2:16 PM
> > > To: jerin.jacob@caviumnetworks.com; hemant.agrawal@nxp.com; Van Haaren,
> > > Harry <harry.van.haaren@intel.com>
> > > Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > > Subject: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event
> queue
> > > config
> > >
> > > With the current scheme of event queue configuration the cfg schedule
> > > type macros (RTE_EVENT_QUEUE_CFG_*_ONLY) are inconsistent with the
> > > event schedule type (RTE_SCHED_TYPE_*) this requires unnecessary
> > > conversion between the fastpath and slowpath API's while scheduling
> > > events or configuring event queues.
> > >
> > > This patch aims to fix such inconsistency by using event schedule
> > > types (RTE_SCHED_TYPE_*) for event queue configuration.
> >
> > True - worth cleaning up.
> >
> >
> > > This patch also fixes example/eventdev_pipeline_sw_pmd as it doesn't
> > > convert RTE_EVENT_QUEUE_CFG_*_ONLY to RTE_SCHED_TYPE_* which leads to
> > > improper events being enqueued to the eventdev.
> > >
> > > Fixes: adb5d5486c39 ("examples/eventdev_pipeline_sw_pmd: add sample
> app")
> > >
> > > Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > >
> > >
> > >  app/test-eventdev/evt_common.h           | 21 -------------
> > >  app/test-eventdev/test_order_queue.c     |  4 +--
> > >  app/test-eventdev/test_perf_queue.c      |  4 +--
> > >  drivers/event/dpaa2/dpaa2_eventdev.c     |  4 +--
> > >  drivers/event/sw/sw_evdev.c              | 28 +++++------------
> > >  examples/eventdev_pipeline_sw_pmd/main.c | 18 +++++------
> > >  lib/librte_eventdev/rte_eventdev.c       | 20 +++++-------
> > >  lib/librte_eventdev/rte_eventdev.h       | 54 ++++++++++---------------
> ----
> > > ---
> > >  test/test/test_eventdev.c                | 12 +++----
> > >  test/test/test_eventdev_sw.c             | 16 +++++-----
> > >  10 files changed, 60 insertions(+), 121 deletions(-)
> > >
> > > diff --git a/app/test-eventdev/evt_common.h b/app/test-
> eventdev/evt_common.h
> > > index 4102076..ee896a2 100644
> > > --- a/app/test-eventdev/evt_common.h
> > > +++ b/app/test-eventdev/evt_common.h
> > > @@ -92,25 +92,4 @@ evt_has_all_types_queue(uint8_t dev_id)
> > >  			true : false;
> > >  }
> > >
> > > -static inline uint32_t
> > > -evt_sched_type2queue_cfg(uint8_t sched_type)
> > > -{
> > > -	uint32_t ret;
> > > -
> > > -	switch (sched_type) {
> > > -	case RTE_SCHED_TYPE_ATOMIC:
> > > -		ret = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY;
> > > -		break;
> > > -	case RTE_SCHED_TYPE_ORDERED:
> > > -		ret = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY;
> > > -		break;
> > > -	case RTE_SCHED_TYPE_PARALLEL:
> > > -		ret = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
> > > -		break;
> > > -	default:
> > > -		rte_panic("Invalid sched_type %d\n", sched_type);
> > > -	}
> > > -	return ret;
> > > -}
> >
> >
> > We should note here, that SCHED_TYPE are integer values:
> > #define RTE_SCHED_TYPE_ORDERED          0
> > #define RTE_SCHED_TYPE_ATOMIC           1
> > #define RTE_SCHED_TYPE_PARALLEL         2
> >
> > While the EVENT_QUEUE_CFG_ types were bitmasks (before being removed in
> this patch)
> > #define RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY        (1ULL << 0)
> > #define RTE_EVENT_QUEUE_CFG_ORDERED_ONLY       (2ULL << 0)
> > #define RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY      (3ULL << 0)
> > #define RTE_EVENT_QUEUE_CFG_SINGLE_LINK        (1ULL << 2)
> >
> >
> > I'm not against this change - but we must be careful that if there was any
> bit-masking being used previously,
> > that that will subtly have broken if we change to sched types. I'm
> reviewing with that in mind..
> >
> > The RTE_EVENT_QUEUE_CFG_ALL_TYPES  config flag now means that all
> SCHED_TYPEs
> > are valid. Previously this was contained in the bitmask.. this may lead to
> issues.
> >
> > See patch 2/3, where *only* the schedule_type is read, and returned. What
> if it the "ALL_TYPES" flag is
> > set on the queue? It will be reported wrongly. Currently there is no
> integer value for "ALL_TYPES",
> > so we cannot represent "ALL TYPES" in the return value from get_attr().
> >
> > Am I explaining my reasoning clearly enough?
> >
> 
> Hey Harry,
> 
> I do understand what you mean, my initial thought was to include "ALL_TYPES"
> as
> a schedule_type in queue config but this would just complicate things.
> 
> As these values are only used in config phase we could have a check to see
> if
> event_queue_cfg is not "ALL_TYPES" and only then return the value of
> sched_type
> else return a error value in case of get_attr().
> 
> I think most of the places this specific check is handled, one such missed
> place would be get_attr(). If we could come to a conclusion to fix it in a
> correct way I will send out a v2.


Sure, I see two sane-ish options:

1) Return an error code from get_attr(), which actually means "ALL TYPES". Feels a bit weird, because an error value is really a valid return.

2) Return UINT_MAX (aka, -1) as the scheduling value. Applications that use/care about the scheduling type must check, others can ignore it.

I'm not sure which of these is the better/less-bad solution. Opinions? -H

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config
  2017-10-20 16:38     ` Van Haaren, Harry
@ 2017-10-20 19:09       ` Pavan Nikhilesh Bhagavatula
  2017-10-21 17:27         ` Jerin Jacob
  2017-10-23  8:04         ` Van Haaren, Harry
  2017-10-21 15:05       ` Jerin Jacob
  1 sibling, 2 replies; 27+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2017-10-20 19:09 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: dev

On Fri, Oct 20, 2017 at 04:38:57PM +0000, Van Haaren, Harry wrote:
> > From: Pavan Nikhilesh Bhagavatula [mailto:pbhagavatula@caviumnetworks.com]
> > Sent: Friday, October 20, 2017 11:31 AM
> > To: Van Haaren, Harry <harry.van.haaren@intel.com>
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event
> > queue config
> >
> > On Fri, Oct 20, 2017 at 09:54:36AM +0000, Van Haaren, Harry wrote:
> > > > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> > > > Sent: Thursday, October 12, 2017 2:16 PM
> > > > To: jerin.jacob@caviumnetworks.com; hemant.agrawal@nxp.com; Van Haaren,
> > > > Harry <harry.van.haaren@intel.com>
> > > > Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > > > Subject: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event
> > queue
> > > > config
> > > >

<snip>

> > > > -	}
> > > > -	return ret;
> > > > -}
> > >
> > >
> > > We should note here, that SCHED_TYPE are integer values:
> > > #define RTE_SCHED_TYPE_ORDERED          0
> > > #define RTE_SCHED_TYPE_ATOMIC           1
> > > #define RTE_SCHED_TYPE_PARALLEL         2
> > >
> > > While the EVENT_QUEUE_CFG_ types were bitmasks (before being removed in
> > this patch)
> > > #define RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY        (1ULL << 0)
> > > #define RTE_EVENT_QUEUE_CFG_ORDERED_ONLY       (2ULL << 0)
> > > #define RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY      (3ULL << 0)
> > > #define RTE_EVENT_QUEUE_CFG_SINGLE_LINK        (1ULL << 2)
> > >
> > >
> > > I'm not against this change - but we must be careful that if there was any
> > bit-masking being used previously,
> > > that that will subtly have broken if we change to sched types. I'm
> > reviewing with that in mind..
> > >
> > > The RTE_EVENT_QUEUE_CFG_ALL_TYPES  config flag now means that all
> > SCHED_TYPEs
> > > are valid. Previously this was contained in the bitmask.. this may lead to
> > issues.
> > >
> > > See patch 2/3, where *only* the schedule_type is read, and returned. What
> > if it the "ALL_TYPES" flag is
> > > set on the queue? It will be reported wrongly. Currently there is no
> > integer value for "ALL_TYPES",
> > > so we cannot represent "ALL TYPES" in the return value from get_attr().
> > >
> > > Am I explaining my reasoning clearly enough?
> > >
> >
> > Hey Harry,
> >
> > I do understand what you mean, my initial thought was to include "ALL_TYPES"
> > as
> > a schedule_type in queue config but this would just complicate things.
> >
> > As these values are only used in config phase we could have a check to see
> > if
> > event_queue_cfg is not "ALL_TYPES" and only then return the value of
> > sched_type
> > else return a error value in case of get_attr().
> >
> > I think most of the places this specific check is handled, one such missed
> > place would be get_attr(). If we could come to a conclusion to fix it in a
> > correct way I will send out a v2.
>
>
> Sure, I see two sane-ish options:
>
> 1) Return an error code from get_attr(), which actually means "ALL TYPES". Feels a bit weird, because an error value is really a valid return.
>
> 2) Return UINT_MAX (aka, -1) as the scheduling value. Applications that use/care about the scheduling type must check, others can ignore it.
>
> I'm not sure which of these is the better/less-bad solution. Opinions? -H
>

I think 1st option would be good, we could use ENOTUNIQ to represent that the
queue type is "ALL TYPE".

Thoughts?

Pavan.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config
  2017-10-20 16:38     ` Van Haaren, Harry
  2017-10-20 19:09       ` Pavan Nikhilesh Bhagavatula
@ 2017-10-21 15:05       ` Jerin Jacob
  1 sibling, 0 replies; 27+ messages in thread
From: Jerin Jacob @ 2017-10-21 15:05 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: Pavan Nikhilesh Bhagavatula, dev

-----Original Message-----
> Date: Fri, 20 Oct 2017 16:38:57 +0000
> From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
> To: Pavan Nikhilesh Bhagavatula <pbhagavatula@caviumnetworks.com>
> CC: "dev@dpdk.org" <dev@dpdk.org>
> Subject: Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event
>  queue config
> 
> > From: Pavan Nikhilesh Bhagavatula [mailto:pbhagavatula@caviumnetworks.com]
> > Sent: Friday, October 20, 2017 11:31 AM
> > To: Van Haaren, Harry <harry.van.haaren@intel.com>
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event
> > queue config
> > 
> > On Fri, Oct 20, 2017 at 09:54:36AM +0000, Van Haaren, Harry wrote:
> > > > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> > > > Sent: Thursday, October 12, 2017 2:16 PM
> > > > To: jerin.jacob@caviumnetworks.com; hemant.agrawal@nxp.com; Van Haaren,
> > > > Harry <harry.van.haaren@intel.com>
> > > > Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > > > Subject: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event
> > queue
> > > > config
> > > >
> > > > With the current scheme of event queue configuration the cfg schedule
> > > > type macros (RTE_EVENT_QUEUE_CFG_*_ONLY) are inconsistent with the
> > > > event schedule type (RTE_SCHED_TYPE_*) this requires unnecessary
> > > > conversion between the fastpath and slowpath API's while scheduling
> > > > events or configuring event queues.
> > > >
> > > > This patch aims to fix such inconsistency by using event schedule
> > > > types (RTE_SCHED_TYPE_*) for event queue configuration.
> > >
> > > True - worth cleaning up.
> > >
> > >
> > > > This patch also fixes example/eventdev_pipeline_sw_pmd as it doesn't
> > > > convert RTE_EVENT_QUEUE_CFG_*_ONLY to RTE_SCHED_TYPE_* which leads to
> > > > improper events being enqueued to the eventdev.
> > > >
> > > > Fixes: adb5d5486c39 ("examples/eventdev_pipeline_sw_pmd: add sample
> > app")
> > > >
> > > > Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > > >
> > > >
> > > >  app/test-eventdev/evt_common.h           | 21 -------------
> > > >  app/test-eventdev/test_order_queue.c     |  4 +--
> > > >  app/test-eventdev/test_perf_queue.c      |  4 +--
> > > >  drivers/event/dpaa2/dpaa2_eventdev.c     |  4 +--
> > > >  drivers/event/sw/sw_evdev.c              | 28 +++++------------
> > > >  examples/eventdev_pipeline_sw_pmd/main.c | 18 +++++------
> > > >  lib/librte_eventdev/rte_eventdev.c       | 20 +++++-------
> > > >  lib/librte_eventdev/rte_eventdev.h       | 54 ++++++++++---------------
> > ----
> > > > ---
> > > >  test/test/test_eventdev.c                | 12 +++----
> > > >  test/test/test_eventdev_sw.c             | 16 +++++-----
> > > >  10 files changed, 60 insertions(+), 121 deletions(-)
> > > >
> > > > diff --git a/app/test-eventdev/evt_common.h b/app/test-
> > eventdev/evt_common.h
> > > > index 4102076..ee896a2 100644
> > > > --- a/app/test-eventdev/evt_common.h
> > > > +++ b/app/test-eventdev/evt_common.h
> > > > @@ -92,25 +92,4 @@ evt_has_all_types_queue(uint8_t dev_id)
> > > >  			true : false;
> > > >  }
> > > >
> > > > -static inline uint32_t
> > > > -evt_sched_type2queue_cfg(uint8_t sched_type)
> > > > -{
> > > > -	uint32_t ret;
> > > > -
> > > > -	switch (sched_type) {
> > > > -	case RTE_SCHED_TYPE_ATOMIC:
> > > > -		ret = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY;
> > > > -		break;
> > > > -	case RTE_SCHED_TYPE_ORDERED:
> > > > -		ret = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY;
> > > > -		break;
> > > > -	case RTE_SCHED_TYPE_PARALLEL:
> > > > -		ret = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
> > > > -		break;
> > > > -	default:
> > > > -		rte_panic("Invalid sched_type %d\n", sched_type);
> > > > -	}
> > > > -	return ret;
> > > > -}
> > >
> > >
> > > We should note here, that SCHED_TYPE are integer values:
> > > #define RTE_SCHED_TYPE_ORDERED          0
> > > #define RTE_SCHED_TYPE_ATOMIC           1
> > > #define RTE_SCHED_TYPE_PARALLEL         2
> > >
> > > While the EVENT_QUEUE_CFG_ types were bitmasks (before being removed in
> > this patch)
> > > #define RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY        (1ULL << 0)
> > > #define RTE_EVENT_QUEUE_CFG_ORDERED_ONLY       (2ULL << 0)
> > > #define RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY      (3ULL << 0)
> > > #define RTE_EVENT_QUEUE_CFG_SINGLE_LINK        (1ULL << 2)
> > >
> > >
> > > I'm not against this change - but we must be careful that if there was any
> > bit-masking being used previously,
> > > that that will subtly have broken if we change to sched types. I'm
> > reviewing with that in mind..
> > >
> > > The RTE_EVENT_QUEUE_CFG_ALL_TYPES  config flag now means that all
> > SCHED_TYPEs
> > > are valid. Previously this was contained in the bitmask.. this may lead to
> > issues.
> > >
> > > See patch 2/3, where *only* the schedule_type is read, and returned. What
> > if it the "ALL_TYPES" flag is
> > > set on the queue? It will be reported wrongly. Currently there is no
> > integer value for "ALL_TYPES",
> > > so we cannot represent "ALL TYPES" in the return value from get_attr().
> > >
> > > Am I explaining my reasoning clearly enough?
> > >
> > 
> > Hey Harry,
> > 
> > I do understand what you mean, my initial thought was to include "ALL_TYPES"
> > as
> > a schedule_type in queue config but this would just complicate things.
> > 
> > As these values are only used in config phase we could have a check to see
> > if
> > event_queue_cfg is not "ALL_TYPES" and only then return the value of
> > sched_type
> > else return a error value in case of get_attr().
> > 
> > I think most of the places this specific check is handled, one such missed
> > place would be get_attr(). If we could come to a conclusion to fix it in a
> > correct way I will send out a v2.
> 
> 
> Sure, I see two sane-ish options:
> 
> 1) Return an error code from get_attr(), which actually means "ALL TYPES". Feels a bit weird, because an error value is really a valid return.
> 
> 2) Return UINT_MAX (aka, -1) as the scheduling value. Applications that use/care about the scheduling type must check, others can ignore it.
> 
> I'm not sure which of these is the better/less-bad solution. Opinions? -H

Since we have separate get_attr() for RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG and                                        
RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE, Aren't we just fine here? Meaning
application can really get back the configured queue attributes through                 
RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG and RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE.    
Which will be in line with the following comment in header files as
well.            
                                                                                
        uint8_t schedule_type;                                                  
        /**< Queue schedule type(RTE_SCHED_TYPE_*).                             
         * Valid when RTE_EVENT_QUEUE_CFG_ALL_TYPES bit is not set in           
         * event_queue_cfg.                                                     
                                                                                
Just thought of avoiding a special interpretation for
RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE? What do you think? 

> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config
  2017-10-20 19:09       ` Pavan Nikhilesh Bhagavatula
@ 2017-10-21 17:27         ` Jerin Jacob
  2017-10-23  8:04         ` Van Haaren, Harry
  1 sibling, 0 replies; 27+ messages in thread
From: Jerin Jacob @ 2017-10-21 17:27 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula; +Cc: Van Haaren, Harry, dev

-----Original Message-----
> Date: Sat, 21 Oct 2017 00:39:28 +0530
> From: Pavan Nikhilesh Bhagavatula <pbhagavatula@caviumnetworks.com>
> To: "Van Haaren, Harry" <harry.van.haaren@intel.com>
> CC: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event
>  queue config
> User-Agent: Mutt/1.5.24 (2015-08-30)
> 
> On Fri, Oct 20, 2017 at 04:38:57PM +0000, Van Haaren, Harry wrote:
> > > From: Pavan Nikhilesh Bhagavatula [mailto:pbhagavatula@caviumnetworks.com]
> > > Sent: Friday, October 20, 2017 11:31 AM
> > > To: Van Haaren, Harry <harry.van.haaren@intel.com>
> > > Cc: dev@dpdk.org
> > > Subject: Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event
> > > queue config
> > >
> > > On Fri, Oct 20, 2017 at 09:54:36AM +0000, Van Haaren, Harry wrote:
> > > > > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> > > > > Sent: Thursday, October 12, 2017 2:16 PM
> > > > > To: jerin.jacob@caviumnetworks.com; hemant.agrawal@nxp.com; Van Haaren,
> > > > > Harry <harry.van.haaren@intel.com>
> > > > > Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > > > > Subject: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event
> > > queue
> > > > > config
> > > > >
> 
> <snip>
> 
> > > > > -	}
> > > > > -	return ret;
> > > > > -}
> > > >
> > > >
> > > > We should note here, that SCHED_TYPE are integer values:
> > > > #define RTE_SCHED_TYPE_ORDERED          0
> > > > #define RTE_SCHED_TYPE_ATOMIC           1
> > > > #define RTE_SCHED_TYPE_PARALLEL         2
> > > >
> > > > While the EVENT_QUEUE_CFG_ types were bitmasks (before being removed in
> > > this patch)
> > > > #define RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY        (1ULL << 0)
> > > > #define RTE_EVENT_QUEUE_CFG_ORDERED_ONLY       (2ULL << 0)
> > > > #define RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY      (3ULL << 0)
> > > > #define RTE_EVENT_QUEUE_CFG_SINGLE_LINK        (1ULL << 2)
> > > >
> > > >
> > > > I'm not against this change - but we must be careful that if there was any
> > > bit-masking being used previously,
> > > > that that will subtly have broken if we change to sched types. I'm
> > > reviewing with that in mind..
> > > >
> > > > The RTE_EVENT_QUEUE_CFG_ALL_TYPES  config flag now means that all
> > > SCHED_TYPEs
> > > > are valid. Previously this was contained in the bitmask.. this may lead to
> > > issues.
> > > >
> > > > See patch 2/3, where *only* the schedule_type is read, and returned. What
> > > if it the "ALL_TYPES" flag is
> > > > set on the queue? It will be reported wrongly. Currently there is no
> > > integer value for "ALL_TYPES",
> > > > so we cannot represent "ALL TYPES" in the return value from get_attr().
> > > >
> > > > Am I explaining my reasoning clearly enough?
> > > >
> > >
> > > Hey Harry,
> > >
> > > I do understand what you mean, my initial thought was to include "ALL_TYPES"
> > > as
> > > a schedule_type in queue config but this would just complicate things.
> > >
> > > As these values are only used in config phase we could have a check to see
> > > if
> > > event_queue_cfg is not "ALL_TYPES" and only then return the value of
> > > sched_type
> > > else return a error value in case of get_attr().
> > >
> > > I think most of the places this specific check is handled, one such missed
> > > place would be get_attr(). If we could come to a conclusion to fix it in a
> > > correct way I will send out a v2.
> >
> >
> > Sure, I see two sane-ish options:
> >
> > 1) Return an error code from get_attr(), which actually means "ALL TYPES". Feels a bit weird, because an error value is really a valid return.
> >
> > 2) Return UINT_MAX (aka, -1) as the scheduling value. Applications that use/care about the scheduling type must check, others can ignore it.
> >
> > I'm not sure which of these is the better/less-bad solution. Opinions? -H
> >
> 
> I think 1st option would be good, we could use ENOTUNIQ to represent that the
> queue type is "ALL TYPE".
> 
> Thoughts?

If we were to choose between option 1 and option 2, I think,
option 1 is better instead of special interpretation of option 2.

Looks like ENOTUNIQ is not available for freebsd. Choose a errno that
works for linux and freebsd

https://www.freebsd.org/cgi/man.cgi?query=errno&sektion=2
http://man7.org/linux/man-pages/man3/errno.3.html

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config
  2017-10-20 19:09       ` Pavan Nikhilesh Bhagavatula
  2017-10-21 17:27         ` Jerin Jacob
@ 2017-10-23  8:04         ` Van Haaren, Harry
  2017-10-23  8:41           ` Pavan Nikhilesh Bhagavatula
  1 sibling, 1 reply; 27+ messages in thread
From: Van Haaren, Harry @ 2017-10-23  8:04 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula; +Cc: dev

> From: Pavan Nikhilesh Bhagavatula [mailto:pbhagavatula@caviumnetworks.com]
> Sent: Friday, October 20, 2017 8:09 PM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event
> queue config
> 
> On Fri, Oct 20, 2017 at 04:38:57PM +0000, Van Haaren, Harry wrote:

<big snip>

> > Sure, I see two sane-ish options:
> >
> > 1) Return an error code from get_attr(), which actually means "ALL TYPES".
> Feels a bit weird, because an error value is really a valid return.
> >
> > 2) Return UINT_MAX (aka, -1) as the scheduling value. Applications that
> use/care about the scheduling type must check, others can ignore it.
> >
> > I'm not sure which of these is the better/less-bad solution. Opinions? -H
> >
> 
> I think 1st option would be good, we could use ENOTUNIQ to represent that
> the
> queue type is "ALL TYPE".
> 
> Thoughts?


OK with me!

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config
  2017-10-23  8:04         ` Van Haaren, Harry
@ 2017-10-23  8:41           ` Pavan Nikhilesh Bhagavatula
  2017-10-23 14:45             ` Van Haaren, Harry
  0 siblings, 1 reply; 27+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2017-10-23  8:41 UTC (permalink / raw)
  To: Van Haaren, Harry, jerin.jacob; +Cc: dev

On Mon, Oct 23, 2017 at 08:04:26AM +0000, Van Haaren, Harry wrote:
> > From: Pavan Nikhilesh Bhagavatula [mailto:pbhagavatula@caviumnetworks.com]
> > Sent: Friday, October 20, 2017 8:09 PM
> > To: Van Haaren, Harry <harry.van.haaren@intel.com>
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event
> > queue config
> >
> > On Fri, Oct 20, 2017 at 04:38:57PM +0000, Van Haaren, Harry wrote:
>
> <big snip>
>
> > > Sure, I see two sane-ish options:
> > >
> > > 1) Return an error code from get_attr(), which actually means "ALL TYPES".
> > Feels a bit weird, because an error value is really a valid return.
> > >
> > > 2) Return UINT_MAX (aka, -1) as the scheduling value. Applications that
> > use/care about the scheduling type must check, others can ignore it.
> > >
> > > I'm not sure which of these is the better/less-bad solution. Opinions? -H
> > >
> >
> > I think 1st option would be good, we could use ENOTUNIQ to represent that
> > the
> > queue type is "ALL TYPE".
> >
> > Thoughts?
>
>
> OK with me!
>
Hey Harry/Jerin,

Sadly ENOTUNIQ is not supported on freebsd so, would returning EOPNOTSUPP make
sense as it is closest error message that has similar meaning.
I found ENOATTR in freebsd but that's not supported on linux.

Thanks,
Pavan

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config
  2017-10-23  8:41           ` Pavan Nikhilesh Bhagavatula
@ 2017-10-23 14:45             ` Van Haaren, Harry
  2017-10-23 14:54               ` Pavan Nikhilesh Bhagavatula
  0 siblings, 1 reply; 27+ messages in thread
From: Van Haaren, Harry @ 2017-10-23 14:45 UTC (permalink / raw)
  To: Pavan Nikhilesh Bhagavatula, jerin.jacob; +Cc: dev

> From: Pavan Nikhilesh Bhagavatula [mailto:pbhagavatula@caviumnetworks.com]
> Sent: Monday, October 23, 2017 9:42 AM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>;
> jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event
> queue config
> 
> On Mon, Oct 23, 2017 at 08:04:26AM +0000, Van Haaren, Harry wrote:
> > > From: Pavan Nikhilesh Bhagavatula
> [mailto:pbhagavatula@caviumnetworks.com]
> > > Sent: Friday, October 20, 2017 8:09 PM
> > > To: Van Haaren, Harry <harry.van.haaren@intel.com>
> > > Cc: dev@dpdk.org
> > > Subject: Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event
> > > queue config
> > >
> > > On Fri, Oct 20, 2017 at 04:38:57PM +0000, Van Haaren, Harry wrote:
> >
> > <big snip>
> >
> > > > Sure, I see two sane-ish options:
> > > >
> > > > 1) Return an error code from get_attr(), which actually means "ALL
> TYPES".
> > > Feels a bit weird, because an error value is really a valid return.
> > > >
> > > > 2) Return UINT_MAX (aka, -1) as the scheduling value. Applications
> that
> > > use/care about the scheduling type must check, others can ignore it.
> > > >
> > > > I'm not sure which of these is the better/less-bad solution. Opinions?
> -H
> > > >
> > >
> > > I think 1st option would be good, we could use ENOTUNIQ to represent
> that
> > > the
> > > queue type is "ALL TYPE".
> > >
> > > Thoughts?
> >
> >
> > OK with me!
> >
> Hey Harry/Jerin,
> 
> Sadly ENOTUNIQ is not supported on freebsd so, would returning EOPNOTSUPP
> make
> sense as it is closest error message that has similar meaning.
> I found ENOATTR in freebsd but that's not supported on linux.


EOVERFLOW seems to be supported on both, and suggests that the ALL_TYPES return would "overflow", aka is too big, aka, too many types to return?

Documenting the return is IMO more important that exactly what the value is - given there's no logical errno to use, lets use this and document it clearly so when somebody looks at the docs, they'll gain the correct undersanding?

-H

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config
  2017-10-23 14:45             ` Van Haaren, Harry
@ 2017-10-23 14:54               ` Pavan Nikhilesh Bhagavatula
  0 siblings, 0 replies; 27+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2017-10-23 14:54 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: dev

On Mon, Oct 23, 2017 at 02:45:32PM +0000, Van Haaren, Harry wrote:
> > From: Pavan Nikhilesh Bhagavatula [mailto:pbhagavatula@caviumnetworks.com]
> > Sent: Monday, October 23, 2017 9:42 AM
> > To: Van Haaren, Harry <harry.van.haaren@intel.com>;
> > jerin.jacob@caviumnetworks.com
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event
> > queue config
> >
> > On Mon, Oct 23, 2017 at 08:04:26AM +0000, Van Haaren, Harry wrote:
> > > > From: Pavan Nikhilesh Bhagavatula
> > [mailto:pbhagavatula@caviumnetworks.com]
> > > > Sent: Friday, October 20, 2017 8:09 PM
> > > > To: Van Haaren, Harry <harry.van.haaren@intel.com>
> > > > Cc: dev@dpdk.org
> > > > Subject: Re: [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event
> > > > queue config
> > > >
> > > > On Fri, Oct 20, 2017 at 04:38:57PM +0000, Van Haaren, Harry wrote:
> > >
> > > <big snip>
> > >
> > > > > Sure, I see two sane-ish options:
> > > > >
> > > > > 1) Return an error code from get_attr(), which actually means "ALL
> > TYPES".
> > > > Feels a bit weird, because an error value is really a valid return.
> > > > >
> > > > > 2) Return UINT_MAX (aka, -1) as the scheduling value. Applications
> > that
> > > > use/care about the scheduling type must check, others can ignore it.
> > > > >
> > > > > I'm not sure which of these is the better/less-bad solution. Opinions?
> > -H
> > > > >
> > > >
> > > > I think 1st option would be good, we could use ENOTUNIQ to represent
> > that
> > > > the
> > > > queue type is "ALL TYPE".
> > > >
> > > > Thoughts?
> > >
> > >
> > > OK with me!
> > >
> > Hey Harry/Jerin,
> >
> > Sadly ENOTUNIQ is not supported on freebsd so, would returning EOPNOTSUPP
> > make
> > sense as it is closest error message that has similar meaning.
> > I found ENOATTR in freebsd but that's not supported on linux.
>
>
> EOVERFLOW seems to be supported on both, and suggests that the ALL_TYPES return would "overflow", aka is too big, aka, too many types to return?
>
> Documenting the return is IMO more important that exactly what the value is - given there's no logical errno to use, lets use this and document it clearly so when somebody looks at the docs, they'll gain the correct undersanding?
>

Agreed will spin out a v2.
Thanks for the inputs Harry.

Pavan.

> -H
>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH v2 1/3] evendev: fix inconsistency in event queue config
  2017-10-12 13:15 [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config Pavan Nikhilesh
                   ` (2 preceding siblings ...)
  2017-10-20  9:54 ` [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config Van Haaren, Harry
@ 2017-10-23 16:29 ` Pavan Nikhilesh
  2017-10-23 16:29   ` [dpdk-dev] [PATCH v2 2/3] eventdev: extend queue attribute get function Pavan Nikhilesh
  2017-10-23 16:29   ` [dpdk-dev] [PATCH v2 3/3] doc: update eventdev programmers guide Pavan Nikhilesh
  2017-10-23 17:40 ` [dpdk-dev] [PATCH v3 1/3] evendev: fix inconsistency in event queue config Pavan Nikhilesh
  2017-10-25 14:21 ` [dpdk-dev] [PATCH v4 " Pavan Nikhilesh
  5 siblings, 2 replies; 27+ messages in thread
From: Pavan Nikhilesh @ 2017-10-23 16:29 UTC (permalink / raw)
  To: harry.van.haaren, hemant.agrawal, jerin.jacob; +Cc: dev, Pavan Bhagavatula

From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>

With the current scheme of event queue configuration the cfg schedule
type macros (RTE_EVENT_QUEUE_CFG_*_ONLY) are inconsistent with the
event schedule type (RTE_SCHED_TYPE_*) this requires unnecessary
conversion between the fastpath and slowpath API's while scheduling
events or configuring event queues.

This patch aims to fix such inconsistency by using event schedule
types (RTE_SCHED_TYPE_*) for event queue configuration.

This patch also fixes example/eventdev_pipeline_sw_pmd as it doesn't
convert RTE_EVENT_QUEUE_CFG_*_ONLY to RTE_SCHED_TYPE_* which leads to
improper events being enqueued to the eventdev.

Fixes: adb5d5486c39 ("examples/eventdev_pipeline_sw_pmd: add sample app")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 app/test-eventdev/evt_common.h           | 21 -------------
 app/test-eventdev/test_order_queue.c     |  4 +--
 app/test-eventdev/test_perf_queue.c      |  4 +--
 drivers/event/dpaa2/dpaa2_eventdev.c     |  4 +--
 drivers/event/sw/sw_evdev.c              | 28 +++++------------
 examples/eventdev_pipeline_sw_pmd/main.c | 18 +++++------
 lib/librte_eventdev/rte_eventdev.c       | 20 +++++-------
 lib/librte_eventdev/rte_eventdev.h       | 54 ++++++++++----------------------
 test/test/test_eventdev.c                | 12 +++----
 test/test/test_eventdev_sw.c             | 16 +++++-----
 10 files changed, 60 insertions(+), 121 deletions(-)

diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h
index 4102076..ee896a2 100644
--- a/app/test-eventdev/evt_common.h
+++ b/app/test-eventdev/evt_common.h
@@ -92,25 +92,4 @@ evt_has_all_types_queue(uint8_t dev_id)
 			true : false;
 }
 
-static inline uint32_t
-evt_sched_type2queue_cfg(uint8_t sched_type)
-{
-	uint32_t ret;
-
-	switch (sched_type) {
-	case RTE_SCHED_TYPE_ATOMIC:
-		ret = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY;
-		break;
-	case RTE_SCHED_TYPE_ORDERED:
-		ret = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY;
-		break;
-	case RTE_SCHED_TYPE_PARALLEL:
-		ret = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
-		break;
-	default:
-		rte_panic("Invalid sched_type %d\n", sched_type);
-	}
-	return ret;
-}
-
 #endif /*  _EVT_COMMON_*/
diff --git a/app/test-eventdev/test_order_queue.c b/app/test-eventdev/test_order_queue.c
index beadd9c..1fa4082 100644
--- a/app/test-eventdev/test_order_queue.c
+++ b/app/test-eventdev/test_order_queue.c
@@ -164,7 +164,7 @@ order_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	/* q0 (ordered queue) configuration */
 	struct rte_event_queue_conf q0_ordered_conf = {
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ORDERED,
 			.nb_atomic_flows = opt->nb_flows,
 			.nb_atomic_order_sequences = opt->nb_flows,
 	};
@@ -177,7 +177,7 @@ order_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	/* q1 (atomic queue) configuration */
 	struct rte_event_queue_conf q1_atomic_conf = {
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 			.nb_atomic_flows = opt->nb_flows,
 			.nb_atomic_order_sequences = opt->nb_flows,
 	};
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index 658c08a..28c2096 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -205,8 +205,8 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	};
 	/* queue configurations */
 	for (queue = 0; queue < perf_queue_nb_event_queues(opt); queue++) {
-		q_conf.event_queue_cfg =  evt_sched_type2queue_cfg
-				(opt->sched_type_list[queue % nb_stages]);
+		q_conf.event_queue_cfg =
+			(opt->sched_type_list[queue % nb_stages]);
 
 		if (opt->q_priority) {
 			uint8_t stage_pos = queue % nb_stages;
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 81286a8..3dbc337 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -378,8 +378,8 @@ dpaa2_eventdev_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id,
 	RTE_SET_USED(queue_conf);
 
 	queue_conf->nb_atomic_flows = DPAA2_EVENT_QUEUE_ATOMIC_FLOWS;
-	queue_conf->event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY |
-				      RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
+	queue_conf->schedule_type = RTE_SCHED_TYPE_ATOMIC |
+				      RTE_SCHED_TYPE_PARALLEL;
 	queue_conf->priority = RTE_EVENT_DEV_PRIORITY_NORMAL;
 }
 
diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index aed8b72..522cd71 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -345,28 +345,14 @@ sw_queue_setup(struct rte_eventdev *dev, uint8_t queue_id,
 {
 	int type;
 
-	/* SINGLE_LINK can be OR-ed with other types, so handle first */
+	type = conf->schedule_type;
+
 	if (RTE_EVENT_QUEUE_CFG_SINGLE_LINK & conf->event_queue_cfg) {
 		type = SW_SCHED_TYPE_DIRECT;
-	} else {
-		switch (conf->event_queue_cfg) {
-		case RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY:
-			type = RTE_SCHED_TYPE_ATOMIC;
-			break;
-		case RTE_EVENT_QUEUE_CFG_ORDERED_ONLY:
-			type = RTE_SCHED_TYPE_ORDERED;
-			break;
-		case RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY:
-			type = RTE_SCHED_TYPE_PARALLEL;
-			break;
-		case RTE_EVENT_QUEUE_CFG_ALL_TYPES:
-			SW_LOG_ERR("QUEUE_CFG_ALL_TYPES not supported\n");
-			return -ENOTSUP;
-		default:
-			SW_LOG_ERR("Unknown queue type %d requested\n",
-				   conf->event_queue_cfg);
-			return -EINVAL;
-		}
+	} else if (RTE_EVENT_QUEUE_CFG_ALL_TYPES
+			& conf->event_queue_cfg) {
+		SW_LOG_ERR("QUEUE_CFG_ALL_TYPES not supported\n");
+		return -ENOTSUP;
 	}
 
 	struct sw_evdev *sw = sw_pmd_priv(dev);
@@ -400,7 +386,7 @@ sw_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id,
 	static const struct rte_event_queue_conf default_conf = {
 		.nb_atomic_flows = 4096,
 		.nb_atomic_order_sequences = 1,
-		.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+		.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 		.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 	};
 
diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c
index 09b90c3..2e6787b 100644
--- a/examples/eventdev_pipeline_sw_pmd/main.c
+++ b/examples/eventdev_pipeline_sw_pmd/main.c
@@ -108,7 +108,7 @@ struct config_data {
 static struct config_data cdata = {
 	.num_packets = (1L << 25), /* do ~32M packets */
 	.num_fids = 512,
-	.queue_type = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+	.queue_type = RTE_SCHED_TYPE_ATOMIC,
 	.next_qid = {-1},
 	.qid = {-1},
 	.num_stages = 1,
@@ -490,10 +490,10 @@ parse_app_args(int argc, char **argv)
 			cdata.enable_queue_priorities = 1;
 			break;
 		case 'o':
-			cdata.queue_type = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY;
+			cdata.queue_type = RTE_SCHED_TYPE_ORDERED;
 			break;
 		case 'p':
-			cdata.queue_type = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
+			cdata.queue_type = RTE_SCHED_TYPE_PARALLEL;
 			break;
 		case 'q':
 			cdata.quiet = 1;
@@ -684,7 +684,7 @@ setup_eventdev(struct prod_data *prod_data,
 			.new_event_threshold = 4096,
 	};
 	struct rte_event_queue_conf wkr_q_conf = {
-			.event_queue_cfg = cdata.queue_type,
+			.schedule_type = cdata.queue_type,
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 			.nb_atomic_flows = 1024,
 			.nb_atomic_order_sequences = 1024,
@@ -751,11 +751,11 @@ setup_eventdev(struct prod_data *prod_data,
 		}
 
 		const char *type_str = "Atomic";
-		switch (wkr_q_conf.event_queue_cfg) {
-		case RTE_EVENT_QUEUE_CFG_ORDERED_ONLY:
+		switch (wkr_q_conf.schedule_type) {
+		case RTE_SCHED_TYPE_ORDERED:
 			type_str = "Ordered";
 			break;
-		case RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY:
+		case RTE_SCHED_TYPE_PARALLEL:
 			type_str = "Parallel";
 			break;
 		}
@@ -907,9 +907,9 @@ main(int argc, char **argv)
 		printf("\tworkers: %u\n", cdata.num_workers);
 		printf("\tpackets: %"PRIi64"\n", cdata.num_packets);
 		printf("\tQueue-prio: %u\n", cdata.enable_queue_priorities);
-		if (cdata.queue_type == RTE_EVENT_QUEUE_CFG_ORDERED_ONLY)
+		if (cdata.queue_type == RTE_SCHED_TYPE_ORDERED)
 			printf("\tqid0 type: ordered\n");
-		if (cdata.queue_type == RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY)
+		if (cdata.queue_type == RTE_SCHED_TYPE_ATOMIC)
 			printf("\tqid0 type: atomic\n");
 		printf("\tCores available: %u\n", rte_lcore_count());
 		printf("\tCores used: %u\n", cores_needed);
diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
index 378ccb5..db96552 100644
--- a/lib/librte_eventdev/rte_eventdev.c
+++ b/lib/librte_eventdev/rte_eventdev.c
@@ -517,13 +517,11 @@ is_valid_atomic_queue_conf(const struct rte_event_queue_conf *queue_conf)
 {
 	if (queue_conf &&
 		!(queue_conf->event_queue_cfg &
-		  RTE_EVENT_QUEUE_CFG_SINGLE_LINK) && (
+		  RTE_EVENT_QUEUE_CFG_SINGLE_LINK) &&
 		((queue_conf->event_queue_cfg &
-			RTE_EVENT_QUEUE_CFG_TYPE_MASK)
-			== RTE_EVENT_QUEUE_CFG_ALL_TYPES) ||
-		((queue_conf->event_queue_cfg &
-			RTE_EVENT_QUEUE_CFG_TYPE_MASK)
-			== RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY)
+			 RTE_EVENT_QUEUE_CFG_ALL_TYPES) ||
+		(queue_conf->schedule_type
+			== RTE_SCHED_TYPE_ATOMIC)
 		))
 		return 1;
 	else
@@ -535,13 +533,11 @@ is_valid_ordered_queue_conf(const struct rte_event_queue_conf *queue_conf)
 {
 	if (queue_conf &&
 		!(queue_conf->event_queue_cfg &
-		  RTE_EVENT_QUEUE_CFG_SINGLE_LINK) && (
-		((queue_conf->event_queue_cfg &
-			RTE_EVENT_QUEUE_CFG_TYPE_MASK)
-			== RTE_EVENT_QUEUE_CFG_ALL_TYPES) ||
+		  RTE_EVENT_QUEUE_CFG_SINGLE_LINK) &&
 		((queue_conf->event_queue_cfg &
-			RTE_EVENT_QUEUE_CFG_TYPE_MASK)
-			== RTE_EVENT_QUEUE_CFG_ORDERED_ONLY)
+			 RTE_EVENT_QUEUE_CFG_ALL_TYPES) ||
+		(queue_conf->schedule_type
+			== RTE_SCHED_TYPE_ORDERED)
 		))
 		return 1;
 	else
diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
index 1dbc872..fa16f82 100644
--- a/lib/librte_eventdev/rte_eventdev.h
+++ b/lib/librte_eventdev/rte_eventdev.h
@@ -270,9 +270,9 @@ struct rte_mbuf; /* we just use mbuf pointers; no need to include rte_mbuf.h */
 #define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES     (1ULL << 3)
 /**< Event device is capable of enqueuing events of any type to any queue.
  * If this capability is not set, the queue only supports events of the
- *  *RTE_EVENT_QUEUE_CFG_* type that it was created with.
+ *  *RTE_SCHED_TYPE_* type that it was created with.
  *
- * @see RTE_EVENT_QUEUE_CFG_* values
+ * @see RTE_SCHED_TYPE_* values
  */
 #define RTE_EVENT_DEV_CAP_BURST_MODE          (1ULL << 4)
 /**< Event device is capable of operating in burst mode for enqueue(forward,
@@ -515,39 +515,13 @@ rte_event_dev_configure(uint8_t dev_id,
 /* Event queue specific APIs */
 
 /* Event queue configuration bitmap flags */
-#define RTE_EVENT_QUEUE_CFG_TYPE_MASK          (3ULL << 0)
-/**< Mask for event queue schedule type configuration request */
-#define RTE_EVENT_QUEUE_CFG_ALL_TYPES          (0ULL << 0)
+#define RTE_EVENT_QUEUE_CFG_ALL_TYPES          (1ULL << 0)
 /**< Allow ATOMIC,ORDERED,PARALLEL schedule type enqueue
  *
  * @see RTE_SCHED_TYPE_ORDERED, RTE_SCHED_TYPE_ATOMIC, RTE_SCHED_TYPE_PARALLEL
  * @see rte_event_enqueue_burst()
  */
-#define RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY        (1ULL << 0)
-/**< Allow only ATOMIC schedule type enqueue
- *
- * The rte_event_enqueue_burst() result is undefined if the queue configured
- * with ATOMIC only and sched_type != RTE_SCHED_TYPE_ATOMIC
- *
- * @see RTE_SCHED_TYPE_ATOMIC, rte_event_enqueue_burst()
- */
-#define RTE_EVENT_QUEUE_CFG_ORDERED_ONLY       (2ULL << 0)
-/**< Allow only ORDERED schedule type enqueue
- *
- * The rte_event_enqueue_burst() result is undefined if the queue configured
- * with ORDERED only and sched_type != RTE_SCHED_TYPE_ORDERED
- *
- * @see RTE_SCHED_TYPE_ORDERED, rte_event_enqueue_burst()
- */
-#define RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY      (3ULL << 0)
-/**< Allow only PARALLEL schedule type enqueue
- *
- * The rte_event_enqueue_burst() result is undefined if the queue configured
- * with PARALLEL only and sched_type != RTE_SCHED_TYPE_PARALLEL
- *
- * @see RTE_SCHED_TYPE_PARALLEL, rte_event_enqueue_burst()
- */
-#define RTE_EVENT_QUEUE_CFG_SINGLE_LINK        (1ULL << 2)
+#define RTE_EVENT_QUEUE_CFG_SINGLE_LINK        (1ULL << 1)
 /**< This event queue links only to a single event port.
  *
  *  @see rte_event_port_setup(), rte_event_port_link()
@@ -558,8 +532,8 @@ struct rte_event_queue_conf {
 	uint32_t nb_atomic_flows;
 	/**< The maximum number of active flows this queue can track at any
 	 * given time. If the queue is configured for atomic scheduling (by
-	 * applying the RTE_EVENT_QUEUE_CFG_ALL_TYPES or
-	 * RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY flags to event_queue_cfg), then the
+	 * applying the RTE_EVENT_QUEUE_CFG_ALL_TYPES flag to event_queue_cfg
+	 * or RTE_SCHED_TYPE_ATOMIC flag to schedule_type), then the
 	 * value must be in the range of [1, nb_event_queue_flows], which was
 	 * previously provided in rte_event_dev_configure().
 	 */
@@ -572,12 +546,18 @@ struct rte_event_queue_conf {
 	 * event will be returned from dequeue until one or more entries are
 	 * freed up/released.
 	 * If the queue is configured for ordered scheduling (by applying the
-	 * RTE_EVENT_QUEUE_CFG_ALL_TYPES or RTE_EVENT_QUEUE_CFG_ORDERED_ONLY
-	 * flags to event_queue_cfg), then the value must be in the range of
-	 * [1, nb_event_queue_flows], which was previously supplied to
-	 * rte_event_dev_configure().
+	 * RTE_EVENT_QUEUE_CFG_ALL_TYPES flag to event_queue_cfg or
+	 * RTE_SCHED_TYPE_ORDERED flag to schedule_type), then the value must
+	 * be in the range of [1, nb_event_queue_flows], which was
+	 * previously supplied to rte_event_dev_configure().
+	 */
+	uint32_t event_queue_cfg;
+	/**< Queue cfg flags(EVENT_QUEUE_CFG_) */
+	uint8_t schedule_type;
+	/**< Queue schedule type(RTE_SCHED_TYPE_*).
+	 * Valid when RTE_EVENT_QUEUE_CFG_ALL_TYPES bit is not set in
+	 * event_queue_cfg.
 	 */
-	uint32_t event_queue_cfg; /**< Queue cfg flags(EVENT_QUEUE_CFG_) */
 	uint8_t priority;
 	/**< Priority for this event queue relative to other event queues.
 	 * The requested priority should in the range of
diff --git a/test/test/test_eventdev.c b/test/test/test_eventdev.c
index d6ade78..4118b75 100644
--- a/test/test/test_eventdev.c
+++ b/test/test/test_eventdev.c
@@ -300,15 +300,13 @@ test_eventdev_queue_setup(void)
 	/* Negative cases */
 	ret = rte_event_queue_default_conf_get(TEST_DEV_ID, 0, &qconf);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get queue0 info");
-	qconf.event_queue_cfg =	(RTE_EVENT_QUEUE_CFG_ALL_TYPES &
-		 RTE_EVENT_QUEUE_CFG_TYPE_MASK);
+	qconf.event_queue_cfg =	RTE_EVENT_QUEUE_CFG_ALL_TYPES;
 	qconf.nb_atomic_flows = info.max_event_queue_flows + 1;
 	ret = rte_event_queue_setup(TEST_DEV_ID, 0, &qconf);
 	TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret);
 
 	qconf.nb_atomic_flows = info.max_event_queue_flows;
-	qconf.event_queue_cfg =	(RTE_EVENT_QUEUE_CFG_ORDERED_ONLY &
-		 RTE_EVENT_QUEUE_CFG_TYPE_MASK);
+	qconf.schedule_type = RTE_SCHED_TYPE_ORDERED;
 	qconf.nb_atomic_order_sequences = info.max_event_queue_flows + 1;
 	ret = rte_event_queue_setup(TEST_DEV_ID, 0, &qconf);
 	TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret);
@@ -423,7 +421,7 @@ test_eventdev_queue_attr_nb_atomic_flows(void)
 		/* Assume PMD doesn't support atomic flows, return early */
 		return -ENOTSUP;
 
-	qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY;
+	qconf.schedule_type = RTE_SCHED_TYPE_ATOMIC;
 
 	for (i = 0; i < (int)queue_count; i++) {
 		ret = rte_event_queue_setup(TEST_DEV_ID, i, &qconf);
@@ -466,7 +464,7 @@ test_eventdev_queue_attr_nb_atomic_order_sequences(void)
 		/* Assume PMD doesn't support reordering */
 		return -ENOTSUP;
 
-	qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY;
+	qconf.schedule_type = RTE_SCHED_TYPE_ORDERED;
 
 	for (i = 0; i < (int)queue_count; i++) {
 		ret = rte_event_queue_setup(TEST_DEV_ID, i, &qconf);
@@ -507,7 +505,7 @@ test_eventdev_queue_attr_event_queue_cfg(void)
 	ret = rte_event_queue_default_conf_get(TEST_DEV_ID, 0, &qconf);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get queue0 def conf");
 
-	qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
+	qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_SINGLE_LINK;
 
 	for (i = 0; i < (int)queue_count; i++) {
 		ret = rte_event_queue_setup(TEST_DEV_ID, i, &qconf);
diff --git a/test/test/test_eventdev_sw.c b/test/test/test_eventdev_sw.c
index 7219886..dea302f 100644
--- a/test/test/test_eventdev_sw.c
+++ b/test/test/test_eventdev_sw.c
@@ -219,7 +219,7 @@ create_lb_qids(struct test *t, int num_qids, uint32_t flags)
 
 	/* Q creation */
 	const struct rte_event_queue_conf conf = {
-			.event_queue_cfg = flags,
+			.schedule_type = flags,
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 			.nb_atomic_flows = 1024,
 			.nb_atomic_order_sequences = 1024,
@@ -242,20 +242,20 @@ create_lb_qids(struct test *t, int num_qids, uint32_t flags)
 static inline int
 create_atomic_qids(struct test *t, int num_qids)
 {
-	return create_lb_qids(t, num_qids, RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY);
+	return create_lb_qids(t, num_qids, RTE_SCHED_TYPE_ATOMIC);
 }
 
 static inline int
 create_ordered_qids(struct test *t, int num_qids)
 {
-	return create_lb_qids(t, num_qids, RTE_EVENT_QUEUE_CFG_ORDERED_ONLY);
+	return create_lb_qids(t, num_qids, RTE_SCHED_TYPE_ORDERED);
 }
 
 
 static inline int
 create_unordered_qids(struct test *t, int num_qids)
 {
-	return create_lb_qids(t, num_qids, RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY);
+	return create_lb_qids(t, num_qids, RTE_SCHED_TYPE_PARALLEL);
 }
 
 static inline int
@@ -1238,7 +1238,7 @@ port_reconfig_credits(struct test *t)
 	const uint32_t NUM_ITERS = 32;
 	for (i = 0; i < NUM_ITERS; i++) {
 		const struct rte_event_queue_conf conf = {
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 			.nb_atomic_flows = 1024,
 			.nb_atomic_order_sequences = 1024,
@@ -1320,7 +1320,7 @@ port_single_lb_reconfig(struct test *t)
 
 	static const struct rte_event_queue_conf conf_lb_atomic = {
 		.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
-		.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+		.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 		.nb_atomic_flows = 1024,
 		.nb_atomic_order_sequences = 1024,
 	};
@@ -1818,7 +1818,7 @@ ordered_reconfigure(struct test *t)
 	}
 
 	const struct rte_event_queue_conf conf = {
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ORDERED,
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 			.nb_atomic_flows = 1024,
 			.nb_atomic_order_sequences = 1024,
@@ -1865,7 +1865,7 @@ qid_priorities(struct test *t)
 	for (i = 0; i < 3; i++) {
 		/* Create QID */
 		const struct rte_event_queue_conf conf = {
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 			/* increase priority (0 == highest), as we go */
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL - i,
 			.nb_atomic_flows = 1024,
-- 
2.7.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH v2 2/3] eventdev: extend queue attribute get function
  2017-10-23 16:29 ` [dpdk-dev] [PATCH v2 " Pavan Nikhilesh
@ 2017-10-23 16:29   ` Pavan Nikhilesh
  2017-10-23 16:29   ` [dpdk-dev] [PATCH v2 3/3] doc: update eventdev programmers guide Pavan Nikhilesh
  1 sibling, 0 replies; 27+ messages in thread
From: Pavan Nikhilesh @ 2017-10-23 16:29 UTC (permalink / raw)
  To: harry.van.haaren, hemant.agrawal, jerin.jacob; +Cc: dev, Pavan Bhagavatula

From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>

Add schedule type queue attribute so that it can be queried along with
the queue config structure.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---

 v2 changes:
  - return EOVERFLOW when schedule_type is requested and event_queue_cfg is set
  to *ALL_TYPES*.

 lib/librte_eventdev/rte_eventdev.c | 6 ++++++
 lib/librte_eventdev/rte_eventdev.h | 7 +++++++
 2 files changed, 13 insertions(+)

diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
index db96552..fa18422 100644
--- a/lib/librte_eventdev/rte_eventdev.c
+++ b/lib/librte_eventdev/rte_eventdev.c
@@ -809,6 +809,12 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
 	case RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG:
 		*attr_value = conf->event_queue_cfg;
 		break;
+	case RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE:
+		if (conf->event_queue_cfg == RTE_EVENT_QUEUE_CFG_ALL_TYPES)
+			return -EOVERFLOW;
+
+		*attr_value = conf->schedule_type;
+		break;
 	default:
 		return -EINVAL;
 	};
diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
index fa16f82..b9d1b98 100644
--- a/lib/librte_eventdev/rte_eventdev.h
+++ b/lib/librte_eventdev/rte_eventdev.h
@@ -632,6 +632,10 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,
  * The cfg flags for the queue.
  */
 #define RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG 3
+/**
+ * The schedule type of the queue.
+ */
+#define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4

 /**
  * Get an attribute from a queue.
@@ -645,6 +649,9 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,
  * @retval 0 Successfully returned value
  *         -EINVAL invalid device, queue or attr_id provided, or attr_value
  *         was NULL
+ *         -EOVERFLOW returned when attr_id is set to
+ *         RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE and event_queue_cfg is set to
+ *         RTE_EVENT_QUEUE_CFG_ALL_TYPES
  */
 int
 rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
--
2.7.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev]  [PATCH v2 3/3] doc: update eventdev programmers guide
  2017-10-23 16:29 ` [dpdk-dev] [PATCH v2 " Pavan Nikhilesh
  2017-10-23 16:29   ` [dpdk-dev] [PATCH v2 2/3] eventdev: extend queue attribute get function Pavan Nikhilesh
@ 2017-10-23 16:29   ` Pavan Nikhilesh
  1 sibling, 0 replies; 27+ messages in thread
From: Pavan Nikhilesh @ 2017-10-23 16:29 UTC (permalink / raw)
  To: harry.van.haaren, hemant.agrawal, jerin.jacob; +Cc: dev, Pavan Bhagavatula

From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>

Update the guide with event queue configuration and event enqueue
operation.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 doc/guides/prog_guide/eventdev.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/guides/prog_guide/eventdev.rst b/doc/guides/prog_guide/eventdev.rst
index 908d123..be9fccd 100644
--- a/doc/guides/prog_guide/eventdev.rst
+++ b/doc/guides/prog_guide/eventdev.rst
@@ -217,7 +217,7 @@ calling the setup function. Repeat this step for each queue, starting from
 .. code-block:: c
 
         struct rte_event_queue_conf atomic_conf = {
-                .event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+                .schedule_type = RTE_SCHED_TYPE_ATOMIC,
                 .priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
                 .nb_atomic_flows = 1024,
                 .nb_atomic_order_sequences = 1024,
@@ -320,7 +320,7 @@ The following code shows how those packets can be enqueued into the eventdev:
         for (i = 0; i < nb_rx; i++) {
                 ev[i].flow_id = mbufs[i]->hash.rss;
                 ev[i].op = RTE_EVENT_OP_NEW;
-                ev[i].sched_type = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY;
+                ev[i].sched_type = RTE_SCHED_TYPE_ATOMIC;
                 ev[i].queue_id = 0;
                 ev[i].event_type = RTE_EVENT_TYPE_ETHDEV;
                 ev[i].sub_event_type = 0;
-- 
2.7.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH v3 1/3] evendev: fix inconsistency in event queue config
  2017-10-12 13:15 [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config Pavan Nikhilesh
                   ` (3 preceding siblings ...)
  2017-10-23 16:29 ` [dpdk-dev] [PATCH v2 " Pavan Nikhilesh
@ 2017-10-23 17:40 ` Pavan Nikhilesh
  2017-10-23 17:40   ` [dpdk-dev] [PATCH v3 2/3] eventdev: extend queue attribute get function Pavan Nikhilesh
                     ` (2 more replies)
  2017-10-25 14:21 ` [dpdk-dev] [PATCH v4 " Pavan Nikhilesh
  5 siblings, 3 replies; 27+ messages in thread
From: Pavan Nikhilesh @ 2017-10-23 17:40 UTC (permalink / raw)
  To: harry.van.haaren, hemant.agrawal, jerin.jacob; +Cc: dev, Pavan Bhagavatula

From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>

With the current scheme of event queue configuration the cfg schedule
type macros (RTE_EVENT_QUEUE_CFG_*_ONLY) are inconsistent with the
event schedule type (RTE_SCHED_TYPE_*) this requires unnecessary
conversion between the fastpath and slowpath API's while scheduling
events or configuring event queues.

This patch aims to fix such inconsistency by using event schedule
types (RTE_SCHED_TYPE_*) for event queue configuration.

This patch also fixes example/eventdev_pipeline_sw_pmd as it doesn't
convert RTE_EVENT_QUEUE_CFG_*_ONLY to RTE_SCHED_TYPE_* which leads to
improper events being enqueued to the eventdev.

Fixes: adb5d5486c39 ("examples/eventdev_pipeline_sw_pmd: add sample app")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---

 v3 changes:
  - fix app/test_perf_queue using invalid queue configuration i.e. setting
  schedule type in event_queue_cfg instead of schedule_type.

 app/test-eventdev/evt_common.h           | 21 -------------
 app/test-eventdev/test_order_queue.c     |  4 +--
 app/test-eventdev/test_perf_queue.c      |  4 +--
 drivers/event/dpaa2/dpaa2_eventdev.c     |  4 +--
 drivers/event/sw/sw_evdev.c              | 28 +++++------------
 examples/eventdev_pipeline_sw_pmd/main.c | 18 +++++------
 lib/librte_eventdev/rte_eventdev.c       | 20 +++++-------
 lib/librte_eventdev/rte_eventdev.h       | 54 ++++++++++----------------------
 test/test/test_eventdev.c                | 12 +++----
 test/test/test_eventdev_sw.c             | 16 +++++-----
 10 files changed, 60 insertions(+), 121 deletions(-)

diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h
index 4102076..ee896a2 100644
--- a/app/test-eventdev/evt_common.h
+++ b/app/test-eventdev/evt_common.h
@@ -92,25 +92,4 @@ evt_has_all_types_queue(uint8_t dev_id)
 			true : false;
 }

-static inline uint32_t
-evt_sched_type2queue_cfg(uint8_t sched_type)
-{
-	uint32_t ret;
-
-	switch (sched_type) {
-	case RTE_SCHED_TYPE_ATOMIC:
-		ret = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY;
-		break;
-	case RTE_SCHED_TYPE_ORDERED:
-		ret = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY;
-		break;
-	case RTE_SCHED_TYPE_PARALLEL:
-		ret = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
-		break;
-	default:
-		rte_panic("Invalid sched_type %d\n", sched_type);
-	}
-	return ret;
-}
-
 #endif /*  _EVT_COMMON_*/
diff --git a/app/test-eventdev/test_order_queue.c b/app/test-eventdev/test_order_queue.c
index beadd9c..1fa4082 100644
--- a/app/test-eventdev/test_order_queue.c
+++ b/app/test-eventdev/test_order_queue.c
@@ -164,7 +164,7 @@ order_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	/* q0 (ordered queue) configuration */
 	struct rte_event_queue_conf q0_ordered_conf = {
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ORDERED,
 			.nb_atomic_flows = opt->nb_flows,
 			.nb_atomic_order_sequences = opt->nb_flows,
 	};
@@ -177,7 +177,7 @@ order_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	/* q1 (atomic queue) configuration */
 	struct rte_event_queue_conf q1_atomic_conf = {
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 			.nb_atomic_flows = opt->nb_flows,
 			.nb_atomic_order_sequences = opt->nb_flows,
 	};
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index 658c08a..a7a2b1f 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -205,8 +205,8 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	};
 	/* queue configurations */
 	for (queue = 0; queue < perf_queue_nb_event_queues(opt); queue++) {
-		q_conf.event_queue_cfg =  evt_sched_type2queue_cfg
-				(opt->sched_type_list[queue % nb_stages]);
+		q_conf.schedule_type =
+			(opt->sched_type_list[queue % nb_stages]);

 		if (opt->q_priority) {
 			uint8_t stage_pos = queue % nb_stages;
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 81286a8..3dbc337 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -378,8 +378,8 @@ dpaa2_eventdev_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id,
 	RTE_SET_USED(queue_conf);

 	queue_conf->nb_atomic_flows = DPAA2_EVENT_QUEUE_ATOMIC_FLOWS;
-	queue_conf->event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY |
-				      RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
+	queue_conf->schedule_type = RTE_SCHED_TYPE_ATOMIC |
+				      RTE_SCHED_TYPE_PARALLEL;
 	queue_conf->priority = RTE_EVENT_DEV_PRIORITY_NORMAL;
 }

diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index aed8b72..522cd71 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -345,28 +345,14 @@ sw_queue_setup(struct rte_eventdev *dev, uint8_t queue_id,
 {
 	int type;

-	/* SINGLE_LINK can be OR-ed with other types, so handle first */
+	type = conf->schedule_type;
+
 	if (RTE_EVENT_QUEUE_CFG_SINGLE_LINK & conf->event_queue_cfg) {
 		type = SW_SCHED_TYPE_DIRECT;
-	} else {
-		switch (conf->event_queue_cfg) {
-		case RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY:
-			type = RTE_SCHED_TYPE_ATOMIC;
-			break;
-		case RTE_EVENT_QUEUE_CFG_ORDERED_ONLY:
-			type = RTE_SCHED_TYPE_ORDERED;
-			break;
-		case RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY:
-			type = RTE_SCHED_TYPE_PARALLEL;
-			break;
-		case RTE_EVENT_QUEUE_CFG_ALL_TYPES:
-			SW_LOG_ERR("QUEUE_CFG_ALL_TYPES not supported\n");
-			return -ENOTSUP;
-		default:
-			SW_LOG_ERR("Unknown queue type %d requested\n",
-				   conf->event_queue_cfg);
-			return -EINVAL;
-		}
+	} else if (RTE_EVENT_QUEUE_CFG_ALL_TYPES
+			& conf->event_queue_cfg) {
+		SW_LOG_ERR("QUEUE_CFG_ALL_TYPES not supported\n");
+		return -ENOTSUP;
 	}

 	struct sw_evdev *sw = sw_pmd_priv(dev);
@@ -400,7 +386,7 @@ sw_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id,
 	static const struct rte_event_queue_conf default_conf = {
 		.nb_atomic_flows = 4096,
 		.nb_atomic_order_sequences = 1,
-		.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+		.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 		.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 	};

diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c
index 09b90c3..2e6787b 100644
--- a/examples/eventdev_pipeline_sw_pmd/main.c
+++ b/examples/eventdev_pipeline_sw_pmd/main.c
@@ -108,7 +108,7 @@ struct config_data {
 static struct config_data cdata = {
 	.num_packets = (1L << 25), /* do ~32M packets */
 	.num_fids = 512,
-	.queue_type = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+	.queue_type = RTE_SCHED_TYPE_ATOMIC,
 	.next_qid = {-1},
 	.qid = {-1},
 	.num_stages = 1,
@@ -490,10 +490,10 @@ parse_app_args(int argc, char **argv)
 			cdata.enable_queue_priorities = 1;
 			break;
 		case 'o':
-			cdata.queue_type = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY;
+			cdata.queue_type = RTE_SCHED_TYPE_ORDERED;
 			break;
 		case 'p':
-			cdata.queue_type = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
+			cdata.queue_type = RTE_SCHED_TYPE_PARALLEL;
 			break;
 		case 'q':
 			cdata.quiet = 1;
@@ -684,7 +684,7 @@ setup_eventdev(struct prod_data *prod_data,
 			.new_event_threshold = 4096,
 	};
 	struct rte_event_queue_conf wkr_q_conf = {
-			.event_queue_cfg = cdata.queue_type,
+			.schedule_type = cdata.queue_type,
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 			.nb_atomic_flows = 1024,
 			.nb_atomic_order_sequences = 1024,
@@ -751,11 +751,11 @@ setup_eventdev(struct prod_data *prod_data,
 		}

 		const char *type_str = "Atomic";
-		switch (wkr_q_conf.event_queue_cfg) {
-		case RTE_EVENT_QUEUE_CFG_ORDERED_ONLY:
+		switch (wkr_q_conf.schedule_type) {
+		case RTE_SCHED_TYPE_ORDERED:
 			type_str = "Ordered";
 			break;
-		case RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY:
+		case RTE_SCHED_TYPE_PARALLEL:
 			type_str = "Parallel";
 			break;
 		}
@@ -907,9 +907,9 @@ main(int argc, char **argv)
 		printf("\tworkers: %u\n", cdata.num_workers);
 		printf("\tpackets: %"PRIi64"\n", cdata.num_packets);
 		printf("\tQueue-prio: %u\n", cdata.enable_queue_priorities);
-		if (cdata.queue_type == RTE_EVENT_QUEUE_CFG_ORDERED_ONLY)
+		if (cdata.queue_type == RTE_SCHED_TYPE_ORDERED)
 			printf("\tqid0 type: ordered\n");
-		if (cdata.queue_type == RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY)
+		if (cdata.queue_type == RTE_SCHED_TYPE_ATOMIC)
 			printf("\tqid0 type: atomic\n");
 		printf("\tCores available: %u\n", rte_lcore_count());
 		printf("\tCores used: %u\n", cores_needed);
diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
index 378ccb5..db96552 100644
--- a/lib/librte_eventdev/rte_eventdev.c
+++ b/lib/librte_eventdev/rte_eventdev.c
@@ -517,13 +517,11 @@ is_valid_atomic_queue_conf(const struct rte_event_queue_conf *queue_conf)
 {
 	if (queue_conf &&
 		!(queue_conf->event_queue_cfg &
-		  RTE_EVENT_QUEUE_CFG_SINGLE_LINK) && (
+		  RTE_EVENT_QUEUE_CFG_SINGLE_LINK) &&
 		((queue_conf->event_queue_cfg &
-			RTE_EVENT_QUEUE_CFG_TYPE_MASK)
-			== RTE_EVENT_QUEUE_CFG_ALL_TYPES) ||
-		((queue_conf->event_queue_cfg &
-			RTE_EVENT_QUEUE_CFG_TYPE_MASK)
-			== RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY)
+			 RTE_EVENT_QUEUE_CFG_ALL_TYPES) ||
+		(queue_conf->schedule_type
+			== RTE_SCHED_TYPE_ATOMIC)
 		))
 		return 1;
 	else
@@ -535,13 +533,11 @@ is_valid_ordered_queue_conf(const struct rte_event_queue_conf *queue_conf)
 {
 	if (queue_conf &&
 		!(queue_conf->event_queue_cfg &
-		  RTE_EVENT_QUEUE_CFG_SINGLE_LINK) && (
-		((queue_conf->event_queue_cfg &
-			RTE_EVENT_QUEUE_CFG_TYPE_MASK)
-			== RTE_EVENT_QUEUE_CFG_ALL_TYPES) ||
+		  RTE_EVENT_QUEUE_CFG_SINGLE_LINK) &&
 		((queue_conf->event_queue_cfg &
-			RTE_EVENT_QUEUE_CFG_TYPE_MASK)
-			== RTE_EVENT_QUEUE_CFG_ORDERED_ONLY)
+			 RTE_EVENT_QUEUE_CFG_ALL_TYPES) ||
+		(queue_conf->schedule_type
+			== RTE_SCHED_TYPE_ORDERED)
 		))
 		return 1;
 	else
diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
index 1dbc872..fa16f82 100644
--- a/lib/librte_eventdev/rte_eventdev.h
+++ b/lib/librte_eventdev/rte_eventdev.h
@@ -270,9 +270,9 @@ struct rte_mbuf; /* we just use mbuf pointers; no need to include rte_mbuf.h */
 #define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES     (1ULL << 3)
 /**< Event device is capable of enqueuing events of any type to any queue.
  * If this capability is not set, the queue only supports events of the
- *  *RTE_EVENT_QUEUE_CFG_* type that it was created with.
+ *  *RTE_SCHED_TYPE_* type that it was created with.
  *
- * @see RTE_EVENT_QUEUE_CFG_* values
+ * @see RTE_SCHED_TYPE_* values
  */
 #define RTE_EVENT_DEV_CAP_BURST_MODE          (1ULL << 4)
 /**< Event device is capable of operating in burst mode for enqueue(forward,
@@ -515,39 +515,13 @@ rte_event_dev_configure(uint8_t dev_id,
 /* Event queue specific APIs */

 /* Event queue configuration bitmap flags */
-#define RTE_EVENT_QUEUE_CFG_TYPE_MASK          (3ULL << 0)
-/**< Mask for event queue schedule type configuration request */
-#define RTE_EVENT_QUEUE_CFG_ALL_TYPES          (0ULL << 0)
+#define RTE_EVENT_QUEUE_CFG_ALL_TYPES          (1ULL << 0)
 /**< Allow ATOMIC,ORDERED,PARALLEL schedule type enqueue
  *
  * @see RTE_SCHED_TYPE_ORDERED, RTE_SCHED_TYPE_ATOMIC, RTE_SCHED_TYPE_PARALLEL
  * @see rte_event_enqueue_burst()
  */
-#define RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY        (1ULL << 0)
-/**< Allow only ATOMIC schedule type enqueue
- *
- * The rte_event_enqueue_burst() result is undefined if the queue configured
- * with ATOMIC only and sched_type != RTE_SCHED_TYPE_ATOMIC
- *
- * @see RTE_SCHED_TYPE_ATOMIC, rte_event_enqueue_burst()
- */
-#define RTE_EVENT_QUEUE_CFG_ORDERED_ONLY       (2ULL << 0)
-/**< Allow only ORDERED schedule type enqueue
- *
- * The rte_event_enqueue_burst() result is undefined if the queue configured
- * with ORDERED only and sched_type != RTE_SCHED_TYPE_ORDERED
- *
- * @see RTE_SCHED_TYPE_ORDERED, rte_event_enqueue_burst()
- */
-#define RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY      (3ULL << 0)
-/**< Allow only PARALLEL schedule type enqueue
- *
- * The rte_event_enqueue_burst() result is undefined if the queue configured
- * with PARALLEL only and sched_type != RTE_SCHED_TYPE_PARALLEL
- *
- * @see RTE_SCHED_TYPE_PARALLEL, rte_event_enqueue_burst()
- */
-#define RTE_EVENT_QUEUE_CFG_SINGLE_LINK        (1ULL << 2)
+#define RTE_EVENT_QUEUE_CFG_SINGLE_LINK        (1ULL << 1)
 /**< This event queue links only to a single event port.
  *
  *  @see rte_event_port_setup(), rte_event_port_link()
@@ -558,8 +532,8 @@ struct rte_event_queue_conf {
 	uint32_t nb_atomic_flows;
 	/**< The maximum number of active flows this queue can track at any
 	 * given time. If the queue is configured for atomic scheduling (by
-	 * applying the RTE_EVENT_QUEUE_CFG_ALL_TYPES or
-	 * RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY flags to event_queue_cfg), then the
+	 * applying the RTE_EVENT_QUEUE_CFG_ALL_TYPES flag to event_queue_cfg
+	 * or RTE_SCHED_TYPE_ATOMIC flag to schedule_type), then the
 	 * value must be in the range of [1, nb_event_queue_flows], which was
 	 * previously provided in rte_event_dev_configure().
 	 */
@@ -572,12 +546,18 @@ struct rte_event_queue_conf {
 	 * event will be returned from dequeue until one or more entries are
 	 * freed up/released.
 	 * If the queue is configured for ordered scheduling (by applying the
-	 * RTE_EVENT_QUEUE_CFG_ALL_TYPES or RTE_EVENT_QUEUE_CFG_ORDERED_ONLY
-	 * flags to event_queue_cfg), then the value must be in the range of
-	 * [1, nb_event_queue_flows], which was previously supplied to
-	 * rte_event_dev_configure().
+	 * RTE_EVENT_QUEUE_CFG_ALL_TYPES flag to event_queue_cfg or
+	 * RTE_SCHED_TYPE_ORDERED flag to schedule_type), then the value must
+	 * be in the range of [1, nb_event_queue_flows], which was
+	 * previously supplied to rte_event_dev_configure().
+	 */
+	uint32_t event_queue_cfg;
+	/**< Queue cfg flags(EVENT_QUEUE_CFG_) */
+	uint8_t schedule_type;
+	/**< Queue schedule type(RTE_SCHED_TYPE_*).
+	 * Valid when RTE_EVENT_QUEUE_CFG_ALL_TYPES bit is not set in
+	 * event_queue_cfg.
 	 */
-	uint32_t event_queue_cfg; /**< Queue cfg flags(EVENT_QUEUE_CFG_) */
 	uint8_t priority;
 	/**< Priority for this event queue relative to other event queues.
 	 * The requested priority should in the range of
diff --git a/test/test/test_eventdev.c b/test/test/test_eventdev.c
index d6ade78..4118b75 100644
--- a/test/test/test_eventdev.c
+++ b/test/test/test_eventdev.c
@@ -300,15 +300,13 @@ test_eventdev_queue_setup(void)
 	/* Negative cases */
 	ret = rte_event_queue_default_conf_get(TEST_DEV_ID, 0, &qconf);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get queue0 info");
-	qconf.event_queue_cfg =	(RTE_EVENT_QUEUE_CFG_ALL_TYPES &
-		 RTE_EVENT_QUEUE_CFG_TYPE_MASK);
+	qconf.event_queue_cfg =	RTE_EVENT_QUEUE_CFG_ALL_TYPES;
 	qconf.nb_atomic_flows = info.max_event_queue_flows + 1;
 	ret = rte_event_queue_setup(TEST_DEV_ID, 0, &qconf);
 	TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret);

 	qconf.nb_atomic_flows = info.max_event_queue_flows;
-	qconf.event_queue_cfg =	(RTE_EVENT_QUEUE_CFG_ORDERED_ONLY &
-		 RTE_EVENT_QUEUE_CFG_TYPE_MASK);
+	qconf.schedule_type = RTE_SCHED_TYPE_ORDERED;
 	qconf.nb_atomic_order_sequences = info.max_event_queue_flows + 1;
 	ret = rte_event_queue_setup(TEST_DEV_ID, 0, &qconf);
 	TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret);
@@ -423,7 +421,7 @@ test_eventdev_queue_attr_nb_atomic_flows(void)
 		/* Assume PMD doesn't support atomic flows, return early */
 		return -ENOTSUP;

-	qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY;
+	qconf.schedule_type = RTE_SCHED_TYPE_ATOMIC;

 	for (i = 0; i < (int)queue_count; i++) {
 		ret = rte_event_queue_setup(TEST_DEV_ID, i, &qconf);
@@ -466,7 +464,7 @@ test_eventdev_queue_attr_nb_atomic_order_sequences(void)
 		/* Assume PMD doesn't support reordering */
 		return -ENOTSUP;

-	qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY;
+	qconf.schedule_type = RTE_SCHED_TYPE_ORDERED;

 	for (i = 0; i < (int)queue_count; i++) {
 		ret = rte_event_queue_setup(TEST_DEV_ID, i, &qconf);
@@ -507,7 +505,7 @@ test_eventdev_queue_attr_event_queue_cfg(void)
 	ret = rte_event_queue_default_conf_get(TEST_DEV_ID, 0, &qconf);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get queue0 def conf");

-	qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
+	qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_SINGLE_LINK;

 	for (i = 0; i < (int)queue_count; i++) {
 		ret = rte_event_queue_setup(TEST_DEV_ID, i, &qconf);
diff --git a/test/test/test_eventdev_sw.c b/test/test/test_eventdev_sw.c
index 7219886..dea302f 100644
--- a/test/test/test_eventdev_sw.c
+++ b/test/test/test_eventdev_sw.c
@@ -219,7 +219,7 @@ create_lb_qids(struct test *t, int num_qids, uint32_t flags)

 	/* Q creation */
 	const struct rte_event_queue_conf conf = {
-			.event_queue_cfg = flags,
+			.schedule_type = flags,
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 			.nb_atomic_flows = 1024,
 			.nb_atomic_order_sequences = 1024,
@@ -242,20 +242,20 @@ create_lb_qids(struct test *t, int num_qids, uint32_t flags)
 static inline int
 create_atomic_qids(struct test *t, int num_qids)
 {
-	return create_lb_qids(t, num_qids, RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY);
+	return create_lb_qids(t, num_qids, RTE_SCHED_TYPE_ATOMIC);
 }

 static inline int
 create_ordered_qids(struct test *t, int num_qids)
 {
-	return create_lb_qids(t, num_qids, RTE_EVENT_QUEUE_CFG_ORDERED_ONLY);
+	return create_lb_qids(t, num_qids, RTE_SCHED_TYPE_ORDERED);
 }


 static inline int
 create_unordered_qids(struct test *t, int num_qids)
 {
-	return create_lb_qids(t, num_qids, RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY);
+	return create_lb_qids(t, num_qids, RTE_SCHED_TYPE_PARALLEL);
 }

 static inline int
@@ -1238,7 +1238,7 @@ port_reconfig_credits(struct test *t)
 	const uint32_t NUM_ITERS = 32;
 	for (i = 0; i < NUM_ITERS; i++) {
 		const struct rte_event_queue_conf conf = {
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 			.nb_atomic_flows = 1024,
 			.nb_atomic_order_sequences = 1024,
@@ -1320,7 +1320,7 @@ port_single_lb_reconfig(struct test *t)

 	static const struct rte_event_queue_conf conf_lb_atomic = {
 		.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
-		.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+		.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 		.nb_atomic_flows = 1024,
 		.nb_atomic_order_sequences = 1024,
 	};
@@ -1818,7 +1818,7 @@ ordered_reconfigure(struct test *t)
 	}

 	const struct rte_event_queue_conf conf = {
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ORDERED,
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 			.nb_atomic_flows = 1024,
 			.nb_atomic_order_sequences = 1024,
@@ -1865,7 +1865,7 @@ qid_priorities(struct test *t)
 	for (i = 0; i < 3; i++) {
 		/* Create QID */
 		const struct rte_event_queue_conf conf = {
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 			/* increase priority (0 == highest), as we go */
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL - i,
 			.nb_atomic_flows = 1024,
--
2.7.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH v3 2/3] eventdev: extend queue attribute get function
  2017-10-23 17:40 ` [dpdk-dev] [PATCH v3 1/3] evendev: fix inconsistency in event queue config Pavan Nikhilesh
@ 2017-10-23 17:40   ` Pavan Nikhilesh
  2017-10-25 13:43     ` Van Haaren, Harry
  2017-10-23 17:40   ` [dpdk-dev] [PATCH v3 3/3] doc: update eventdev programmers guide Pavan Nikhilesh
  2017-10-25 13:42   ` [dpdk-dev] [PATCH v3 1/3] evendev: fix inconsistency in event queue config Van Haaren, Harry
  2 siblings, 1 reply; 27+ messages in thread
From: Pavan Nikhilesh @ 2017-10-23 17:40 UTC (permalink / raw)
  To: harry.van.haaren, hemant.agrawal, jerin.jacob; +Cc: dev, Pavan Bhagavatula

From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>

Add schedule type queue attribute so that it can be queried along with
the queue config structure.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---

 v2 changes:
  - return EOVERFLOW when schedule_type is requested and event_queue_cfg is set
  to *ALL_TYPES*.

 lib/librte_eventdev/rte_eventdev.c | 6 ++++++
 lib/librte_eventdev/rte_eventdev.h | 7 +++++++
 2 files changed, 13 insertions(+)

diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
index db96552..fa18422 100644
--- a/lib/librte_eventdev/rte_eventdev.c
+++ b/lib/librte_eventdev/rte_eventdev.c
@@ -809,6 +809,12 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
 	case RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG:
 		*attr_value = conf->event_queue_cfg;
 		break;
+	case RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE:
+		if (conf->event_queue_cfg == RTE_EVENT_QUEUE_CFG_ALL_TYPES)
+			return -EOVERFLOW;
+
+		*attr_value = conf->schedule_type;
+		break;
 	default:
 		return -EINVAL;
 	};
diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
index fa16f82..b9d1b98 100644
--- a/lib/librte_eventdev/rte_eventdev.h
+++ b/lib/librte_eventdev/rte_eventdev.h
@@ -632,6 +632,10 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,
  * The cfg flags for the queue.
  */
 #define RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG 3
+/**
+ * The schedule type of the queue.
+ */
+#define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4

 /**
  * Get an attribute from a queue.
@@ -645,6 +649,9 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,
  * @retval 0 Successfully returned value
  *         -EINVAL invalid device, queue or attr_id provided, or attr_value
  *         was NULL
+ *         -EOVERFLOW returned when attr_id is set to
+ *         RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE and event_queue_cfg is set to
+ *         RTE_EVENT_QUEUE_CFG_ALL_TYPES
  */
 int
 rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
--
2.7.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev]  [PATCH v3 3/3] doc: update eventdev programmers guide
  2017-10-23 17:40 ` [dpdk-dev] [PATCH v3 1/3] evendev: fix inconsistency in event queue config Pavan Nikhilesh
  2017-10-23 17:40   ` [dpdk-dev] [PATCH v3 2/3] eventdev: extend queue attribute get function Pavan Nikhilesh
@ 2017-10-23 17:40   ` Pavan Nikhilesh
  2017-10-25 13:43     ` Van Haaren, Harry
  2017-10-25 13:42   ` [dpdk-dev] [PATCH v3 1/3] evendev: fix inconsistency in event queue config Van Haaren, Harry
  2 siblings, 1 reply; 27+ messages in thread
From: Pavan Nikhilesh @ 2017-10-23 17:40 UTC (permalink / raw)
  To: harry.van.haaren, hemant.agrawal, jerin.jacob; +Cc: dev, Pavan Bhagavatula

From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>

Update the guide with event queue configuration and event enqueue
operation.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
 doc/guides/prog_guide/eventdev.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/guides/prog_guide/eventdev.rst b/doc/guides/prog_guide/eventdev.rst
index 908d123..be9fccd 100644
--- a/doc/guides/prog_guide/eventdev.rst
+++ b/doc/guides/prog_guide/eventdev.rst
@@ -217,7 +217,7 @@ calling the setup function. Repeat this step for each queue, starting from
 .. code-block:: c
 
         struct rte_event_queue_conf atomic_conf = {
-                .event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+                .schedule_type = RTE_SCHED_TYPE_ATOMIC,
                 .priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
                 .nb_atomic_flows = 1024,
                 .nb_atomic_order_sequences = 1024,
@@ -320,7 +320,7 @@ The following code shows how those packets can be enqueued into the eventdev:
         for (i = 0; i < nb_rx; i++) {
                 ev[i].flow_id = mbufs[i]->hash.rss;
                 ev[i].op = RTE_EVENT_OP_NEW;
-                ev[i].sched_type = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY;
+                ev[i].sched_type = RTE_SCHED_TYPE_ATOMIC;
                 ev[i].queue_id = 0;
                 ev[i].event_type = RTE_EVENT_TYPE_ETHDEV;
                 ev[i].sub_event_type = 0;
-- 
2.7.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v3 1/3] evendev: fix inconsistency in event queue config
  2017-10-23 17:40 ` [dpdk-dev] [PATCH v3 1/3] evendev: fix inconsistency in event queue config Pavan Nikhilesh
  2017-10-23 17:40   ` [dpdk-dev] [PATCH v3 2/3] eventdev: extend queue attribute get function Pavan Nikhilesh
  2017-10-23 17:40   ` [dpdk-dev] [PATCH v3 3/3] doc: update eventdev programmers guide Pavan Nikhilesh
@ 2017-10-25 13:42   ` Van Haaren, Harry
  2 siblings, 0 replies; 27+ messages in thread
From: Van Haaren, Harry @ 2017-10-25 13:42 UTC (permalink / raw)
  To: Pavan Nikhilesh, hemant.agrawal, jerin.jacob; +Cc: dev

> From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> Sent: Monday, October 23, 2017 6:41 PM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>; hemant.agrawal@nxp.com;
> jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org; Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v3 1/3] evendev: fix inconsistency in event queue
> config
> 
> From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
> 
> With the current scheme of event queue configuration the cfg schedule
> type macros (RTE_EVENT_QUEUE_CFG_*_ONLY) are inconsistent with the
> event schedule type (RTE_SCHED_TYPE_*) this requires unnecessary
> conversion between the fastpath and slowpath API's while scheduling
> events or configuring event queues.
> 
> This patch aims to fix such inconsistency by using event schedule
> types (RTE_SCHED_TYPE_*) for event queue configuration.
> 
> This patch also fixes example/eventdev_pipeline_sw_pmd as it doesn't
> convert RTE_EVENT_QUEUE_CFG_*_ONLY to RTE_SCHED_TYPE_* which leads to
> improper events being enqueued to the eventdev.
> 
> Fixes: adb5d5486c39 ("examples/eventdev_pipeline_sw_pmd: add sample app")
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---
> 
>  v3 changes:
>   - fix app/test_perf_queue using invalid queue configuration i.e. setting
>   schedule type in event_queue_cfg instead of schedule_type.

Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v3 2/3] eventdev: extend queue attribute get function
  2017-10-23 17:40   ` [dpdk-dev] [PATCH v3 2/3] eventdev: extend queue attribute get function Pavan Nikhilesh
@ 2017-10-25 13:43     ` Van Haaren, Harry
  2017-10-25 13:58       ` Pavan Nikhilesh Bhagavatula
  0 siblings, 1 reply; 27+ messages in thread
From: Van Haaren, Harry @ 2017-10-25 13:43 UTC (permalink / raw)
  To: Pavan Nikhilesh, hemant.agrawal, jerin.jacob; +Cc: dev

> From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> Sent: Monday, October 23, 2017 6:41 PM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>; hemant.agrawal@nxp.com;
> jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org; Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v3 2/3] eventdev: extend queue attribute get
> function
> 
> From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
> 
> Add schedule type queue attribute so that it can be queried along with
> the queue config structure.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---
> 
>  v2 changes:
>   - return EOVERFLOW when schedule_type is requested and event_queue_cfg is
> set
>   to *ALL_TYPES*.
> 
>  lib/librte_eventdev/rte_eventdev.c | 6 ++++++
>  lib/librte_eventdev/rte_eventdev.h | 7 +++++++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/lib/librte_eventdev/rte_eventdev.c
> b/lib/librte_eventdev/rte_eventdev.c
> index db96552..fa18422 100644
> --- a/lib/librte_eventdev/rte_eventdev.c
> +++ b/lib/librte_eventdev/rte_eventdev.c
> @@ -809,6 +809,12 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t
> queue_id, uint32_t attr_id,
>  	case RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG:
>  		*attr_value = conf->event_queue_cfg;
>  		break;
> +	case RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE:
> +		if (conf->event_queue_cfg == RTE_EVENT_QUEUE_CFG_ALL_TYPES)
> +			return -EOVERFLOW;

I think event_queue_cfg is a bit-set right? The == on this line above is a bug in that case, should be &

<snip>

With above comments;

Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v3 3/3] doc: update eventdev programmers guide
  2017-10-23 17:40   ` [dpdk-dev] [PATCH v3 3/3] doc: update eventdev programmers guide Pavan Nikhilesh
@ 2017-10-25 13:43     ` Van Haaren, Harry
  0 siblings, 0 replies; 27+ messages in thread
From: Van Haaren, Harry @ 2017-10-25 13:43 UTC (permalink / raw)
  To: Pavan Nikhilesh, hemant.agrawal, jerin.jacob; +Cc: dev

> From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> Sent: Monday, October 23, 2017 6:41 PM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>; hemant.agrawal@nxp.com;
> jerin.jacob@caviumnetworks.com
> Cc: dev@dpdk.org; Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v3 3/3] doc: update eventdev programmers guide
> 
> From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
> 
> Update the guide with event queue configuration and event enqueue
> operation.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>

Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v3 2/3] eventdev: extend queue attribute get function
  2017-10-25 13:43     ` Van Haaren, Harry
@ 2017-10-25 13:58       ` Pavan Nikhilesh Bhagavatula
  0 siblings, 0 replies; 27+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2017-10-25 13:58 UTC (permalink / raw)
  To: Van Haaren, Harry; +Cc: dev

On Wed, Oct 25, 2017 at 01:43:08PM +0000, Van Haaren, Harry wrote:
> > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> > Sent: Monday, October 23, 2017 6:41 PM
> > To: Van Haaren, Harry <harry.van.haaren@intel.com>; hemant.agrawal@nxp.com;
> > jerin.jacob@caviumnetworks.com
> > Cc: dev@dpdk.org; Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
> > Subject: [dpdk-dev] [PATCH v3 2/3] eventdev: extend queue attribute get
> > function
> >
> > From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
> >
> > Add schedule type queue attribute so that it can be queried along with
> > the queue config structure.
> >
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> > ---
> >
> >  v2 changes:
> >   - return EOVERFLOW when schedule_type is requested and event_queue_cfg is
> > set
> >   to *ALL_TYPES*.
> >
> >  lib/librte_eventdev/rte_eventdev.c | 6 ++++++
> >  lib/librte_eventdev/rte_eventdev.h | 7 +++++++
> >  2 files changed, 13 insertions(+)
> >
> > diff --git a/lib/librte_eventdev/rte_eventdev.c
> > b/lib/librte_eventdev/rte_eventdev.c
> > index db96552..fa18422 100644
> > --- a/lib/librte_eventdev/rte_eventdev.c
> > +++ b/lib/librte_eventdev/rte_eventdev.c
> > @@ -809,6 +809,12 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t
> > queue_id, uint32_t attr_id,
> >  	case RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG:
> >  		*attr_value = conf->event_queue_cfg;
> >  		break;
> > +	case RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE:
> > +		if (conf->event_queue_cfg == RTE_EVENT_QUEUE_CFG_ALL_TYPES)
> > +			return -EOVERFLOW;
>
> I think event_queue_cfg is a bit-set right? The == on this line above is a bug in that case, should be &
>
Good catch, will send out a v4.
> <snip>
>
> With above comments;
>
> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

Thanks,
Pavan

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH v4 1/3] evendev: fix inconsistency in event queue config
  2017-10-12 13:15 [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config Pavan Nikhilesh
                   ` (4 preceding siblings ...)
  2017-10-23 17:40 ` [dpdk-dev] [PATCH v3 1/3] evendev: fix inconsistency in event queue config Pavan Nikhilesh
@ 2017-10-25 14:21 ` Pavan Nikhilesh
  2017-10-25 14:21   ` [dpdk-dev] [PATCH v4 2/3] eventdev: extend queue attribute get function Pavan Nikhilesh
                     ` (2 more replies)
  5 siblings, 3 replies; 27+ messages in thread
From: Pavan Nikhilesh @ 2017-10-25 14:21 UTC (permalink / raw)
  To: harry.van.haaren, hemant.agrawal, jerin.jacob; +Cc: dev, Pavan Nikhilesh

With the current scheme of event queue configuration the cfg schedule
type macros (RTE_EVENT_QUEUE_CFG_*_ONLY) are inconsistent with the
event schedule type (RTE_SCHED_TYPE_*) this requires unnecessary
conversion between the fastpath and slowpath API's while scheduling
events or configuring event queues.

This patch aims to fix such inconsistency by using event schedule
types (RTE_SCHED_TYPE_*) for event queue configuration.

This patch also fixes example/eventdev_pipeline_sw_pmd as it doesn't
convert RTE_EVENT_QUEUE_CFG_*_ONLY to RTE_SCHED_TYPE_* which leads to
improper events being enqueued to the eventdev.

Fixes: adb5d5486c39 ("examples/eventdev_pipeline_sw_pmd: add sample app")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
---

 v3 changes:
  - fix app/test_perf_queue using invalid queue configuration i.e. setting
  schedule type in event_queue_cfg instead of schedule_type.

 app/test-eventdev/evt_common.h           | 21 -------------
 app/test-eventdev/test_order_queue.c     |  4 +--
 app/test-eventdev/test_perf_queue.c      |  4 +--
 drivers/event/dpaa2/dpaa2_eventdev.c     |  4 +--
 drivers/event/sw/sw_evdev.c              | 28 +++++------------
 examples/eventdev_pipeline_sw_pmd/main.c | 18 +++++------
 lib/librte_eventdev/rte_eventdev.c       | 20 +++++-------
 lib/librte_eventdev/rte_eventdev.h       | 54 ++++++++++----------------------
 test/test/test_eventdev.c                | 12 +++----
 test/test/test_eventdev_sw.c             | 16 +++++-----
 10 files changed, 60 insertions(+), 121 deletions(-)

diff --git a/app/test-eventdev/evt_common.h b/app/test-eventdev/evt_common.h
index 4102076..ee896a2 100644
--- a/app/test-eventdev/evt_common.h
+++ b/app/test-eventdev/evt_common.h
@@ -92,25 +92,4 @@ evt_has_all_types_queue(uint8_t dev_id)
 			true : false;
 }

-static inline uint32_t
-evt_sched_type2queue_cfg(uint8_t sched_type)
-{
-	uint32_t ret;
-
-	switch (sched_type) {
-	case RTE_SCHED_TYPE_ATOMIC:
-		ret = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY;
-		break;
-	case RTE_SCHED_TYPE_ORDERED:
-		ret = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY;
-		break;
-	case RTE_SCHED_TYPE_PARALLEL:
-		ret = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
-		break;
-	default:
-		rte_panic("Invalid sched_type %d\n", sched_type);
-	}
-	return ret;
-}
-
 #endif /*  _EVT_COMMON_*/
diff --git a/app/test-eventdev/test_order_queue.c b/app/test-eventdev/test_order_queue.c
index beadd9c..1fa4082 100644
--- a/app/test-eventdev/test_order_queue.c
+++ b/app/test-eventdev/test_order_queue.c
@@ -164,7 +164,7 @@ order_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	/* q0 (ordered queue) configuration */
 	struct rte_event_queue_conf q0_ordered_conf = {
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ORDERED,
 			.nb_atomic_flows = opt->nb_flows,
 			.nb_atomic_order_sequences = opt->nb_flows,
 	};
@@ -177,7 +177,7 @@ order_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	/* q1 (atomic queue) configuration */
 	struct rte_event_queue_conf q1_atomic_conf = {
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 			.nb_atomic_flows = opt->nb_flows,
 			.nb_atomic_order_sequences = opt->nb_flows,
 	};
diff --git a/app/test-eventdev/test_perf_queue.c b/app/test-eventdev/test_perf_queue.c
index 658c08a..a7a2b1f 100644
--- a/app/test-eventdev/test_perf_queue.c
+++ b/app/test-eventdev/test_perf_queue.c
@@ -205,8 +205,8 @@ perf_queue_eventdev_setup(struct evt_test *test, struct evt_options *opt)
 	};
 	/* queue configurations */
 	for (queue = 0; queue < perf_queue_nb_event_queues(opt); queue++) {
-		q_conf.event_queue_cfg =  evt_sched_type2queue_cfg
-				(opt->sched_type_list[queue % nb_stages]);
+		q_conf.schedule_type =
+			(opt->sched_type_list[queue % nb_stages]);

 		if (opt->q_priority) {
 			uint8_t stage_pos = queue % nb_stages;
diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c
index 81286a8..3dbc337 100644
--- a/drivers/event/dpaa2/dpaa2_eventdev.c
+++ b/drivers/event/dpaa2/dpaa2_eventdev.c
@@ -378,8 +378,8 @@ dpaa2_eventdev_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id,
 	RTE_SET_USED(queue_conf);

 	queue_conf->nb_atomic_flows = DPAA2_EVENT_QUEUE_ATOMIC_FLOWS;
-	queue_conf->event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY |
-				      RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
+	queue_conf->schedule_type = RTE_SCHED_TYPE_ATOMIC |
+				      RTE_SCHED_TYPE_PARALLEL;
 	queue_conf->priority = RTE_EVENT_DEV_PRIORITY_NORMAL;
 }

diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
index aed8b72..522cd71 100644
--- a/drivers/event/sw/sw_evdev.c
+++ b/drivers/event/sw/sw_evdev.c
@@ -345,28 +345,14 @@ sw_queue_setup(struct rte_eventdev *dev, uint8_t queue_id,
 {
 	int type;

-	/* SINGLE_LINK can be OR-ed with other types, so handle first */
+	type = conf->schedule_type;
+
 	if (RTE_EVENT_QUEUE_CFG_SINGLE_LINK & conf->event_queue_cfg) {
 		type = SW_SCHED_TYPE_DIRECT;
-	} else {
-		switch (conf->event_queue_cfg) {
-		case RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY:
-			type = RTE_SCHED_TYPE_ATOMIC;
-			break;
-		case RTE_EVENT_QUEUE_CFG_ORDERED_ONLY:
-			type = RTE_SCHED_TYPE_ORDERED;
-			break;
-		case RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY:
-			type = RTE_SCHED_TYPE_PARALLEL;
-			break;
-		case RTE_EVENT_QUEUE_CFG_ALL_TYPES:
-			SW_LOG_ERR("QUEUE_CFG_ALL_TYPES not supported\n");
-			return -ENOTSUP;
-		default:
-			SW_LOG_ERR("Unknown queue type %d requested\n",
-				   conf->event_queue_cfg);
-			return -EINVAL;
-		}
+	} else if (RTE_EVENT_QUEUE_CFG_ALL_TYPES
+			& conf->event_queue_cfg) {
+		SW_LOG_ERR("QUEUE_CFG_ALL_TYPES not supported\n");
+		return -ENOTSUP;
 	}

 	struct sw_evdev *sw = sw_pmd_priv(dev);
@@ -400,7 +386,7 @@ sw_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id,
 	static const struct rte_event_queue_conf default_conf = {
 		.nb_atomic_flows = 4096,
 		.nb_atomic_order_sequences = 1,
-		.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+		.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 		.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 	};

diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c
index 09b90c3..2e6787b 100644
--- a/examples/eventdev_pipeline_sw_pmd/main.c
+++ b/examples/eventdev_pipeline_sw_pmd/main.c
@@ -108,7 +108,7 @@ struct config_data {
 static struct config_data cdata = {
 	.num_packets = (1L << 25), /* do ~32M packets */
 	.num_fids = 512,
-	.queue_type = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+	.queue_type = RTE_SCHED_TYPE_ATOMIC,
 	.next_qid = {-1},
 	.qid = {-1},
 	.num_stages = 1,
@@ -490,10 +490,10 @@ parse_app_args(int argc, char **argv)
 			cdata.enable_queue_priorities = 1;
 			break;
 		case 'o':
-			cdata.queue_type = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY;
+			cdata.queue_type = RTE_SCHED_TYPE_ORDERED;
 			break;
 		case 'p':
-			cdata.queue_type = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
+			cdata.queue_type = RTE_SCHED_TYPE_PARALLEL;
 			break;
 		case 'q':
 			cdata.quiet = 1;
@@ -684,7 +684,7 @@ setup_eventdev(struct prod_data *prod_data,
 			.new_event_threshold = 4096,
 	};
 	struct rte_event_queue_conf wkr_q_conf = {
-			.event_queue_cfg = cdata.queue_type,
+			.schedule_type = cdata.queue_type,
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 			.nb_atomic_flows = 1024,
 			.nb_atomic_order_sequences = 1024,
@@ -751,11 +751,11 @@ setup_eventdev(struct prod_data *prod_data,
 		}

 		const char *type_str = "Atomic";
-		switch (wkr_q_conf.event_queue_cfg) {
-		case RTE_EVENT_QUEUE_CFG_ORDERED_ONLY:
+		switch (wkr_q_conf.schedule_type) {
+		case RTE_SCHED_TYPE_ORDERED:
 			type_str = "Ordered";
 			break;
-		case RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY:
+		case RTE_SCHED_TYPE_PARALLEL:
 			type_str = "Parallel";
 			break;
 		}
@@ -907,9 +907,9 @@ main(int argc, char **argv)
 		printf("\tworkers: %u\n", cdata.num_workers);
 		printf("\tpackets: %"PRIi64"\n", cdata.num_packets);
 		printf("\tQueue-prio: %u\n", cdata.enable_queue_priorities);
-		if (cdata.queue_type == RTE_EVENT_QUEUE_CFG_ORDERED_ONLY)
+		if (cdata.queue_type == RTE_SCHED_TYPE_ORDERED)
 			printf("\tqid0 type: ordered\n");
-		if (cdata.queue_type == RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY)
+		if (cdata.queue_type == RTE_SCHED_TYPE_ATOMIC)
 			printf("\tqid0 type: atomic\n");
 		printf("\tCores available: %u\n", rte_lcore_count());
 		printf("\tCores used: %u\n", cores_needed);
diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
index 378ccb5..db96552 100644
--- a/lib/librte_eventdev/rte_eventdev.c
+++ b/lib/librte_eventdev/rte_eventdev.c
@@ -517,13 +517,11 @@ is_valid_atomic_queue_conf(const struct rte_event_queue_conf *queue_conf)
 {
 	if (queue_conf &&
 		!(queue_conf->event_queue_cfg &
-		  RTE_EVENT_QUEUE_CFG_SINGLE_LINK) && (
+		  RTE_EVENT_QUEUE_CFG_SINGLE_LINK) &&
 		((queue_conf->event_queue_cfg &
-			RTE_EVENT_QUEUE_CFG_TYPE_MASK)
-			== RTE_EVENT_QUEUE_CFG_ALL_TYPES) ||
-		((queue_conf->event_queue_cfg &
-			RTE_EVENT_QUEUE_CFG_TYPE_MASK)
-			== RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY)
+			 RTE_EVENT_QUEUE_CFG_ALL_TYPES) ||
+		(queue_conf->schedule_type
+			== RTE_SCHED_TYPE_ATOMIC)
 		))
 		return 1;
 	else
@@ -535,13 +533,11 @@ is_valid_ordered_queue_conf(const struct rte_event_queue_conf *queue_conf)
 {
 	if (queue_conf &&
 		!(queue_conf->event_queue_cfg &
-		  RTE_EVENT_QUEUE_CFG_SINGLE_LINK) && (
-		((queue_conf->event_queue_cfg &
-			RTE_EVENT_QUEUE_CFG_TYPE_MASK)
-			== RTE_EVENT_QUEUE_CFG_ALL_TYPES) ||
+		  RTE_EVENT_QUEUE_CFG_SINGLE_LINK) &&
 		((queue_conf->event_queue_cfg &
-			RTE_EVENT_QUEUE_CFG_TYPE_MASK)
-			== RTE_EVENT_QUEUE_CFG_ORDERED_ONLY)
+			 RTE_EVENT_QUEUE_CFG_ALL_TYPES) ||
+		(queue_conf->schedule_type
+			== RTE_SCHED_TYPE_ORDERED)
 		))
 		return 1;
 	else
diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
index 1dbc872..fa16f82 100644
--- a/lib/librte_eventdev/rte_eventdev.h
+++ b/lib/librte_eventdev/rte_eventdev.h
@@ -270,9 +270,9 @@ struct rte_mbuf; /* we just use mbuf pointers; no need to include rte_mbuf.h */
 #define RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES     (1ULL << 3)
 /**< Event device is capable of enqueuing events of any type to any queue.
  * If this capability is not set, the queue only supports events of the
- *  *RTE_EVENT_QUEUE_CFG_* type that it was created with.
+ *  *RTE_SCHED_TYPE_* type that it was created with.
  *
- * @see RTE_EVENT_QUEUE_CFG_* values
+ * @see RTE_SCHED_TYPE_* values
  */
 #define RTE_EVENT_DEV_CAP_BURST_MODE          (1ULL << 4)
 /**< Event device is capable of operating in burst mode for enqueue(forward,
@@ -515,39 +515,13 @@ rte_event_dev_configure(uint8_t dev_id,
 /* Event queue specific APIs */

 /* Event queue configuration bitmap flags */
-#define RTE_EVENT_QUEUE_CFG_TYPE_MASK          (3ULL << 0)
-/**< Mask for event queue schedule type configuration request */
-#define RTE_EVENT_QUEUE_CFG_ALL_TYPES          (0ULL << 0)
+#define RTE_EVENT_QUEUE_CFG_ALL_TYPES          (1ULL << 0)
 /**< Allow ATOMIC,ORDERED,PARALLEL schedule type enqueue
  *
  * @see RTE_SCHED_TYPE_ORDERED, RTE_SCHED_TYPE_ATOMIC, RTE_SCHED_TYPE_PARALLEL
  * @see rte_event_enqueue_burst()
  */
-#define RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY        (1ULL << 0)
-/**< Allow only ATOMIC schedule type enqueue
- *
- * The rte_event_enqueue_burst() result is undefined if the queue configured
- * with ATOMIC only and sched_type != RTE_SCHED_TYPE_ATOMIC
- *
- * @see RTE_SCHED_TYPE_ATOMIC, rte_event_enqueue_burst()
- */
-#define RTE_EVENT_QUEUE_CFG_ORDERED_ONLY       (2ULL << 0)
-/**< Allow only ORDERED schedule type enqueue
- *
- * The rte_event_enqueue_burst() result is undefined if the queue configured
- * with ORDERED only and sched_type != RTE_SCHED_TYPE_ORDERED
- *
- * @see RTE_SCHED_TYPE_ORDERED, rte_event_enqueue_burst()
- */
-#define RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY      (3ULL << 0)
-/**< Allow only PARALLEL schedule type enqueue
- *
- * The rte_event_enqueue_burst() result is undefined if the queue configured
- * with PARALLEL only and sched_type != RTE_SCHED_TYPE_PARALLEL
- *
- * @see RTE_SCHED_TYPE_PARALLEL, rte_event_enqueue_burst()
- */
-#define RTE_EVENT_QUEUE_CFG_SINGLE_LINK        (1ULL << 2)
+#define RTE_EVENT_QUEUE_CFG_SINGLE_LINK        (1ULL << 1)
 /**< This event queue links only to a single event port.
  *
  *  @see rte_event_port_setup(), rte_event_port_link()
@@ -558,8 +532,8 @@ struct rte_event_queue_conf {
 	uint32_t nb_atomic_flows;
 	/**< The maximum number of active flows this queue can track at any
 	 * given time. If the queue is configured for atomic scheduling (by
-	 * applying the RTE_EVENT_QUEUE_CFG_ALL_TYPES or
-	 * RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY flags to event_queue_cfg), then the
+	 * applying the RTE_EVENT_QUEUE_CFG_ALL_TYPES flag to event_queue_cfg
+	 * or RTE_SCHED_TYPE_ATOMIC flag to schedule_type), then the
 	 * value must be in the range of [1, nb_event_queue_flows], which was
 	 * previously provided in rte_event_dev_configure().
 	 */
@@ -572,12 +546,18 @@ struct rte_event_queue_conf {
 	 * event will be returned from dequeue until one or more entries are
 	 * freed up/released.
 	 * If the queue is configured for ordered scheduling (by applying the
-	 * RTE_EVENT_QUEUE_CFG_ALL_TYPES or RTE_EVENT_QUEUE_CFG_ORDERED_ONLY
-	 * flags to event_queue_cfg), then the value must be in the range of
-	 * [1, nb_event_queue_flows], which was previously supplied to
-	 * rte_event_dev_configure().
+	 * RTE_EVENT_QUEUE_CFG_ALL_TYPES flag to event_queue_cfg or
+	 * RTE_SCHED_TYPE_ORDERED flag to schedule_type), then the value must
+	 * be in the range of [1, nb_event_queue_flows], which was
+	 * previously supplied to rte_event_dev_configure().
+	 */
+	uint32_t event_queue_cfg;
+	/**< Queue cfg flags(EVENT_QUEUE_CFG_) */
+	uint8_t schedule_type;
+	/**< Queue schedule type(RTE_SCHED_TYPE_*).
+	 * Valid when RTE_EVENT_QUEUE_CFG_ALL_TYPES bit is not set in
+	 * event_queue_cfg.
 	 */
-	uint32_t event_queue_cfg; /**< Queue cfg flags(EVENT_QUEUE_CFG_) */
 	uint8_t priority;
 	/**< Priority for this event queue relative to other event queues.
 	 * The requested priority should in the range of
diff --git a/test/test/test_eventdev.c b/test/test/test_eventdev.c
index d6ade78..4118b75 100644
--- a/test/test/test_eventdev.c
+++ b/test/test/test_eventdev.c
@@ -300,15 +300,13 @@ test_eventdev_queue_setup(void)
 	/* Negative cases */
 	ret = rte_event_queue_default_conf_get(TEST_DEV_ID, 0, &qconf);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get queue0 info");
-	qconf.event_queue_cfg =	(RTE_EVENT_QUEUE_CFG_ALL_TYPES &
-		 RTE_EVENT_QUEUE_CFG_TYPE_MASK);
+	qconf.event_queue_cfg =	RTE_EVENT_QUEUE_CFG_ALL_TYPES;
 	qconf.nb_atomic_flows = info.max_event_queue_flows + 1;
 	ret = rte_event_queue_setup(TEST_DEV_ID, 0, &qconf);
 	TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret);

 	qconf.nb_atomic_flows = info.max_event_queue_flows;
-	qconf.event_queue_cfg =	(RTE_EVENT_QUEUE_CFG_ORDERED_ONLY &
-		 RTE_EVENT_QUEUE_CFG_TYPE_MASK);
+	qconf.schedule_type = RTE_SCHED_TYPE_ORDERED;
 	qconf.nb_atomic_order_sequences = info.max_event_queue_flows + 1;
 	ret = rte_event_queue_setup(TEST_DEV_ID, 0, &qconf);
 	TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret);
@@ -423,7 +421,7 @@ test_eventdev_queue_attr_nb_atomic_flows(void)
 		/* Assume PMD doesn't support atomic flows, return early */
 		return -ENOTSUP;

-	qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY;
+	qconf.schedule_type = RTE_SCHED_TYPE_ATOMIC;

 	for (i = 0; i < (int)queue_count; i++) {
 		ret = rte_event_queue_setup(TEST_DEV_ID, i, &qconf);
@@ -466,7 +464,7 @@ test_eventdev_queue_attr_nb_atomic_order_sequences(void)
 		/* Assume PMD doesn't support reordering */
 		return -ENOTSUP;

-	qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY;
+	qconf.schedule_type = RTE_SCHED_TYPE_ORDERED;

 	for (i = 0; i < (int)queue_count; i++) {
 		ret = rte_event_queue_setup(TEST_DEV_ID, i, &qconf);
@@ -507,7 +505,7 @@ test_eventdev_queue_attr_event_queue_cfg(void)
 	ret = rte_event_queue_default_conf_get(TEST_DEV_ID, 0, &qconf);
 	TEST_ASSERT_SUCCESS(ret, "Failed to get queue0 def conf");

-	qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY;
+	qconf.event_queue_cfg = RTE_EVENT_QUEUE_CFG_SINGLE_LINK;

 	for (i = 0; i < (int)queue_count; i++) {
 		ret = rte_event_queue_setup(TEST_DEV_ID, i, &qconf);
diff --git a/test/test/test_eventdev_sw.c b/test/test/test_eventdev_sw.c
index 7219886..dea302f 100644
--- a/test/test/test_eventdev_sw.c
+++ b/test/test/test_eventdev_sw.c
@@ -219,7 +219,7 @@ create_lb_qids(struct test *t, int num_qids, uint32_t flags)

 	/* Q creation */
 	const struct rte_event_queue_conf conf = {
-			.event_queue_cfg = flags,
+			.schedule_type = flags,
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 			.nb_atomic_flows = 1024,
 			.nb_atomic_order_sequences = 1024,
@@ -242,20 +242,20 @@ create_lb_qids(struct test *t, int num_qids, uint32_t flags)
 static inline int
 create_atomic_qids(struct test *t, int num_qids)
 {
-	return create_lb_qids(t, num_qids, RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY);
+	return create_lb_qids(t, num_qids, RTE_SCHED_TYPE_ATOMIC);
 }

 static inline int
 create_ordered_qids(struct test *t, int num_qids)
 {
-	return create_lb_qids(t, num_qids, RTE_EVENT_QUEUE_CFG_ORDERED_ONLY);
+	return create_lb_qids(t, num_qids, RTE_SCHED_TYPE_ORDERED);
 }


 static inline int
 create_unordered_qids(struct test *t, int num_qids)
 {
-	return create_lb_qids(t, num_qids, RTE_EVENT_QUEUE_CFG_PARALLEL_ONLY);
+	return create_lb_qids(t, num_qids, RTE_SCHED_TYPE_PARALLEL);
 }

 static inline int
@@ -1238,7 +1238,7 @@ port_reconfig_credits(struct test *t)
 	const uint32_t NUM_ITERS = 32;
 	for (i = 0; i < NUM_ITERS; i++) {
 		const struct rte_event_queue_conf conf = {
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 			.nb_atomic_flows = 1024,
 			.nb_atomic_order_sequences = 1024,
@@ -1320,7 +1320,7 @@ port_single_lb_reconfig(struct test *t)

 	static const struct rte_event_queue_conf conf_lb_atomic = {
 		.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
-		.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+		.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 		.nb_atomic_flows = 1024,
 		.nb_atomic_order_sequences = 1024,
 	};
@@ -1818,7 +1818,7 @@ ordered_reconfigure(struct test *t)
 	}

 	const struct rte_event_queue_conf conf = {
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ORDERED_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ORDERED,
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
 			.nb_atomic_flows = 1024,
 			.nb_atomic_order_sequences = 1024,
@@ -1865,7 +1865,7 @@ qid_priorities(struct test *t)
 	for (i = 0; i < 3; i++) {
 		/* Create QID */
 		const struct rte_event_queue_conf conf = {
-			.event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+			.schedule_type = RTE_SCHED_TYPE_ATOMIC,
 			/* increase priority (0 == highest), as we go */
 			.priority = RTE_EVENT_DEV_PRIORITY_NORMAL - i,
 			.nb_atomic_flows = 1024,
--
2.7.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH v4 2/3] eventdev: extend queue attribute get function
  2017-10-25 14:21 ` [dpdk-dev] [PATCH v4 " Pavan Nikhilesh
@ 2017-10-25 14:21   ` Pavan Nikhilesh
  2017-10-25 14:21   ` [dpdk-dev] [PATCH v4 3/3] doc: update eventdev programmers guide Pavan Nikhilesh
  2017-10-26 22:26   ` [dpdk-dev] [PATCH v4 1/3] evendev: fix inconsistency in event queue config Thomas Monjalon
  2 siblings, 0 replies; 27+ messages in thread
From: Pavan Nikhilesh @ 2017-10-25 14:21 UTC (permalink / raw)
  To: harry.van.haaren, hemant.agrawal, jerin.jacob; +Cc: dev, Pavan Nikhilesh

Add schedule type queue attribute so that it can be queried along with
the queue config structure.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 v4 changes:
  - fix incorrect conditional check while returning queue schedule attribute.

 v2 changes:
  - return EOVERFLOW when schedule_type is requested and event_queue_cfg is set
  to *ALL_TYPES*.

 lib/librte_eventdev/rte_eventdev.c | 6 ++++++
 lib/librte_eventdev/rte_eventdev.h | 7 +++++++
 2 files changed, 13 insertions(+)

diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
index db96552..250bfc8 100644
--- a/lib/librte_eventdev/rte_eventdev.c
+++ b/lib/librte_eventdev/rte_eventdev.c
@@ -809,6 +809,12 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
 	case RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG:
 		*attr_value = conf->event_queue_cfg;
 		break;
+	case RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE:
+		if (conf->event_queue_cfg & RTE_EVENT_QUEUE_CFG_ALL_TYPES)
+			return -EOVERFLOW;
+
+		*attr_value = conf->schedule_type;
+		break;
 	default:
 		return -EINVAL;
 	};
diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
index fa16f82..b9d1b98 100644
--- a/lib/librte_eventdev/rte_eventdev.h
+++ b/lib/librte_eventdev/rte_eventdev.h
@@ -632,6 +632,10 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,
  * The cfg flags for the queue.
  */
 #define RTE_EVENT_QUEUE_ATTR_EVENT_QUEUE_CFG 3
+/**
+ * The schedule type of the queue.
+ */
+#define RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE 4

 /**
  * Get an attribute from a queue.
@@ -645,6 +649,9 @@ rte_event_queue_setup(uint8_t dev_id, uint8_t queue_id,
  * @retval 0 Successfully returned value
  *         -EINVAL invalid device, queue or attr_id provided, or attr_value
  *         was NULL
+ *         -EOVERFLOW returned when attr_id is set to
+ *         RTE_EVENT_QUEUE_ATTR_SCHEDULE_TYPE and event_queue_cfg is set to
+ *         RTE_EVENT_QUEUE_CFG_ALL_TYPES
  */
 int
 rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id,
--
2.7.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev]  [PATCH v4 3/3] doc: update eventdev programmers guide
  2017-10-25 14:21 ` [dpdk-dev] [PATCH v4 " Pavan Nikhilesh
  2017-10-25 14:21   ` [dpdk-dev] [PATCH v4 2/3] eventdev: extend queue attribute get function Pavan Nikhilesh
@ 2017-10-25 14:21   ` Pavan Nikhilesh
  2017-10-26 22:26   ` [dpdk-dev] [PATCH v4 1/3] evendev: fix inconsistency in event queue config Thomas Monjalon
  2 siblings, 0 replies; 27+ messages in thread
From: Pavan Nikhilesh @ 2017-10-25 14:21 UTC (permalink / raw)
  To: harry.van.haaren, hemant.agrawal, jerin.jacob; +Cc: dev, Pavan Nikhilesh

Update the guide with event queue configuration and event enqueue
operation.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 doc/guides/prog_guide/eventdev.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/guides/prog_guide/eventdev.rst b/doc/guides/prog_guide/eventdev.rst
index 908d123..be9fccd 100644
--- a/doc/guides/prog_guide/eventdev.rst
+++ b/doc/guides/prog_guide/eventdev.rst
@@ -217,7 +217,7 @@ calling the setup function. Repeat this step for each queue, starting from
 .. code-block:: c
 
         struct rte_event_queue_conf atomic_conf = {
-                .event_queue_cfg = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY,
+                .schedule_type = RTE_SCHED_TYPE_ATOMIC,
                 .priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
                 .nb_atomic_flows = 1024,
                 .nb_atomic_order_sequences = 1024,
@@ -320,7 +320,7 @@ The following code shows how those packets can be enqueued into the eventdev:
         for (i = 0; i < nb_rx; i++) {
                 ev[i].flow_id = mbufs[i]->hash.rss;
                 ev[i].op = RTE_EVENT_OP_NEW;
-                ev[i].sched_type = RTE_EVENT_QUEUE_CFG_ATOMIC_ONLY;
+                ev[i].sched_type = RTE_SCHED_TYPE_ATOMIC;
                 ev[i].queue_id = 0;
                 ev[i].event_type = RTE_EVENT_TYPE_ETHDEV;
                 ev[i].sub_event_type = 0;
-- 
2.7.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v4 1/3] evendev: fix inconsistency in event queue config
  2017-10-25 14:21 ` [dpdk-dev] [PATCH v4 " Pavan Nikhilesh
  2017-10-25 14:21   ` [dpdk-dev] [PATCH v4 2/3] eventdev: extend queue attribute get function Pavan Nikhilesh
  2017-10-25 14:21   ` [dpdk-dev] [PATCH v4 3/3] doc: update eventdev programmers guide Pavan Nikhilesh
@ 2017-10-26 22:26   ` Thomas Monjalon
  2 siblings, 0 replies; 27+ messages in thread
From: Thomas Monjalon @ 2017-10-26 22:26 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: dev, harry.van.haaren, hemant.agrawal, jerin.jacob

25/10/2017 16:21, Pavan Nikhilesh:
> With the current scheme of event queue configuration the cfg schedule
> type macros (RTE_EVENT_QUEUE_CFG_*_ONLY) are inconsistent with the
> event schedule type (RTE_SCHED_TYPE_*) this requires unnecessary
> conversion between the fastpath and slowpath API's while scheduling
> events or configuring event queues.
> 
> This patch aims to fix such inconsistency by using event schedule
> types (RTE_SCHED_TYPE_*) for event queue configuration.
> 
> This patch also fixes example/eventdev_pipeline_sw_pmd as it doesn't
> convert RTE_EVENT_QUEUE_CFG_*_ONLY to RTE_SCHED_TYPE_* which leads to
> improper events being enqueued to the eventdev.
> 
> Fixes: adb5d5486c39 ("examples/eventdev_pipeline_sw_pmd: add sample app")
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

Series applied, thanks

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2017-10-26 22:26 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-12 13:15 [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config Pavan Nikhilesh
2017-10-12 13:15 ` [dpdk-dev] [PATCH 2/3] eventdev: extend queue attribute get function Pavan Nikhilesh
2017-10-12 13:15 ` [dpdk-dev] [PATCH 3/3] doc: update eventdev programmers guide Pavan Nikhilesh
2017-10-20  9:54 ` [dpdk-dev] [PATCH 1/3] evendev: fix inconsistency in event queue config Van Haaren, Harry
2017-10-20 10:30   ` Pavan Nikhilesh Bhagavatula
2017-10-20 16:38     ` Van Haaren, Harry
2017-10-20 19:09       ` Pavan Nikhilesh Bhagavatula
2017-10-21 17:27         ` Jerin Jacob
2017-10-23  8:04         ` Van Haaren, Harry
2017-10-23  8:41           ` Pavan Nikhilesh Bhagavatula
2017-10-23 14:45             ` Van Haaren, Harry
2017-10-23 14:54               ` Pavan Nikhilesh Bhagavatula
2017-10-21 15:05       ` Jerin Jacob
2017-10-23 16:29 ` [dpdk-dev] [PATCH v2 " Pavan Nikhilesh
2017-10-23 16:29   ` [dpdk-dev] [PATCH v2 2/3] eventdev: extend queue attribute get function Pavan Nikhilesh
2017-10-23 16:29   ` [dpdk-dev] [PATCH v2 3/3] doc: update eventdev programmers guide Pavan Nikhilesh
2017-10-23 17:40 ` [dpdk-dev] [PATCH v3 1/3] evendev: fix inconsistency in event queue config Pavan Nikhilesh
2017-10-23 17:40   ` [dpdk-dev] [PATCH v3 2/3] eventdev: extend queue attribute get function Pavan Nikhilesh
2017-10-25 13:43     ` Van Haaren, Harry
2017-10-25 13:58       ` Pavan Nikhilesh Bhagavatula
2017-10-23 17:40   ` [dpdk-dev] [PATCH v3 3/3] doc: update eventdev programmers guide Pavan Nikhilesh
2017-10-25 13:43     ` Van Haaren, Harry
2017-10-25 13:42   ` [dpdk-dev] [PATCH v3 1/3] evendev: fix inconsistency in event queue config Van Haaren, Harry
2017-10-25 14:21 ` [dpdk-dev] [PATCH v4 " Pavan Nikhilesh
2017-10-25 14:21   ` [dpdk-dev] [PATCH v4 2/3] eventdev: extend queue attribute get function Pavan Nikhilesh
2017-10-25 14:21   ` [dpdk-dev] [PATCH v4 3/3] doc: update eventdev programmers guide Pavan Nikhilesh
2017-10-26 22:26   ` [dpdk-dev] [PATCH v4 1/3] evendev: fix inconsistency in event queue config Thomas Monjalon

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).