From patchwork Sun Aug 9 13:13:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 52095 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id DEE2C2152A for ; Sun, 9 Aug 2015 13:23:56 +0000 (UTC) Received: by wilj18 with SMTP id j18sf30214195wil.0 for ; Sun, 09 Aug 2015 06:23:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to: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=1WIK/G/pzb0EHfyLDKyAIYm6tTC46R7x5LGRmJT0Rxc=; b=HbSKIl8/A6dScMt8T7nvndgyz8mquxkFxEqK/noomCwBTWeU/wNhByNRJedcqd7AgI +eMEeoSWC+2QOuRjnLDUjI3Jiu4Za2EBmJqMVAo3DC5IPuOaI31+8DWuRjEg7tE7WryZ oBLRPqeeXVN6Jt+xow4A2jenmhEanEPmScsVJ58av/dB3lB1Amjl9f7BCjJkTt4tU9Z5 HDWFSyK6hx1SvgwqxJjyTnaD/hoEsh53Cax5VCzHPjh8BIlT5OG7Vv5ogqedw1DH3U/+ 4FiawvGthTygmv7IX1Zj3+xeYoFl7akiVp4w3ps5hpj1MB2PQ2kywMsljb+8z/VJZrRC Dgng== X-Gm-Message-State: ALoCoQnlMxbhLlMOP1kDxAaIBkWsUAzMBfUVUFPYrDRDYNCmUSxhI9MkcvaoIf65scpjPtaXeZVW X-Received: by 10.152.28.100 with SMTP id a4mr4893276lah.4.1439126635759; Sun, 09 Aug 2015 06:23:55 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.101 with SMTP id s5ls661964lag.108.gmail; Sun, 09 Aug 2015 06:23:55 -0700 (PDT) X-Received: by 10.152.28.229 with SMTP id e5mr16295917lah.110.1439126635543; Sun, 09 Aug 2015 06:23:55 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id i1si12054257lbs.87.2015.08.09.06.23.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Aug 2015 06:23:55 -0700 (PDT) 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 lbbpu9 with SMTP id pu9so55054255lbb.3 for ; Sun, 09 Aug 2015 06:23:55 -0700 (PDT) X-Received: by 10.152.88.78 with SMTP id be14mr16292812lab.29.1439126635105; Sun, 09 Aug 2015 06:23:55 -0700 (PDT) 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.7.198 with SMTP id l6csp1426913lba; Sun, 9 Aug 2015 06:23:54 -0700 (PDT) X-Received: by 10.140.133.145 with SMTP id 139mr31599393qhf.76.1439126633592; Sun, 09 Aug 2015 06:23:53 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 7si28681054qhg.112.2015.08.09.06.23.52; Sun, 09 Aug 2015 06:23:53 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 8E57861F5A; Sun, 9 Aug 2015 13:23:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 0C8A461F5D; Sun, 9 Aug 2015 13:15:39 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 061BE621BB; Sun, 9 Aug 2015 13:15:34 +0000 (UTC) Received: from mail-ob0-f169.google.com (mail-ob0-f169.google.com [209.85.214.169]) by lists.linaro.org (Postfix) with ESMTPS id 0EB7861F64 for ; Sun, 9 Aug 2015 13:14:11 +0000 (UTC) Received: by obbfr1 with SMTP id fr1so70563479obb.1 for ; Sun, 09 Aug 2015 06:14:10 -0700 (PDT) X-Received: by 10.60.76.69 with SMTP id i5mr15120354oew.42.1439126050543; Sun, 09 Aug 2015 06:14:10 -0700 (PDT) Received: from localhost.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by smtp.gmail.com with ESMTPSA id i3sm5012321oig.24.2015.08.09.06.14.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 09 Aug 2015 06:14:10 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Sun, 9 Aug 2015 08:13:54 -0500 Message-Id: <1439126035-13656-13-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1439126035-13656-1-git-send-email-bill.fischofer@linaro.org> References: <1439126035-13656-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv12 12/13] linux-generic: schedule: implement order insertion routines X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 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" 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.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 Implement the odp_schedule_order_copy(), odp_schedule_sustain(), and odp_schedule_sustain_set(), which together permit events to be inserted into an ordered flow. Signed-off-by: Bill Fischofer --- platform/linux-generic/odp_queue.c | 27 +++++++++++++++++++++++++++ platform/linux-generic/odp_schedule.c | 24 ++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c index 75cc95b..87ea364 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -980,3 +980,30 @@ int odp_schedule_release_ordered(odp_event_t ev) UNLOCK(&origin_qe->s.lock); return 0; } + +int odp_schedule_order_copy(odp_event_t src_event, odp_event_t dst_event) +{ + odp_buffer_hdr_t *src = + odp_buf_to_hdr(odp_buffer_from_event(src_event)); + odp_buffer_hdr_t *dst = + odp_buf_to_hdr(odp_buffer_from_event(dst_event)); + queue_entry_t *origin_qe = src->origin_qe; + + if (!origin_qe || dst->origin_qe) + return -1; + + LOCK(&origin_qe->s.lock); + + if (src->origin_qe != origin_qe) { + UNLOCK(&origin_qe->s.lock); + return -1; + } + + dst->origin_qe = origin_qe; + dst->order = src->order; + dst->sync = src->sync; + src->flags.sustain = 1; + + UNLOCK(&origin_qe->s.lock); + return 0; +} diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index 4d594a0..548ed25 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -746,3 +746,27 @@ int odp_schedule_group_count(odp_schedule_group_t group) void odp_schedule_prefetch(int num ODP_UNUSED) { } + +int odp_schedule_order_sustain(odp_event_t ev) +{ + odp_buffer_hdr_t *buf_hdr = + odp_buf_to_hdr(odp_buffer_from_event(ev)); + + if (buf_hdr->origin_qe) + return buf_hdr->flags.sustain; + + return -1; +} + +int odp_schedule_order_sustain_set(odp_event_t ev, odp_bool_t sustain) +{ + odp_buffer_hdr_t *buf_hdr = + odp_buf_to_hdr(odp_buffer_from_event(ev)); + + if (buf_hdr->origin_qe && (sustain & 1) == sustain) { + buf_hdr->flags.sustain = sustain; + return 0; + } + + return -1; +}