From patchwork Wed Jan 21 04:57:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 43435 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 348D62034D for ; Wed, 21 Jan 2015 04:58:32 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id gf13sf9260634lab.0 for ; Tue, 20 Jan 2015 20:58:31 -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=1sSCR1A1SC2SbrCrJ9gebPk4tpelHFTK5lyIhZn7UnQ=; b=W37Cfr68zNmP2LqR62tIgtPTk8BmxhX++rfo4NYLh4EIgyGhSR4d6B/PPAbAL7hUWy DIwf6F+kdryTDet4Dnam0OrDlQ+VxejwuoM3senndfuMCKU/57LAQXFun/zae6vC0EkP XVB2TGyA5DbRi69kBKqa4eF1TOTmZjhZJXLNpIjMRks08lswc0kbGYZF0ZAaE1/1EUtR +JunTDibOmCF0luP6z53v4l8LPTux/AbBBRimd5c3jf5T8x36aCigZbcHJToU2ffrOo+ nUo/WwUdkuUA8wPI57PSlHPdGhJsyjKUxjROp++E9e+Ygba1v9znqgNVNj1wxNG6S+ID CU4Q== X-Gm-Message-State: ALoCoQmcw8O6UUEoOHu8adHfwp0PNlAvZByqvb6zKG33hwWiw329rOMmKqPNSDvp9dcPCDJEPnuf X-Received: by 10.112.84.226 with SMTP id c2mr4763459lbz.5.1421816311071; Tue, 20 Jan 2015 20:58:31 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.179.67 with SMTP id de3ls415843lac.60.gmail; Tue, 20 Jan 2015 20:58:30 -0800 (PST) X-Received: by 10.152.115.212 with SMTP id jq20mr21918793lab.36.1421816310728; Tue, 20 Jan 2015 20:58:30 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id ln11si18306376lac.114.2015.01.20.20.58.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 Jan 2015 20:58:30 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id pn19so38127287lab.9 for ; Tue, 20 Jan 2015 20:58:30 -0800 (PST) X-Received: by 10.112.52.229 with SMTP id w5mr42104421lbo.52.1421816310567; Tue, 20 Jan 2015 20:58:30 -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 c8csp1651581lbb; Tue, 20 Jan 2015 20:58:29 -0800 (PST) X-Received: by 10.140.105.55 with SMTP id b52mr16986661qgf.1.1421816309270; Tue, 20 Jan 2015 20:58:29 -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 z2si3153493qad.91.2015.01.20.20.58.28 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 20 Jan 2015 20:58:29 -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 1YDnN4-0002Nu-6s; Wed, 21 Jan 2015 04:58:26 +0000 Received: from mail-oi0-f49.google.com ([209.85.218.49]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YDnMl-0002Ej-TQ for lng-odp@lists.linaro.org; Wed, 21 Jan 2015 04:58:07 +0000 Received: by mail-oi0-f49.google.com with SMTP id a3so11558086oib.8 for ; Tue, 20 Jan 2015 20:58:02 -0800 (PST) X-Received: by 10.202.108.83 with SMTP id h80mr22469789oic.90.1421816282651; Tue, 20 Jan 2015 20:58:02 -0800 (PST) Received: from localhost.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by mx.google.com with ESMTPSA id a15sm2891071oic.18.2015.01.20.20.58.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jan 2015 20:58:02 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 20 Jan 2015 22:57:43 -0600 Message-Id: <1421816266-31223-6-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1421816266-31223-1-git-send-email-bill.fischofer@linaro.org> References: <1421816266-31223-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 5/8] api: queue: switch queues from buffers to events 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: bill.fischofer@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.215.50 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 Signed-off-by: Bill Fischofer --- platform/linux-generic/include/api/odp_queue.h | 32 +++++++++++++------------- platform/linux-generic/odp_queue.c | 18 +++++++-------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/platform/linux-generic/include/api/odp_queue.h b/platform/linux-generic/include/api/odp_queue.h index b0f7185..fceed4d 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. @@ -174,48 +174,48 @@ 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 + * Enqueue multiple events to a queue * * @param queue Queue handle - * @param buf Buffer handles - * @param num Number of buffer handles + * @param ev Event handles + * @param num Number of event handles * * @return 0 if succesful */ -int odp_queue_enq_multi(odp_queue_t queue, odp_buffer_t buf[], int num); +int odp_queue_enq_multi(odp_queue_t queue, odp_event_t ev[], int num); /** * Queue dequeue * - * Dequeues next buffer from head of the queue. Cannot be used for + * Dequeues next event from head of the queue. Cannot be used for * ODP_QUEUE_TYPE_SCHED type queues (use odp_schedule() instead). * * @param queue Queue handle * - * @return Buffer handle, or ODP_BUFFER_INVALID + * @return Event handle, or ODP_EVENT_INVALID */ -odp_buffer_t odp_queue_deq(odp_queue_t queue); +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 70c006d..17ff7c1 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -385,7 +385,7 @@ int queue_enq_multi_dummy(queue_entry_t *queue ODP_UNUSED, return -1; } -int odp_queue_enq_multi(odp_queue_t handle, odp_buffer_t buf[], int num) +int odp_queue_enq_multi(odp_queue_t handle, odp_event_t ev[], int num) { odp_buffer_hdr_t *buf_hdr[QUEUE_MULTI_MAX]; queue_entry_t *queue; @@ -397,19 +397,19 @@ int odp_queue_enq_multi(odp_queue_t handle, odp_buffer_t buf[], int num) queue = queue_to_qentry(handle); for (i = 0; i < num; i++) - buf_hdr[i] = odp_buf_to_hdr(buf[i]); + buf_hdr[i] = odp_buf_to_hdr(odp_buffer_from_event(ev[i])); return queue->s.enqueue_multi(queue, buf_hdr, 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); } @@ -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,13 +508,13 @@ 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; } -odp_buffer_t odp_queue_deq(odp_queue_t handle) +odp_event_t odp_queue_deq(odp_queue_t handle) { queue_entry_t *queue; odp_buffer_hdr_t *buf_hdr; @@ -523,9 +523,9 @@ odp_buffer_t odp_queue_deq(odp_queue_t handle) buf_hdr = queue->s.dequeue(queue); if (buf_hdr) - return buf_hdr->handle.handle; + return odp_buffer_to_event(buf_hdr->handle.handle); - return ODP_BUFFER_INVALID; + return ODP_EVENT_INVALID; }