diff mbox

[API-NEXT,PATCHv2,03/11] api: sched: removed GROUP_DEFAULT

Message ID 1436310705-3993-1-git-send-email-bill.fischofer@linaro.org
State Accepted
Commit a6e3e9e4636a5afe0b7b7b0aa28f4f91c17a7987
Headers show

Commit Message

Bill Fischofer July 7, 2015, 11:11 p.m. UTC
From: Petri Savolainen <petri.savolainen@nokia.com>

User should care which group of thread will process events
from a queue. Removed default group and use all threads
group instead.

Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>
---

v2 rebases reflects scheduler test rename in test/validation hierarchy

 example/classifier/odp_classifier.c                       |  2 +-
 example/generator/odp_generator.c                         |  2 +-
 example/ipsec/odp_ipsec.c                                 | 10 +++++-----
 example/packet/odp_pktio.c                                |  2 +-
 example/timer/odp_timer_test.c                            |  2 +-
 include/odp/api/queue.h                                   |  9 +++------
 platform/linux-generic/include/odp/plat/queue_types.h     |  2 --
 platform/linux-generic/odp_queue.c                        |  2 +-
 test/performance/odp_l2fwd.c                              |  2 +-
 test/performance/odp_pktio_perf.c                         |  2 +-
 test/performance/odp_scheduling.c                         |  2 +-
 test/validation/classification/odp_classification_tests.c |  2 +-
 test/validation/pktio/pktio.c                             |  2 +-
 test/validation/scheduler/scheduler.c                     |  2 --
 14 files changed, 18 insertions(+), 25 deletions(-)
diff mbox

Patch

diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c
index bf7a8c6..6f7b101 100644
--- a/example/classifier/odp_classifier.c
+++ b/example/classifier/odp_classifier.c
@@ -211,7 +211,7 @@  static odp_pktio_t create_pktio(const char *dev, odp_pool_t pool)
 
 	qparam.sched.prio  = ODP_SCHED_PRIO_DEFAULT;
 	qparam.sched.sync  = ODP_SCHED_SYNC_ATOMIC;
-	qparam.sched.group = ODP_SCHED_GROUP_DEFAULT;
+	qparam.sched.group = ODP_SCHED_GROUP_ALL;
 	snprintf(inq_name, sizeof(inq_name), "%" PRIu64 "-pktio_inq_def",
 		 odp_pktio_to_u64(pktio));
 	inq_name[ODP_QUEUE_NAME_LEN - 1] = '\0';
diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
index 3a8105e..780cdf2 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -342,7 +342,7 @@  static odp_pktio_t create_pktio(const char *dev, odp_pool_t pool)
 	 */
 	qparam.sched.prio  = ODP_SCHED_PRIO_DEFAULT;
 	qparam.sched.sync  = ODP_SCHED_SYNC_ATOMIC;
-	qparam.sched.group = ODP_SCHED_GROUP_DEFAULT;
+	qparam.sched.group = ODP_SCHED_GROUP_ALL;
 	snprintf(inq_name, sizeof(inq_name), "%" PRIu64 "-pktio_inq_def",
 		 odp_pktio_to_u64(pktio));
 	inq_name[ODP_QUEUE_NAME_LEN - 1] = '\0';
diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
index 1763f5c..d892803 100644
--- a/example/ipsec/odp_ipsec.c
+++ b/example/ipsec/odp_ipsec.c
@@ -325,7 +325,7 @@  void ipsec_init_pre(void)
 	 */
 	qparam.sched.prio  = ODP_SCHED_PRIO_HIGHEST;
 	qparam.sched.sync  = ODP_SCHED_SYNC_ATOMIC;
-	qparam.sched.group = ODP_SCHED_GROUP_DEFAULT;
+	qparam.sched.group = ODP_SCHED_GROUP_ALL;
 
 	completionq = queue_create("completion",
 				   ODP_QUEUE_TYPE_SCHED,
@@ -337,7 +337,7 @@  void ipsec_init_pre(void)
 
 	qparam.sched.prio  = ODP_SCHED_PRIO_HIGHEST;
 	qparam.sched.sync  = ODP_SCHED_SYNC_ATOMIC;
-	qparam.sched.group = ODP_SCHED_GROUP_DEFAULT;
+	qparam.sched.group = ODP_SCHED_GROUP_ALL;
 
 	seqnumq = queue_create("seqnum",
 			       ODP_QUEUE_TYPE_SCHED,
@@ -450,7 +450,7 @@  void initialize_loop(char *intf)
 	/* Create input queue */
 	qparam.sched.prio  = ODP_SCHED_PRIO_DEFAULT;
 	qparam.sched.sync  = ODP_SCHED_SYNC_ATOMIC;
-	qparam.sched.group = ODP_SCHED_GROUP_DEFAULT;
+	qparam.sched.group = ODP_SCHED_GROUP_ALL;
 	snprintf(queue_name, sizeof(queue_name), "%i-loop_inq_def", idx);
 	queue_name[ODP_QUEUE_NAME_LEN - 1] = '\0';
 
@@ -463,7 +463,7 @@  void initialize_loop(char *intf)
 	/* Create output queue */
 	qparam.sched.prio  = ODP_SCHED_PRIO_DEFAULT;
 	qparam.sched.sync  = ODP_SCHED_SYNC_ATOMIC;
-	qparam.sched.group = ODP_SCHED_GROUP_DEFAULT;
+	qparam.sched.group = ODP_SCHED_GROUP_ALL;
 	snprintf(queue_name, sizeof(queue_name), "%i-loop_outq_def", idx);
 	queue_name[ODP_QUEUE_NAME_LEN - 1] = '\0';
 
@@ -535,7 +535,7 @@  void initialize_intf(char *intf)
 	 */
 	qparam.sched.prio  = ODP_SCHED_PRIO_DEFAULT;
 	qparam.sched.sync  = ODP_SCHED_SYNC_ATOMIC;
-	qparam.sched.group = ODP_SCHED_GROUP_DEFAULT;
+	qparam.sched.group = ODP_SCHED_GROUP_ALL;
 	snprintf(inq_name, sizeof(inq_name), "%" PRIu64 "-pktio_inq_def",
 		 odp_pktio_to_u64(pktio));
 	inq_name[ODP_QUEUE_NAME_LEN - 1] = '\0';
diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
index d2e4d9c..7dc867d 100644
--- a/example/packet/odp_pktio.c
+++ b/example/packet/odp_pktio.c
@@ -154,7 +154,7 @@  static odp_pktio_t create_pktio(const char *dev, odp_pool_t pool, int mode)
 	case APPL_MODE_PKT_SCHED:
 		qparam.sched.prio  = ODP_SCHED_PRIO_DEFAULT;
 		qparam.sched.sync  = ODP_SCHED_SYNC_ATOMIC;
-		qparam.sched.group = ODP_SCHED_GROUP_DEFAULT;
+		qparam.sched.group = ODP_SCHED_GROUP_ALL;
 
 		inq_def = odp_queue_create(inq_name,
 					   ODP_QUEUE_TYPE_PKTIN, &qparam);
diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
index 4e090fd..aabc012 100644
--- a/example/timer/odp_timer_test.c
+++ b/example/timer/odp_timer_test.c
@@ -428,7 +428,7 @@  int main(int argc, char *argv[])
 	memset(&param, 0, sizeof(param));
 	param.sched.prio  = ODP_SCHED_PRIO_DEFAULT;
 	param.sched.sync  = ODP_SCHED_SYNC_NONE;
-	param.sched.group = ODP_SCHED_GROUP_DEFAULT;
+	param.sched.group = ODP_SCHED_GROUP_ALL;
 
 	queue = odp_queue_create("timer_queue", ODP_QUEUE_TYPE_SCHED, &param);
 
diff --git a/include/odp/api/queue.h b/include/odp/api/queue.h
index f746ac0..0852119 100644
--- a/include/odp/api/queue.h
+++ b/include/odp/api/queue.h
@@ -145,12 +145,9 @@  extern "C" {
 
 /**
  * @def ODP_SCHED_GROUP_ALL
- * Group of all cores
- */
-
-/**
- * @def ODP_SCHED_GROUP_DEFAULT
- * Default core group
+ * Group of all threads. All active worker and control threads belong to this
+ * group. The group is automatically updated when new threads enter or old
+ * threads exit ODP.
  */
 
 /**
diff --git a/platform/linux-generic/include/odp/plat/queue_types.h b/platform/linux-generic/include/odp/plat/queue_types.h
index 9f398a1..7ab19e6 100644
--- a/platform/linux-generic/include/odp/plat/queue_types.h
+++ b/platform/linux-generic/include/odp/plat/queue_types.h
@@ -62,8 +62,6 @@  typedef int odp_schedule_group_t;
 
 #define ODP_SCHED_GROUP_ALL     0
 
-#define ODP_SCHED_GROUP_DEFAULT ODP_SCHED_GROUP_ALL
-
 /** Get printable format of odp_queue_t */
 static inline uint64_t odp_queue_to_u64(odp_queue_t hdl)
 {
diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c
index 54ed674..2546e2b 100644
--- a/platform/linux-generic/odp_queue.c
+++ b/platform/linux-generic/odp_queue.c
@@ -62,7 +62,7 @@  static void queue_init(queue_entry_t *queue, const char *name,
 		memset(&queue->s.param, 0, sizeof(odp_queue_param_t));
 		queue->s.param.sched.prio  = ODP_SCHED_PRIO_DEFAULT;
 		queue->s.param.sched.sync  = ODP_SCHED_SYNC_ATOMIC;
-		queue->s.param.sched.group = ODP_SCHED_GROUP_DEFAULT;
+		queue->s.param.sched.group = ODP_SCHED_GROUP_ALL;
 	}
 
 	switch (type) {
diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c
index 0576bc0..7394dfc 100644
--- a/test/performance/odp_l2fwd.c
+++ b/test/performance/odp_l2fwd.c
@@ -294,7 +294,7 @@  static odp_pktio_t create_pktio(const char *dev, odp_pool_t pool,
 
 	qparam.sched.prio  = ODP_SCHED_PRIO_DEFAULT;
 	qparam.sched.sync  = ODP_SCHED_SYNC_ATOMIC;
-	qparam.sched.group = ODP_SCHED_GROUP_DEFAULT;
+	qparam.sched.group = ODP_SCHED_GROUP_ALL;
 	snprintf(inq_name, sizeof(inq_name), "%" PRIu64 "-pktio_inq_def",
 		 odp_pktio_to_u64(pktio));
 	inq_name[ODP_QUEUE_NAME_LEN - 1] = '\0';
diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c
index 26feafb..98511a5 100644
--- a/test/performance/odp_pktio_perf.c
+++ b/test/performance/odp_pktio_perf.c
@@ -747,7 +747,7 @@  static int test_init(void)
 	/* create and associate an input queue for the RX side */
 	qparam.sched.prio  = ODP_SCHED_PRIO_DEFAULT;
 	qparam.sched.sync  = ODP_SCHED_SYNC_NONE;
-	qparam.sched.group = ODP_SCHED_GROUP_DEFAULT;
+	qparam.sched.group = ODP_SCHED_GROUP_ALL;
 
 	snprintf(inq_name, sizeof(inq_name), "inq-pktio-%" PRIu64,
 		 odp_pktio_to_u64(gbl_args->pktio_rx));
diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c
index 14de848..8fa7734 100644
--- a/test/performance/odp_scheduling.c
+++ b/test/performance/odp_scheduling.c
@@ -956,7 +956,7 @@  int main(int argc, char *argv[])
 
 		param.sched.prio  = i;
 		param.sched.sync  = ODP_SCHED_SYNC_ATOMIC;
-		param.sched.group = ODP_SCHED_GROUP_DEFAULT;
+		param.sched.group = ODP_SCHED_GROUP_ALL;
 
 		for (j = 0; j < QUEUES_PER_PRIO; j++) {
 			name[9]  = '0' + j/10;
diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c
index 0ec9b78..45f3e3b 100644
--- a/test/validation/classification/odp_classification_tests.c
+++ b/test/validation/classification/odp_classification_tests.c
@@ -307,7 +307,7 @@  int classification_suite_init(void)
 	}
 	qparam.sched.prio  = ODP_SCHED_PRIO_DEFAULT;
 	qparam.sched.sync  = ODP_SCHED_SYNC_ATOMIC;
-	qparam.sched.group = ODP_SCHED_GROUP_DEFAULT;
+	qparam.sched.group = ODP_SCHED_GROUP_ALL;
 
 	sprintf(queuename, "%s", "inq_loop");
 	inq_def = odp_queue_create(queuename,
diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
index fd16300..6b4f3fb 100644
--- a/test/validation/pktio/pktio.c
+++ b/test/validation/pktio/pktio.c
@@ -251,7 +251,7 @@  static int create_inq(odp_pktio_t pktio, odp_queue_type_t qtype)
 
 	qparam.sched.prio  = ODP_SCHED_PRIO_DEFAULT;
 	qparam.sched.sync  = ODP_SCHED_SYNC_ATOMIC;
-	qparam.sched.group = ODP_SCHED_GROUP_DEFAULT;
+	qparam.sched.group = ODP_SCHED_GROUP_ALL;
 
 	snprintf(inq_name, sizeof(inq_name), "inq-pktio-%" PRIu64,
 		 odp_pktio_to_u64(pktio));
diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c
index 85a57eb..92ce5dc 100644
--- a/test/validation/scheduler/scheduler.c
+++ b/test/validation/scheduler/scheduler.c
@@ -123,7 +123,6 @@  static void scheduler_test_queue_destroy(void)
 
 	for (i = 0; i < 3; i++) {
 		qp.sched.prio  = ODP_SCHED_PRIO_DEFAULT;
-		qp.sched.group = ODP_SCHED_GROUP_DEFAULT;
 		qp.sched.sync  = sync[i];
 
 		queue = odp_queue_create("sched_destroy_queue",
@@ -623,7 +622,6 @@  static int create_queues(void)
 	for (i = 0; i < prios; i++) {
 		odp_queue_param_t p;
 		p.sched.prio  = i;
-		p.sched.group = ODP_SCHED_GROUP_DEFAULT;
 
 		for (j = 0; j < QUEUES_PER_PRIO; j++) {
 			/* Per sched sync type */