@@ -518,7 +518,7 @@ bool verify_stream_db_outputs(void)
int idx;
int count;
odp_queue_t queue;
- odp_buffer_t buf_tbl[LOOP_DEQ_COUNT];
+ odp_event_t ev_tbl[LOOP_DEQ_COUNT];
queue = query_loopback_db_outq(stream->output.loop);
@@ -528,13 +528,11 @@ bool verify_stream_db_outputs(void)
for (;;) {
#if LOOP_DEQ_MULTIPLE
count = odp_queue_deq_multi(queue,
- buf_tbl,
+ ev_tbl,
LOOP_DEQ_COUNT);
#else
- odp_event_t ev;
- ev = odp_queue_deq(queue);
- buf_tbl[0] = odp_buffer_from_event(ev);
- count = (buf_tbl[0] != ODP_BUFFER_INVALID) ? 1 : 0;
+ ev_tbl[0] = odp_queue_deq(queue);
+ count = (ev_tbl[0] != ODP_EVENT_INVALID) ? 1 : 0;
#endif
if (!count)
break;
@@ -542,7 +540,7 @@ bool verify_stream_db_outputs(void)
bool good;
odp_packet_t pkt;
- pkt = odp_packet_from_buffer(buf_tbl[idx]);
+ pkt = odp_packet_from_event(ev_tbl[idx]);
good = verify_ipv4_packet(stream, pkt);
if (good)
@@ -20,7 +20,7 @@ extern "C" {
#include <odp_std_types.h>
-#include <odp_buffer.h>
+#include <odp_platform_types.h>
/** @defgroup odp_queue ODP QUEUE
* Macros and operation on a queue.
@@ -204,18 +204,18 @@ int odp_queue_enq_multi(odp_queue_t queue, odp_event_t ev[], int num);
odp_event_t odp_queue_deq(odp_queue_t queue);
/**
- * Dequeue multiple buffers from a queue
+ * Dequeue multiple events from a queue
*
- * Dequeues multiple buffers from head of the queue. Cannot be used for
+ * Dequeues multiple events from head of the queue. Cannot be used for
* ODP_QUEUE_TYPE_SCHED type queues (use odp_schedule() instead).
*
* @param queue Queue handle
- * @param buf Buffer handles for output
- * @param num Maximum number of buffer handles
+ * @param events Event handle array for output
+ * @param num Maximum number of event handles
- * @return Number of buffers written (0 ... num)
+ * @return Number of events written (0 ... num)
*/
-int odp_queue_deq_multi(odp_queue_t queue, odp_buffer_t buf[], int num);
+int odp_queue_deq_multi(odp_queue_t queue, odp_event_t events[], int num);
/**
* Queue type
@@ -494,7 +494,7 @@ int queue_deq_multi_destroy(queue_entry_t *queue,
return 0;
}
-int odp_queue_deq_multi(odp_queue_t handle, odp_buffer_t buf[], int num)
+int odp_queue_deq_multi(odp_queue_t handle, odp_event_t events[], int num)
{
queue_entry_t *queue;
odp_buffer_hdr_t *buf_hdr[QUEUE_MULTI_MAX];
@@ -508,7 +508,7 @@ int odp_queue_deq_multi(odp_queue_t handle, odp_buffer_t buf[], int num)
ret = queue->s.dequeue_multi(queue, buf_hdr, num);
for (i = 0; i < ret; i++)
- buf[i] = buf_hdr[i]->handle.handle;
+ events[i] = odp_buffer_to_event(buf_hdr[i]->handle.handle);
return ret;
}
@@ -290,7 +290,7 @@ static int schedule(odp_queue_t *out_queue, odp_buffer_t out_buf[],
queue = desc->queue;
num = odp_queue_deq_multi(queue,
- sched_local.buf,
+ (odp_event_t *)sched_local.buf,
max_deq);
if (num == 0) {
@@ -36,11 +36,12 @@ static void test_odp_queue_sunnyday(void)
{
odp_queue_t queue_creat_id, queue_id;
odp_event_t enev[MAX_BUFFER_QUEUE];
- odp_buffer_t debuf[MAX_BUFFER_QUEUE];
+ odp_event_t deev[MAX_BUFFER_QUEUE];
odp_buffer_t buf;
+ odp_event_t ev;
odp_buffer_pool_t msg_pool;
odp_queue_param_t param;
- odp_buffer_t *pbuf_tmp;
+ odp_event_t *pev_tmp;
int i, deq_ret, ret;
int nr_deq_entries = 0;
int max_iteration = CONFIG_MAX_ITERATION;
@@ -68,9 +69,10 @@ static void test_odp_queue_sunnyday(void)
msg_pool = odp_buffer_pool_lookup("msg_pool");
buf = odp_buffer_alloc(msg_pool);
+ ev = odp_buffer_to_event(buf);
- odp_queue_enq(queue_id, odp_buffer_to_event(buf));
- CU_ASSERT_EQUAL(buf, odp_queue_deq(queue_id));
+ odp_queue_enq(queue_id, ev);
+ CU_ASSERT_EQUAL(ev, odp_queue_deq(queue_id));
odp_buffer_free(buf);
for (i = 0; i < MAX_BUFFER_QUEUE; i++) {
@@ -84,19 +86,19 @@ static void test_odp_queue_sunnyday(void)
*/
ret = odp_queue_enq_multi(queue_id, enev, MAX_BUFFER_QUEUE);
CU_ASSERT(0 == ret);
- pbuf_tmp = debuf;
+ pev_tmp = deev;
do {
- deq_ret = odp_queue_deq_multi(queue_id, pbuf_tmp,
+ deq_ret = odp_queue_deq_multi(queue_id, pev_tmp,
MAX_BUFFER_QUEUE);
nr_deq_entries += deq_ret;
max_iteration--;
- pbuf_tmp += deq_ret;
+ pev_tmp += deq_ret;
CU_ASSERT(max_iteration >= 0);
} while (nr_deq_entries < MAX_BUFFER_QUEUE);
for (i = 0; i < MAX_BUFFER_QUEUE; i++) {
odp_buffer_t enbuf = odp_buffer_from_event(enev[i]);
- CU_ASSERT_EQUAL(enbuf, debuf[i]);
+ CU_ASSERT_EQUAL(enev[i], deev[i]);
odp_buffer_free(enbuf);
}
Changed odp_queue_deq_multi() to use events instead of buffers. Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> --- example/ipsec/odp_ipsec_stream.c | 12 +++++------- platform/linux-generic/include/api/odp_queue.h | 14 +++++++------- platform/linux-generic/odp_queue.c | 4 ++-- platform/linux-generic/odp_schedule.c | 2 +- test/validation/odp_queue.c | 18 ++++++++++-------- 5 files changed, 25 insertions(+), 25 deletions(-)