diff mbox

[v2,1/3] example: odp_example: remove use of odp_schdule_one

Message ID 1419021288-29268-2-git-send-email-mike.holmes@linaro.org
State Rejected
Headers show

Commit Message

Mike Holmes Dec. 19, 2014, 8:34 p.m. UTC
The api odp_schedule_one has been removed, the examples should
not attempt to call it.

Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 example/odp_example/odp_example.c | 140 --------------------------------------
 1 file changed, 140 deletions(-)

Comments

Balasubramanian Manoharan Dec. 22, 2014, 5:48 a.m. UTC | #1
Reviewed-by: Bala Manoharan <bala.manoharan@linaro.org>

On Saturday 20 December 2014 02:04 AM, Mike Holmes wrote:
> The api odp_schedule_one has been removed, the examples should
> not attempt to call it.
>
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> ---
>   example/odp_example/odp_example.c | 140 --------------------------------------
>   1 file changed, 140 deletions(-)
>
> diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c
> index 8373f12..8f01292 100644
> --- a/example/odp_example/odp_example.c
> +++ b/example/odp_example/odp_example.c
> @@ -310,124 +310,6 @@ static int test_poll_queue(int thr, odp_buffer_pool_t msg_pool)
>   	return 0;
>   }
>   
> -/**
> - * @internal Test scheduling of a single queue - with odp_schedule_one()
> - *
> - * Enqueue a buffer to the shared queue. Schedule and enqueue the received
> - * buffer back into the queue.
> - *
> - * @param str      Test case name string
> - * @param thr      Thread
> - * @param msg_pool Buffer pool
> - * @param prio     Priority
> - * @param barrier  Barrier
> - *
> - * @return 0 if successful
> - */
> -static int test_schedule_one_single(const char *str, int thr,
> -				    odp_buffer_pool_t msg_pool,
> -				    int prio, odp_barrier_t *barrier)
> -{
> -	odp_buffer_t buf;
> -	odp_queue_t queue;
> -	uint64_t t1, t2, cycles, ns;
> -	uint32_t i;
> -	uint32_t tot = 0;
> -
> -	if (create_queue(thr, msg_pool, prio))
> -		return -1;
> -
> -	t1 = odp_time_cycles();
> -
> -	for (i = 0; i < QUEUE_ROUNDS; i++) {
> -		buf = odp_schedule_one(&queue, ODP_SCHED_WAIT);
> -
> -		if (odp_queue_enq(queue, buf)) {
> -			EXAMPLE_ERR("  [%i] Queue enqueue failed.\n", thr);
> -			return -1;
> -		}
> -	}
> -
> -	if (odp_queue_sched_type(queue) == ODP_SCHED_SYNC_ATOMIC)
> -		odp_schedule_release_atomic();
> -
> -	t2     = odp_time_cycles();
> -	cycles = odp_time_diff_cycles(t1, t2);
> -	ns     = odp_time_cycles_to_ns(cycles);
> -	tot    = i;
> -
> -	odp_barrier_wait(barrier);
> -	clear_sched_queues();
> -
> -	cycles = cycles/tot;
> -	ns     = ns/tot;
> -
> -	printf("  [%i] %s enq+deq %"PRIu64" cycles, %"PRIu64" ns\n",
> -	       thr, str, cycles, ns);
> -
> -	return 0;
> -}
> -
> -/**
> - * @internal Test scheduling of multiple queues - with odp_schedule_one()
> - *
> - * Enqueue a buffer to each queue. Schedule and enqueue the received
> - * buffer back into the queue it came from.
> - *
> - * @param str      Test case name string
> - * @param thr      Thread
> - * @param msg_pool Buffer pool
> - * @param prio     Priority
> - * @param barrier  Barrier
> - *
> - * @return 0 if successful
> - */
> -static int test_schedule_one_many(const char *str, int thr,
> -				  odp_buffer_pool_t msg_pool,
> -				  int prio, odp_barrier_t *barrier)
> -{
> -	odp_buffer_t buf;
> -	odp_queue_t queue;
> -	uint64_t t1 = 0;
> -	uint64_t t2 = 0;
> -	uint64_t cycles, ns;
> -	uint32_t i;
> -	uint32_t tot = 0;
> -
> -	if (create_queues(thr, msg_pool, prio))
> -		return -1;
> -
> -	/* Start sched-enq loop */
> -	t1 = odp_time_cycles();
> -
> -	for (i = 0; i < QUEUE_ROUNDS; i++) {
> -		buf = odp_schedule_one(&queue, ODP_SCHED_WAIT);
> -
> -		if (odp_queue_enq(queue, buf)) {
> -			EXAMPLE_ERR("  [%i] Queue enqueue failed.\n", thr);
> -			return -1;
> -		}
> -	}
> -
> -	if (odp_queue_sched_type(queue) == ODP_SCHED_SYNC_ATOMIC)
> -		odp_schedule_release_atomic();
> -
> -	t2     = odp_time_cycles();
> -	cycles = odp_time_diff_cycles(t1, t2);
> -	ns     = odp_time_cycles_to_ns(cycles);
> -	tot    = i;
> -
> -	odp_barrier_wait(barrier);
> -	clear_sched_queues();
> -
> -	cycles = cycles/tot;
> -	ns     = ns/tot;
> -
> -	printf("  [%i] %s enq+deq %"PRIu64" cycles, %"PRIu64" ns\n",
> -	       thr, str, cycles, ns);
> -
> -	return 0;
> -}
>   
>   /**
>    * @internal Test scheduling of a single queue - with odp_schedule()
> @@ -763,22 +645,12 @@ static void *run_thread(void *arg)
>   
>   	odp_barrier_wait(barrier);
>   
> -	if (test_schedule_one_single("sched_one_s_lo", thr, msg_pool,
> -				     ODP_SCHED_PRIO_LOWEST, barrier))
> -		return NULL;
> -
> -	odp_barrier_wait(barrier);
> -
>   	if (test_schedule_single("sched_____s_lo", thr, msg_pool,
>   				 ODP_SCHED_PRIO_LOWEST, barrier))
>   		return NULL;
>   
>   	odp_barrier_wait(barrier);
>   
> -	if (test_schedule_one_many("sched_one_m_lo", thr, msg_pool,
> -				   ODP_SCHED_PRIO_LOWEST, barrier))
> -		return NULL;
> -
>   	odp_barrier_wait(barrier);
>   
>   	if (test_schedule_many("sched_____m_lo", thr, msg_pool,
> @@ -795,24 +667,12 @@ static void *run_thread(void *arg)
>   
>   	odp_barrier_wait(barrier);
>   
> -	if (test_schedule_one_single("sched_one_s_hi", thr, msg_pool,
> -				     ODP_SCHED_PRIO_HIGHEST, barrier))
> -		return NULL;
> -
> -	odp_barrier_wait(barrier);
> -
>   	if (test_schedule_single("sched_____s_hi", thr, msg_pool,
>   				 ODP_SCHED_PRIO_HIGHEST, barrier))
>   		return NULL;
>   
>   	odp_barrier_wait(barrier);
>   
> -	if (test_schedule_one_many("sched_one_m_hi", thr, msg_pool,
> -				   ODP_SCHED_PRIO_HIGHEST, barrier))
> -		return NULL;
> -
> -	odp_barrier_wait(barrier);
> -
>   	if (test_schedule_many("sched_____m_hi", thr, msg_pool,
>   			       ODP_SCHED_PRIO_HIGHEST, barrier))
>   		return NULL;
diff mbox

Patch

diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c
index 8373f12..8f01292 100644
--- a/example/odp_example/odp_example.c
+++ b/example/odp_example/odp_example.c
@@ -310,124 +310,6 @@  static int test_poll_queue(int thr, odp_buffer_pool_t msg_pool)
 	return 0;
 }
 
-/**
- * @internal Test scheduling of a single queue - with odp_schedule_one()
- *
- * Enqueue a buffer to the shared queue. Schedule and enqueue the received
- * buffer back into the queue.
- *
- * @param str      Test case name string
- * @param thr      Thread
- * @param msg_pool Buffer pool
- * @param prio     Priority
- * @param barrier  Barrier
- *
- * @return 0 if successful
- */
-static int test_schedule_one_single(const char *str, int thr,
-				    odp_buffer_pool_t msg_pool,
-				    int prio, odp_barrier_t *barrier)
-{
-	odp_buffer_t buf;
-	odp_queue_t queue;
-	uint64_t t1, t2, cycles, ns;
-	uint32_t i;
-	uint32_t tot = 0;
-
-	if (create_queue(thr, msg_pool, prio))
-		return -1;
-
-	t1 = odp_time_cycles();
-
-	for (i = 0; i < QUEUE_ROUNDS; i++) {
-		buf = odp_schedule_one(&queue, ODP_SCHED_WAIT);
-
-		if (odp_queue_enq(queue, buf)) {
-			EXAMPLE_ERR("  [%i] Queue enqueue failed.\n", thr);
-			return -1;
-		}
-	}
-
-	if (odp_queue_sched_type(queue) == ODP_SCHED_SYNC_ATOMIC)
-		odp_schedule_release_atomic();
-
-	t2     = odp_time_cycles();
-	cycles = odp_time_diff_cycles(t1, t2);
-	ns     = odp_time_cycles_to_ns(cycles);
-	tot    = i;
-
-	odp_barrier_wait(barrier);
-	clear_sched_queues();
-
-	cycles = cycles/tot;
-	ns     = ns/tot;
-
-	printf("  [%i] %s enq+deq %"PRIu64" cycles, %"PRIu64" ns\n",
-	       thr, str, cycles, ns);
-
-	return 0;
-}
-
-/**
- * @internal Test scheduling of multiple queues - with odp_schedule_one()
- *
- * Enqueue a buffer to each queue. Schedule and enqueue the received
- * buffer back into the queue it came from.
- *
- * @param str      Test case name string
- * @param thr      Thread
- * @param msg_pool Buffer pool
- * @param prio     Priority
- * @param barrier  Barrier
- *
- * @return 0 if successful
- */
-static int test_schedule_one_many(const char *str, int thr,
-				  odp_buffer_pool_t msg_pool,
-				  int prio, odp_barrier_t *barrier)
-{
-	odp_buffer_t buf;
-	odp_queue_t queue;
-	uint64_t t1 = 0;
-	uint64_t t2 = 0;
-	uint64_t cycles, ns;
-	uint32_t i;
-	uint32_t tot = 0;
-
-	if (create_queues(thr, msg_pool, prio))
-		return -1;
-
-	/* Start sched-enq loop */
-	t1 = odp_time_cycles();
-
-	for (i = 0; i < QUEUE_ROUNDS; i++) {
-		buf = odp_schedule_one(&queue, ODP_SCHED_WAIT);
-
-		if (odp_queue_enq(queue, buf)) {
-			EXAMPLE_ERR("  [%i] Queue enqueue failed.\n", thr);
-			return -1;
-		}
-	}
-
-	if (odp_queue_sched_type(queue) == ODP_SCHED_SYNC_ATOMIC)
-		odp_schedule_release_atomic();
-
-	t2     = odp_time_cycles();
-	cycles = odp_time_diff_cycles(t1, t2);
-	ns     = odp_time_cycles_to_ns(cycles);
-	tot    = i;
-
-	odp_barrier_wait(barrier);
-	clear_sched_queues();
-
-	cycles = cycles/tot;
-	ns     = ns/tot;
-
-	printf("  [%i] %s enq+deq %"PRIu64" cycles, %"PRIu64" ns\n",
-	       thr, str, cycles, ns);
-
-	return 0;
-}
 
 /**
  * @internal Test scheduling of a single queue - with odp_schedule()
@@ -763,22 +645,12 @@  static void *run_thread(void *arg)
 
 	odp_barrier_wait(barrier);
 
-	if (test_schedule_one_single("sched_one_s_lo", thr, msg_pool,
-				     ODP_SCHED_PRIO_LOWEST, barrier))
-		return NULL;
-
-	odp_barrier_wait(barrier);
-
 	if (test_schedule_single("sched_____s_lo", thr, msg_pool,
 				 ODP_SCHED_PRIO_LOWEST, barrier))
 		return NULL;
 
 	odp_barrier_wait(barrier);
 
-	if (test_schedule_one_many("sched_one_m_lo", thr, msg_pool,
-				   ODP_SCHED_PRIO_LOWEST, barrier))
-		return NULL;
-
 	odp_barrier_wait(barrier);
 
 	if (test_schedule_many("sched_____m_lo", thr, msg_pool,
@@ -795,24 +667,12 @@  static void *run_thread(void *arg)
 
 	odp_barrier_wait(barrier);
 
-	if (test_schedule_one_single("sched_one_s_hi", thr, msg_pool,
-				     ODP_SCHED_PRIO_HIGHEST, barrier))
-		return NULL;
-
-	odp_barrier_wait(barrier);
-
 	if (test_schedule_single("sched_____s_hi", thr, msg_pool,
 				 ODP_SCHED_PRIO_HIGHEST, barrier))
 		return NULL;
 
 	odp_barrier_wait(barrier);
 
-	if (test_schedule_one_many("sched_one_m_hi", thr, msg_pool,
-				   ODP_SCHED_PRIO_HIGHEST, barrier))
-		return NULL;
-
-	odp_barrier_wait(barrier);
-
 	if (test_schedule_many("sched_____m_hi", thr, msg_pool,
 			       ODP_SCHED_PRIO_HIGHEST, barrier))
 		return NULL;