From patchwork Thu Jan 15 15:40:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 43203 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A0214240BA for ; Thu, 15 Jan 2015 15:41:17 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id w7sf8375414lbi.0 for ; Thu, 15 Jan 2015 07:41:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=0PzQfJI6zCEXXtasRGUgZgg49qwlbdi1+XZmAP5LfLY=; b=Jz4upmzoWBQvFQN6a1TiRlP0uSwGOvNapvfE7Zo6Ah5ingoyQZYGom5p5+1bnD10ds 5kjtPQh5jvof1XmOl4WHaSD/RONMdq+nWV/CZU4HSirxEau5WkmTyJ9e0IDqp6i8/ySd /PBtkHlQUSufKzLhEh/KUt4YW8/FJLPg+TFFXRzU5w1YiqoAJg3OWukyqHuD/3yZvcuG zU5UCo5c1ONkUJenybZcKX8cMNwB0NYrzM9euY4UJ/v5eI8Cjr/XUfZWMJpLp+DIZ8Qg Xald8K1HxOfJPK6OHRz2p95UWQ/jyGX/BK40yTGPj/ixQFX9ZREB5Ke1SVWnwRWjaKd0 k1cg== X-Gm-Message-State: ALoCoQnqTq6ZuQF4n6g2mIuycn0lHIa4zUewISp8I/oNVAslFB/Hak5dGf/JkUKkPg6GSpNLwBwc X-Received: by 10.180.19.42 with SMTP id b10mr4438189wie.0.1421336476626; Thu, 15 Jan 2015 07:41:16 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.37 with SMTP id ll5ls284585lac.53.gmail; Thu, 15 Jan 2015 07:41:16 -0800 (PST) X-Received: by 10.112.166.73 with SMTP id ze9mr10409816lbb.38.1421336476457; Thu, 15 Jan 2015 07:41:16 -0800 (PST) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id w2si1735980laz.109.2015.01.15.07.41.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 07:41:16 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id p9so13929269lbv.0 for ; Thu, 15 Jan 2015 07:41:16 -0800 (PST) X-Received: by 10.112.90.170 with SMTP id bx10mr10477072lbb.69.1421336476327; Thu, 15 Jan 2015 07:41:16 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp21847lbb; Thu, 15 Jan 2015 07:41:15 -0800 (PST) X-Received: by 10.224.43.72 with SMTP id v8mr10107927qae.30.1421336474533; Thu, 15 Jan 2015 07:41:14 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id a18si2313446qai.69.2015.01.15.07.41.12 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 15 Jan 2015 07:41:14 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YBmXm-0007Ll-UB; Thu, 15 Jan 2015 15:41:10 +0000 Received: from mail-qg0-f51.google.com ([209.85.192.51]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YBmXe-0007J5-WB for lng-odp@lists.linaro.org; Thu, 15 Jan 2015 15:41:03 +0000 Received: by mail-qg0-f51.google.com with SMTP id i50so12158111qgf.10 for ; Thu, 15 Jan 2015 07:40:57 -0800 (PST) X-Received: by 10.224.121.142 with SMTP id h14mr17157210qar.80.1421336457826; Thu, 15 Jan 2015 07:40:57 -0800 (PST) Received: from mcpro03.emea.nsn-net.net (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id g12sm1563340qay.44.2015.01.15.07.40.54 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 07:40:56 -0800 (PST) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Thu, 15 Jan 2015 17:40:10 +0200 Message-Id: <1421336423-19382-3-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1421336423-19382-1-git-send-email-petri.savolainen@linaro.org> References: <1421336423-19382-1-git-send-email-petri.savolainen@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 02/15] api: event: odp_schedule and odp_queue_enq X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: petri.savolainen@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Changed odp_schedule() and odp_queue_enq() to use events instead of buffers. Signed-off-by: Petri Savolainen --- example/generator/odp_generator.c | 8 ++--- example/ipsec/odp_ipsec.c | 10 +++---- example/ipsec/odp_ipsec_stream.c | 2 +- example/l2fwd/odp_l2fwd.c | 8 ++--- example/packet/odp_pktio.c | 8 ++--- example/timer/odp_timer_test.c | 16 +++++----- platform/linux-generic/include/api/odp_queue.h | 4 +-- platform/linux-generic/include/api/odp_schedule.h | 16 +++++----- platform/linux-generic/odp_crypto.c | 2 +- platform/linux-generic/odp_queue.c | 4 +-- platform/linux-generic/odp_schedule.c | 12 ++++---- platform/linux-generic/odp_timer.c | 2 +- test/performance/odp_scheduling.c | 36 ++++++++++++----------- 13 files changed, 65 insertions(+), 63 deletions(-) diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index c3f1783..1ed0c48 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -372,7 +372,7 @@ static void *gen_send_thread(void *arg) return NULL; } - err = odp_queue_enq(outq_def, odp_packet_to_buffer(pkt)); + err = odp_queue_enq(outq_def, odp_packet_to_event(pkt)); if (err != 0) { EXAMPLE_ERR(" [%02i] send pkt err!\n", thr); return NULL; @@ -502,7 +502,7 @@ static void *gen_recv_thread(void *arg) odp_pktio_t pktio; thread_args_t *thr_args; odp_packet_t pkt; - odp_buffer_t buf; + odp_event_t ev; thr = odp_thread_id(); thr_args = arg; @@ -518,9 +518,9 @@ static void *gen_recv_thread(void *arg) for (;;) { /* Use schedule to get buf from any input queue */ - buf = odp_schedule(NULL, ODP_SCHED_WAIT); + ev = odp_schedule(NULL, ODP_SCHED_WAIT); - pkt = odp_packet_from_buffer(buf); + pkt = odp_packet_from_event(ev); /* Drop packets with errors */ if (odp_unlikely(odp_packet_error(pkt))) { odp_packet_free(pkt); diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 7a0fbef..6e2c8b6 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1037,7 +1037,7 @@ void *pktio_thread(void *arg EXAMPLE_UNUSED) { int thr; odp_packet_t pkt; - odp_buffer_t buf; + odp_event_t ev; unsigned long pkt_cnt = 0; thr = odp_thread_id(); @@ -1053,8 +1053,8 @@ void *pktio_thread(void *arg EXAMPLE_UNUSED) odp_queue_t dispatchq; /* Use schedule to get buf from any input queue */ - buf = SCHEDULE(&dispatchq, ODP_SCHED_WAIT); - pkt = odp_packet_from_buffer(buf); + ev = SCHEDULE(&dispatchq, ODP_SCHED_WAIT); + pkt = odp_packet_from_event(ev); /* Determine new work versus completion or sequence number */ if ((completionq != dispatchq) && (seqnumq != dispatchq)) { @@ -1113,7 +1113,7 @@ void *pktio_thread(void *arg EXAMPLE_UNUSED) ctx->state = PKT_STATE_TRANSMIT; } else { ctx->state = PKT_STATE_IPSEC_OUT_SEQ; - odp_queue_enq(seqnumq, buf); + odp_queue_enq(seqnumq, ev); } break; @@ -1131,7 +1131,7 @@ void *pktio_thread(void *arg EXAMPLE_UNUSED) case PKT_STATE_TRANSMIT: - odp_queue_enq(ctx->outq, buf); + odp_queue_enq(ctx->outq, ev); rc = PKT_DONE; break; diff --git a/example/ipsec/odp_ipsec_stream.c b/example/ipsec/odp_ipsec_stream.c index 1e932df..8900483 100644 --- a/example/ipsec/odp_ipsec_stream.c +++ b/example/ipsec/odp_ipsec_stream.c @@ -497,7 +497,7 @@ int create_stream_db_inputs(void) break; } stream->created++; - odp_queue_enq(queue, pkt); + odp_queue_enq(queue, odp_packet_to_event(pkt)); /* Count this stream when we create first packet */ if (1 == stream->created) diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c index 209b0bd..195d329 100644 --- a/example/l2fwd/odp_l2fwd.c +++ b/example/l2fwd/odp_l2fwd.c @@ -111,7 +111,7 @@ static void *pktio_queue_thread(void *arg) int thr; odp_queue_t outq_def; odp_packet_t pkt; - odp_buffer_t buf; + odp_event_t ev; unsigned long pkt_cnt = 0; unsigned long err_cnt = 0; @@ -124,8 +124,8 @@ static void *pktio_queue_thread(void *arg) /* Loop packets */ for (;;) { /* Use schedule to get buf from any input queue */ - buf = odp_schedule(NULL, ODP_SCHED_WAIT); - pkt = odp_packet_from_buffer(buf); + ev = odp_schedule(NULL, ODP_SCHED_WAIT); + pkt = odp_packet_from_event(ev); /* Drop packets with errors */ if (odp_unlikely(drop_err_pkts(&pkt, 1) == 0)) { @@ -136,7 +136,7 @@ static void *pktio_queue_thread(void *arg) outq_def = lookup_dest_q(pkt); /* Enqueue the packet for output */ - odp_queue_enq(outq_def, buf); + odp_queue_enq(outq_def, ev); /* Print packet counts every once in a while */ if (odp_unlikely(pkt_cnt++ % 100000 == 0)) { diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c index 0d5918a..2251aad 100644 --- a/example/packet/odp_pktio.c +++ b/example/packet/odp_pktio.c @@ -146,7 +146,7 @@ static void *pktio_queue_thread(void *arg) thread_args_t *thr_args; odp_queue_t outq_def; odp_packet_t pkt; - odp_buffer_t buf; + odp_event_t ev; unsigned long pkt_cnt = 0; unsigned long err_cnt = 0; @@ -170,7 +170,7 @@ static void *pktio_queue_thread(void *arg) #if 1 /* Use schedule to get buf from any input queue */ - buf = odp_schedule(NULL, ODP_SCHED_WAIT); + ev = odp_schedule(NULL, ODP_SCHED_WAIT); #else /* Always dequeue from the same input queue */ buf = odp_queue_deq(inq_def); @@ -178,7 +178,7 @@ static void *pktio_queue_thread(void *arg) continue; #endif - pkt = odp_packet_from_buffer(buf); + pkt = odp_packet_from_event(ev); /* Drop packets with errors */ if (odp_unlikely(drop_err_pkts(&pkt, 1) == 0)) { @@ -199,7 +199,7 @@ static void *pktio_queue_thread(void *arg) swap_pkt_addrs(&pkt, 1); /* Enqueue the packet for output */ - odp_queue_enq(outq_def, buf); + odp_queue_enq(outq_def, ev); /* Print packet counts every once in a while */ if (odp_unlikely(pkt_cnt++ % 100000 == 0)) { diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 5de499b..c4f0c5b 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -114,7 +114,7 @@ static void test_abs_timeouts(int thr, test_args_t *args) tick = odp_timer_current_tick(tp); while ((int)odp_atomic_load_u32(&remain) > 0) { - odp_buffer_t buf; + odp_event_t ev; odp_timer_set_t rc; tick += period; @@ -128,20 +128,20 @@ static void test_abs_timeouts(int thr, test_args_t *args) /* Get the next expired timeout */ /* Use 1.5 second timeout for scheduler */ uint64_t sched_tmo = odp_schedule_wait_time(1500000000ULL); - buf = odp_schedule(&queue, sched_tmo); + ev = odp_schedule(&queue, sched_tmo); /* Check if odp_schedule() timed out, possibly there are no * remaining timeouts to receive */ - if (buf == ODP_BUFFER_INVALID) + if (ev == ODP_EVENT_INVALID) continue; /* Re-check the remain counter */ - if (odp_buffer_type(buf) != ODP_BUFFER_TYPE_TIMEOUT) { + if (odp_event_type(ev) != ODP_EVENT_TIMEOUT) { /* Not a default timeout buffer */ - EXAMPLE_ABORT("Unexpected buffer type (%u) received\n", - odp_buffer_type(buf)); + EXAMPLE_ABORT("Unexpected event type (%u) received\n", + odp_event_type(ev)); } - odp_timeout_t tmo = odp_timeout_from_buf(buf); + odp_timeout_t tmo = odp_timeout_from_event(ev); tick = odp_timeout_tick(tmo); ttp = odp_timeout_user_ptr(tmo); - ttp->buf = buf; + ttp->buf = odp_buffer_from_event(ev); if (!odp_timeout_fresh(tmo)) { /* Not the expected expiration tick, timer has * been reset or cancelled or freed */ diff --git a/platform/linux-generic/include/api/odp_queue.h b/platform/linux-generic/include/api/odp_queue.h index af4379f..589d07a 100644 --- a/platform/linux-generic/include/api/odp_queue.h +++ b/platform/linux-generic/include/api/odp_queue.h @@ -174,11 +174,11 @@ void *odp_queue_get_context(odp_queue_t queue); * Queue enqueue * * @param queue Queue handle - * @param buf Buffer handle + * @param ev Event handle * * @return 0 if succesful */ -int odp_queue_enq(odp_queue_t queue, odp_buffer_t buf); +int odp_queue_enq(odp_queue_t queue, odp_event_t ev); /** * Enqueue multiple buffers to a queue diff --git a/platform/linux-generic/include/api/odp_schedule.h b/platform/linux-generic/include/api/odp_schedule.h index cdf6705..45fa48c 100644 --- a/platform/linux-generic/include/api/odp_schedule.h +++ b/platform/linux-generic/include/api/odp_schedule.h @@ -47,21 +47,21 @@ uint64_t odp_schedule_wait_time(uint64_t ns); * Schedule * * Schedules all queues created with ODP_QUEUE_TYPE_SCHED type. Returns - * next highest priority buffer which is available for the calling thread. - * Outputs the source queue of the buffer. If there's no buffer available, waits - * for a buffer according to the wait parameter setting. Returns - * ODP_BUFFER_INVALID if reaches end of the wait period. + * next highest priority event which is available for the calling thread. + * Outputs the source queue of the event. If there's no event available, waits + * for an event according to the wait parameter setting. Returns + * ODP_EVENT_INVALID if reaches end of the wait period. * - * @param from Output parameter for the source queue (where the buffer was + * @param from Output parameter for the source queue (where the event was * dequeued from). Ignored if NULL. - * @param wait Minimum time to wait for a buffer. Waits infinitely, if set to + * @param wait Minimum time to wait for an event. Waits infinitely, if set to * ODP_SCHED_WAIT. Does not wait, if set to ODP_SCHED_NO_WAIT. * Use odp_schedule_wait_time() to convert time to other wait * values. * - * @return Next highest priority buffer, or ODP_BUFFER_INVALID + * @return Next highest priority event, or ODP_EVENT_INVALID */ -odp_buffer_t odp_schedule(odp_queue_t *from, uint64_t wait); +odp_event_t odp_schedule(odp_queue_t *from, uint64_t wait); /** * Schedule multiple buffers diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 2f95cbe..b468262 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -391,7 +391,7 @@ odp_crypto_operation(odp_crypto_op_params_t *params, /* If specified during creation post event to completion queue */ if (ODP_QUEUE_INVALID != session->compl_queue) { - odp_queue_enq(session->compl_queue, completion_event); + odp_queue_enq(session->compl_queue, odp_buffer_to_event(completion_event)); *posted = 1; } return 0; diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c index 70c006d..c027f23 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -403,13 +403,13 @@ int odp_queue_enq_multi(odp_queue_t handle, odp_buffer_t buf[], int num) } -int odp_queue_enq(odp_queue_t handle, odp_buffer_t buf) +int odp_queue_enq(odp_queue_t handle, odp_event_t ev) { odp_buffer_hdr_t *buf_hdr; queue_entry_t *queue; queue = queue_to_qentry(handle); - buf_hdr = odp_buf_to_hdr(buf); + buf_hdr = odp_buf_to_hdr(odp_buffer_from_event(ev)); return queue->s.enqueue(queue, buf_hdr); } diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index f7c3588..7b25e8a 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -198,7 +198,7 @@ void odp_schedule_queue(odp_queue_t queue, int prio) pri_queue = select_pri_queue(queue, prio); desc_buf = queue_sched_buf(queue); - odp_queue_enq(pri_queue, desc_buf); + odp_queue_enq(pri_queue, odp_buffer_to_event(desc_buf)); } @@ -207,7 +207,7 @@ void odp_schedule_release_atomic(void) if (sched_local.pri_queue != ODP_QUEUE_INVALID && sched_local.num == 0) { /* Release current atomic queue */ - odp_queue_enq(sched_local.pri_queue, sched_local.desc_buf); + odp_queue_enq(sched_local.pri_queue, odp_buffer_to_event(sched_local.desc_buf)); sched_local.pri_queue = ODP_QUEUE_INVALID; } } @@ -297,7 +297,7 @@ static int schedule(odp_queue_t *out_queue, odp_buffer_t out_buf[], if (odp_queue_type(queue) == ODP_QUEUE_TYPE_PKTIN && !queue_is_destroyed(queue)) - odp_queue_enq(pri_q, desc_buf); + odp_queue_enq(pri_q, odp_buffer_to_event(desc_buf)); continue; } @@ -314,7 +314,7 @@ static int schedule(odp_queue_t *out_queue, odp_buffer_t out_buf[], sched_local.desc_buf = desc_buf; } else { /* Continue scheduling the queue */ - odp_queue_enq(pri_q, desc_buf); + odp_queue_enq(pri_q, odp_buffer_to_event(desc_buf)); } /* Output the source queue handle */ @@ -367,7 +367,7 @@ static int schedule_loop(odp_queue_t *out_queue, uint64_t wait, } -odp_buffer_t odp_schedule(odp_queue_t *out_queue, uint64_t wait) +odp_event_t odp_schedule(odp_queue_t *out_queue, uint64_t wait) { odp_buffer_t buf; @@ -375,7 +375,7 @@ odp_buffer_t odp_schedule(odp_queue_t *out_queue, uint64_t wait) schedule_loop(out_queue, wait, &buf, 1, MAX_DEQ); - return buf; + return odp_buffer_to_event(buf); } diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index 4c9b710..3bb7770 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -567,7 +567,7 @@ static unsigned timer_expire(odp_timer_pool *tp, uint32_t idx, uint64_t tick) } /* Else ignore buffers of other types */ /* Post the timeout to the destination queue */ - int rc = odp_queue_enq(tim->queue, tmo_buf); + int rc = odp_queue_enq(tim->queue, odp_buffer_to_event(tmo_buf)); if (odp_unlikely(rc != 0)) ODP_ABORT("Failed to enqueue timeout buffer (%d)\n", rc); diff --git a/test/performance/odp_scheduling.c b/test/performance/odp_scheduling.c index 72656c4..1196ef9 100644 --- a/test/performance/odp_scheduling.c +++ b/test/performance/odp_scheduling.c @@ -65,14 +65,16 @@ typedef struct { */ static void clear_sched_queues(void) { + odp_event_t ev; odp_buffer_t buf; while (1) { - buf = odp_schedule(NULL, ODP_SCHED_NO_WAIT); + ev = odp_schedule(NULL, ODP_SCHED_NO_WAIT); - if (buf == ODP_BUFFER_INVALID) + if (ev == ODP_EVENT_INVALID) break; + buf = odp_buffer_from_event(ev); odp_buffer_free(buf); } } @@ -109,7 +111,7 @@ static int create_queue(int thr, odp_buffer_pool_t msg_pool, int prio) return -1; } - if (odp_queue_enq(queue, buf)) { + if (odp_queue_enq(queue, odp_buffer_to_event(buf))) { LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } @@ -156,7 +158,7 @@ static int create_queues(int thr, odp_buffer_pool_t msg_pool, int prio) return -1; } - if (odp_queue_enq(queue, buf)) { + if (odp_queue_enq(queue, odp_buffer_to_event(buf))) { LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } @@ -286,7 +288,7 @@ static int test_poll_queue(int thr, odp_buffer_pool_t msg_pool) t1 = odp_time_cycles(); for (i = 0; i < QUEUE_ROUNDS; i++) { - if (odp_queue_enq(queue, buf)) { + if (odp_queue_enq(queue, odp_buffer_to_event(buf))) { LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } @@ -328,7 +330,7 @@ static int test_schedule_single(const char *str, int thr, odp_buffer_pool_t msg_pool, int prio, odp_barrier_t *barrier) { - odp_buffer_t buf; + odp_event_t ev; odp_queue_t queue; uint64_t t1, t2, cycles, ns; uint32_t i; @@ -340,9 +342,9 @@ static int test_schedule_single(const char *str, int thr, t1 = odp_time_cycles(); for (i = 0; i < QUEUE_ROUNDS; i++) { - buf = odp_schedule(&queue, ODP_SCHED_WAIT); + ev = odp_schedule(&queue, ODP_SCHED_WAIT); - if (odp_queue_enq(queue, buf)) { + if (odp_queue_enq(queue, ev)) { LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } @@ -354,14 +356,14 @@ static int test_schedule_single(const char *str, int thr, tot = i; while (1) { - buf = odp_schedule(&queue, ODP_SCHED_NO_WAIT); + ev = odp_schedule(&queue, ODP_SCHED_NO_WAIT); - if (buf == ODP_BUFFER_INVALID) + if (ev == ODP_EVENT_INVALID) break; tot++; - if (odp_queue_enq(queue, buf)) { + if (odp_queue_enq(queue, ev)) { LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } @@ -404,7 +406,7 @@ static int test_schedule_many(const char *str, int thr, odp_buffer_pool_t msg_pool, int prio, odp_barrier_t *barrier) { - odp_buffer_t buf; + odp_event_t ev; odp_queue_t queue; uint64_t t1 = 0; uint64_t t2 = 0; @@ -419,9 +421,9 @@ static int test_schedule_many(const char *str, int thr, t1 = odp_time_cycles(); for (i = 0; i < QUEUE_ROUNDS; i++) { - buf = odp_schedule(&queue, ODP_SCHED_WAIT); + ev = odp_schedule(&queue, ODP_SCHED_WAIT); - if (odp_queue_enq(queue, buf)) { + if (odp_queue_enq(queue, ev)) { LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; } @@ -433,14 +435,14 @@ static int test_schedule_many(const char *str, int thr, tot = i; while (1) { - buf = odp_schedule(&queue, ODP_SCHED_NO_WAIT); + ev = odp_schedule(&queue, ODP_SCHED_NO_WAIT); - if (buf == ODP_BUFFER_INVALID) + if (ev == ODP_EVENT_INVALID) break; tot++; - if (odp_queue_enq(queue, buf)) { + if (odp_queue_enq(queue, ev)) { LOG_ERR(" [%i] Queue enqueue failed.\n", thr); return -1; }