From patchwork Thu Jan 15 15:40:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 43206 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f199.google.com (mail-we0-f199.google.com [74.125.82.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0F463240BA for ; Thu, 15 Jan 2015 15:41:30 +0000 (UTC) Received: by mail-we0-f199.google.com with SMTP id k11sf8296699wes.2 for ; Thu, 15 Jan 2015 07:41:29 -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=3k0L/nQyyxf/6UdCYGKhsBBs3EoYXPS496W4ktuRNOk=; b=K3PJ7lVGGeYhkSkUVDUQgUF2RF8Z1DcaVYBTY9w1CJ1koHNdOOYS9H6lBLkmrTdh0C MdO7zfhMqkSbL+CRixL9hv/A5PeKmSlLqbdsjgOxDVfKi6dJXI7YRsioNc/WEdng1C0f o4N2O5W44Ndf7yOSV337vmVqJRvESmZQDdUyVyl3eLW8C+ekSUgVnmXKKAKJxQn/05k8 jnCYNk7IjwbgO5z5ZFTw9+c0I0HyiwcuraYQeht/uhME5hOsEIbWKL9gk8pCHc9JjidN IK3QKGgXi1T6voeT60kJEGDP7k6n5JOcgr9w+TkefEVvZehq+yoj8pDcCCcfk7XP4Fzb zhFw== X-Gm-Message-State: ALoCoQmmTFrzQZkAxsPquzJSLObM6N0D2bY/+6iskH1acGIVY69vbjw4oE5ZciHEE2ZnIM4iDEso X-Received: by 10.180.37.166 with SMTP id z6mr467583wij.0.1421336489204; Thu, 15 Jan 2015 07:41:29 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.97 with SMTP id r1ls254563lar.81.gmail; Thu, 15 Jan 2015 07:41:29 -0800 (PST) X-Received: by 10.112.130.65 with SMTP id oc1mr3466253lbb.7.1421336489039; Thu, 15 Jan 2015 07:41:29 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id kv10si1718139lac.131.2015.01.15.07.41.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 07:41:29 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id u10so13806645lbd.13 for ; Thu, 15 Jan 2015 07:41:29 -0800 (PST) X-Received: by 10.112.52.229 with SMTP id w5mr10572287lbo.52.1421336488950; Thu, 15 Jan 2015 07:41:28 -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 c8csp21904lbb; Thu, 15 Jan 2015 07:41:28 -0800 (PST) X-Received: by 10.229.225.195 with SMTP id it3mr17224777qcb.24.1421336487670; Thu, 15 Jan 2015 07:41:27 -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 i6si2344920qan.53.2015.01.15.07.41.24 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 15 Jan 2015 07:41:27 -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 1YBmXz-0007PV-Il; Thu, 15 Jan 2015 15:41:23 +0000 Received: from mail-qa0-f50.google.com ([209.85.216.50]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YBmXp-0007Jg-1B for lng-odp@lists.linaro.org; Thu, 15 Jan 2015 15:41:13 +0000 Received: by mail-qa0-f50.google.com with SMTP id k15so11605060qaq.9 for ; Thu, 15 Jan 2015 07:41:07 -0800 (PST) X-Received: by 10.224.36.199 with SMTP id u7mr7366264qad.101.1421336467892; Thu, 15 Jan 2015 07:41:07 -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.41.05 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 07:41:06 -0800 (PST) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Thu, 15 Jan 2015 17:40:13 +0200 Message-Id: <1421336423-19382-6-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 05/15] api: event: odp_queue_deq_multi 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.182 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_queue_deq_multi() to use events instead of buffers. Signed-off-by: Petri Savolainen --- 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 +- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/example/ipsec/odp_ipsec_stream.c b/example/ipsec/odp_ipsec_stream.c index dc78d77..7e3ad4a 100644 --- a/example/ipsec/odp_ipsec_stream.c +++ b/example/ipsec/odp_ipsec_stream.c @@ -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) diff --git a/platform/linux-generic/include/api/odp_queue.h b/platform/linux-generic/include/api/odp_queue.h index 51ea16b..65911d1 100644 --- a/platform/linux-generic/include/api/odp_queue.h +++ b/platform/linux-generic/include/api/odp_queue.h @@ -20,7 +20,7 @@ extern "C" { #include -#include +#include /** @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 diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c index b77f3d6..17ff7c1 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -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; } diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index e5e7ae3..423aa1e 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -289,7 +289,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) {