aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@nokia.com>2016-04-21 14:21:40 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2016-04-22 17:35:38 +0300
commit238dad1279a3057385fe621a9f14ea818fc9c845 (patch)
treea129732a203ef9921d6fc3d79e5b5c5c3a095a3a /test
parent407b0fa7f3105d63b102ff90b344851251b7c801 (diff)
api: queue: add queue context length
Added queue context length parameter, which is a hint for the implementation for how much to prefetch. Added the same in to the set function. It's not needed for get function since application can store the same into context data and implementation may avoid to save the length if it does not need it (e.g. always prefetches a fixed number of bytes). Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'test')
-rw-r--r--test/validation/queue/queue.c10
-rw-r--r--test/validation/scheduler/scheduler.c6
2 files changed, 9 insertions, 7 deletions
diff --git a/test/validation/queue/queue.c b/test/validation/queue/queue.c
index 50c6857d2..96d21fad6 100644
--- a/test/validation/queue/queue.c
+++ b/test/validation/queue/queue.c
@@ -12,7 +12,7 @@
#define MSG_POOL_SIZE (4 * 1024 * 1024)
#define CONFIG_MAX_ITERATION (100)
-static int queue_contest = 0xff;
+static int queue_context = 0xff;
static odp_pool_t pool;
int queue_suite_init(void)
@@ -76,10 +76,11 @@ void queue_test_sunnydays(void)
CU_ASSERT_EQUAL(ODP_SCHED_SYNC_PARALLEL,
odp_queue_sched_type(queue_id));
- CU_ASSERT(0 == odp_queue_context_set(queue_id, &queue_contest));
+ CU_ASSERT(0 == odp_queue_context_set(queue_id, &queue_context,
+ sizeof(queue_context)));
prtn = odp_queue_context(queue_id);
- CU_ASSERT(&queue_contest == (int *)prtn);
+ CU_ASSERT(&queue_context == (int *)prtn);
msg_pool = odp_pool_lookup("msg_pool");
buf = odp_buffer_alloc(msg_pool);
@@ -144,7 +145,8 @@ void queue_test_info(void)
/* Create a plain queue and set context */
q_plain = odp_queue_create(nq_plain, NULL);
CU_ASSERT(ODP_QUEUE_INVALID != q_plain);
- CU_ASSERT(odp_queue_context_set(q_plain, q_plain_ctx) == 0);
+ CU_ASSERT(odp_queue_context_set(q_plain, q_plain_ctx,
+ sizeof(q_plain_ctx)) == 0);
/* Create a scheduled ordered queue with explicitly set params */
odp_queue_param_init(&param);
diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c
index 9d626227f..5d2c04824 100644
--- a/test/validation/scheduler/scheduler.c
+++ b/test/validation/scheduler/scheduler.c
@@ -592,7 +592,7 @@ static void chaos_run(unsigned int qtype)
CU_ASSERT_FATAL(globals->chaos_q[i].handle !=
ODP_QUEUE_INVALID);
rc = odp_queue_context_set(globals->chaos_q[i].handle,
- CHAOS_NDX_TO_PTR(i));
+ CHAOS_NDX_TO_PTR(i), 0);
CU_ASSERT_FATAL(rc == 0);
}
@@ -1384,7 +1384,7 @@ static int create_queues(void)
pqctx->ctx_handle = queue_ctx_buf;
pqctx->sequence = 0;
- rc = odp_queue_context_set(pq, pqctx);
+ rc = odp_queue_context_set(pq, pqctx, 0);
if (rc != 0) {
printf("Cannot set plain queue context\n");
@@ -1429,7 +1429,7 @@ static int create_queues(void)
qctx->lock_sequence[ndx] = 0;
}
- rc = odp_queue_context_set(q, qctx);
+ rc = odp_queue_context_set(q, qctx, 0);
if (rc != 0) {
printf("Cannot set queue context\n");