From patchwork Thu Aug 17 10:00:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 110306 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp1967866qge; Thu, 17 Aug 2017 03:00:51 -0700 (PDT) X-Received: by 10.55.64.74 with SMTP id n71mr5693636qka.351.1502964051774; Thu, 17 Aug 2017 03:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502964051; cv=none; d=google.com; s=arc-20160816; b=wA2PgqVEnDu0hxktA0AbrILjdnhh8lmvXhaaiWStU/hHb9tmSdIW0p0eQtrTSWT+w8 49Cn4hkF/9mdUE5LrK7Lw3iBAQpIOE9Ec7yQO4LgBVbiZjiTWLj3Ila0A4+8Aj/YOJq9 PIlIVKNZnl7ubcFCWyaKEdJ+OlAL0hXAxnCC2GQ3AMegzx3mGp+vYwqahiz6b2jdHEn5 /p+R+7h9eiA6J6Ftt/+3GRqSit9IR78R+pAzfdvXIFLxJYjwjTHU7X5tadFyDKjMHRoa blBehCpZSqbtX6oovM5rcLIH3qstTXtMTwL12a+jG44sIGcdBgt7EibB5e3V8CRKscyo hk4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=9iLgU5yO+iEwhaNjzUEp2q6AyuDwVWRBFH5stlUmbEo=; b=h8dvHYo/G+Co358msvlqA/MsHUGMyVPgQgBsOKyM1BG/rDo8YYUtVgfWreUO1nYxdk 91BhDPLm1P8UB1fFoDC/W5kLskrwoxAD5vOOmhvvKhA5MsNZAVkJYUQmzZPGjkx4QnWT Me90y+G1QKZoSr3yYhwX/m8Rl5yBmSel7Jp4Na8FjPPUhE852Ijeh4CkE8CkVD/VdNUj x+Zmqt6GF0daHZ7vuHtgI4sRiXxyIcGlbNeIlCnGMy3bLeO8DIDao3BiEj1k75f74mWJ 11na7fEz4pwtK5ayCJrXhoNCOErMnYTfsSUS2e4Vw7EAmF/9cxw91y9ln9m2qyCuUHps b5ug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g189si2556243qkc.530.2017.08.17.03.00.51; Thu, 17 Aug 2017 03:00:51 -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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 2990C60666; Thu, 17 Aug 2017 10:00:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 0970A65C64; Thu, 17 Aug 2017 10:00:45 +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 4EB5A65C75; Thu, 17 Aug 2017 10:00:37 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id 3649165C64 for ; Thu, 17 Aug 2017 10:00:36 +0000 (UTC) Received: from mxback4j.mail.yandex.net (mxback4j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10d]) by forward103j.mail.yandex.net (Yandex) with ESMTP id C281034C4629 for ; Thu, 17 Aug 2017 13:00:34 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback4j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id VHAfC44NUs-0YiWDugG; Thu, 17 Aug 2017 13:00:34 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 6Qn5zT0IhZ-0YCOG7NC; Thu, 17 Aug 2017 13:00:34 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 17 Aug 2017 13:00:05 +0300 Message-Id: <1502964006-12404-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1502964006-12404-1-git-send-email-odpbot@yandex.ru> References: <1502964006-12404-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 129 Subject: [lng-odp] [PATCH API-NEXT v1 1/2] api: schedule: add schedule order unlock lock api X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Balasubramanian Manoharan Adds odp_schedule_order_unlock_lock() api. This API combines schedule order unlock and lock into a single api for performance optimization in HW. Signed-off-by: Balasubramanian Manoharan --- /** Email created from pull request 129 (bala-manoharan:api_sched_order_lock) ** https://github.com/Linaro/odp/pull/129 ** Patch: https://github.com/Linaro/odp/pull/129.patch ** Base sha: 3547226b19e6982bf74fc8c258b89db2c5f6a39c ** Merge commit sha: bc70981ada1c2036b39488e85df1fe350acb718d **/ include/odp/api/spec/schedule.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h index 8244746d..c5d22148 100644 --- a/include/odp/api/spec/schedule.h +++ b/include/odp/api/spec/schedule.h @@ -368,6 +368,26 @@ void odp_schedule_order_lock(unsigned lock_index); void odp_schedule_order_unlock(unsigned lock_index); /** + * Release ordered context lock and acquires new lock + * + * This call is valid only when holding an ordered synchronization context. + * Release a previously locked ordered context lock and acquires + * a new ordered context lock. + * This call is valid only when there is a single ordered context lock and + * is invalid if there are nested ordered context lock. + * + * @param lock_index Index of the ordered lock in the current context to be + * acquired. Previously acquired ordered lock is released. + * Results are undefined if there is a nested ordered lock + * in the context. Must be in the range + * 0...odp_queue_lock_count() - 1 + * + * @see odp_schedule_order_lock(), odp_schedule_order_unlock() + * + */ +void odp_schedule_order_unlock_lock(uint32_t lock_index); + +/** * @} */ From patchwork Thu Aug 17 10:00:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 110307 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp1969672qge; Thu, 17 Aug 2017 03:02:16 -0700 (PDT) X-Received: by 10.200.3.220 with SMTP id z28mr6760150qtg.35.1502964136101; Thu, 17 Aug 2017 03:02:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502964136; cv=none; d=google.com; s=arc-20160816; b=CP8Feecxfi/yKsCVRzADw+uu+pWN0YEUxwUzc9hLa+mkeyzf/eXRQ56MVgPrUruGXI xIVjrrIUkh4JPlaXMd9GmIvnHGMhxOc/jIGR+d+QQiLghK9fh8ayjQ5dofIW55X8NNg5 Tg1EbFKpEsh8sarUeLqRvvhJMeM/+Tzt9qJdmec81RcsUeANt0tc7dEtZFKOwnui+E5A 1PHW4laRjn5vhLUta6GZB/vf61Retpyt2Q8ZH8dokFCsASxDc5yJYkiO6JNqEfdpSoRU DTu52X8+75EIJ105D+LWs1fThkJb/XxLac0/E+/gZRn+ZYt7G0D6TzgG+VU+8Wfu9KyW Sg2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=CaUMqJybvR1e0/NW5Q8rtcALEJ1pvP+N2+SHT/bC1fU=; b=tGcRFNGt3UlgoNKZOL7sDymQAXg9nFF/sCd/uasn5M02pHcW1u4Ow/ydSoEabxKqo3 7czg8aaRhYCx83tOCSvhf1rxoQLgiZ0ZnjHmhJQLQv33RklOQ9dtjDUNihyFngiix8lM cAblJmW901YFmLGbtSeg6mc/o7VighFJ2x+3+zR8hD0Lx8ztg7GGSb/bPQMKPVQovY0C z7cfxUIZt9jZOd6UkK3qHOiDoyC6jtF2rtFE9TdVvyF9C/daor/ERtXcef/JNYVtkCaV 7jMWHVtOylFMMVKOFlG9XhQqKp5hIf+ALp3xmM4rF99n6iqcUdHryMhF5cAZW9sP0zHR W2vw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g124si2595607qkb.513.2017.08.17.03.02.15; Thu, 17 Aug 2017 03:02:16 -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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id C8ADB64482; Thu, 17 Aug 2017 10:02:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id EB8AA65C7C; Thu, 17 Aug 2017 10:00:47 +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 E93AA65C64; Thu, 17 Aug 2017 10:00:38 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id F043865C70 for ; Thu, 17 Aug 2017 10:00:36 +0000 (UTC) Received: from mxback1g.mail.yandex.net (mxback1g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:162]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 6B4491849C6 for ; Thu, 17 Aug 2017 13:00:35 +0300 (MSK) Received: from smtp2o.mail.yandex.net (smtp2o.mail.yandex.net [2a02:6b8:0:1a2d::26]) by mxback1g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 6zye6oedm7-0ZbiQ9Ix; Thu, 17 Aug 2017 13:00:35 +0300 Received: by smtp2o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 6Qn5zT0IhZ-0YCOwZlM; Thu, 17 Aug 2017 13:00:34 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Thu, 17 Aug 2017 13:00:06 +0300 Message-Id: <1502964006-12404-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1502964006-12404-1-git-send-email-odpbot@yandex.ru> References: <1502964006-12404-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 129 Subject: [lng-odp] [PATCH API-NEXT v1 2/2] linux-generic: schedule: implementation for schedule order unlock lock api X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Balasubramanian Manoharan Implementation for odp_schedule_order_unlock_lock() function. Signed-off-by: Balasubramanian Manoharan --- /** Email created from pull request 129 (bala-manoharan:api_sched_order_lock) ** https://github.com/Linaro/odp/pull/129 ** Patch: https://github.com/Linaro/odp/pull/129.patch ** Base sha: 3547226b19e6982bf74fc8c258b89db2c5f6a39c ** Merge commit sha: bc70981ada1c2036b39488e85df1fe350acb718d **/ platform/linux-generic/include/odp_schedule_if.h | 1 + platform/linux-generic/odp_schedule_if.c | 6 ++++++ platform/linux-generic/odp_schedule_iquery.c | 1 + platform/linux-generic/odp_schedule_scalable.c | 22 ++++++++++++++++++++++ platform/linux-generic/odp_schedule_sp.c | 5 +++++ 5 files changed, 35 insertions(+) diff --git a/platform/linux-generic/include/odp_schedule_if.h b/platform/linux-generic/include/odp_schedule_if.h index 657993b1..e54727a8 100644 --- a/platform/linux-generic/include/odp_schedule_if.h +++ b/platform/linux-generic/include/odp_schedule_if.h @@ -81,6 +81,7 @@ typedef struct { void (*schedule_resume)(void); void (*schedule_release_atomic)(void); void (*schedule_release_ordered)(void); + void (*schedule_release_context)(void); void (*schedule_prefetch)(int); int (*schedule_num_prio)(void); odp_schedule_group_t (*schedule_group_create)(const char *, diff --git a/platform/linux-generic/odp_schedule_if.c b/platform/linux-generic/odp_schedule_if.c index 2f07aafe..e2d33d58 100644 --- a/platform/linux-generic/odp_schedule_if.c +++ b/platform/linux-generic/odp_schedule_if.c @@ -127,3 +127,9 @@ void odp_schedule_order_unlock(unsigned lock_index) { return sched_api->schedule_order_unlock(lock_index); } + +void odp_schedule_order_unlock_lock(uint32_t lock_index) +{ + sched_api->schedule_release_context(); + sched_api->schedule_order_lock(lock_index); +} diff --git a/platform/linux-generic/odp_schedule_iquery.c b/platform/linux-generic/odp_schedule_iquery.c index 86f5d53e..8a5976c4 100644 --- a/platform/linux-generic/odp_schedule_iquery.c +++ b/platform/linux-generic/odp_schedule_iquery.c @@ -1356,6 +1356,7 @@ const schedule_api_t schedule_iquery_api = { .schedule_resume = schedule_resume, .schedule_release_atomic = schedule_release_atomic, .schedule_release_ordered = schedule_release_ordered, + .schedule_release_context = schedule_release_context, .schedule_prefetch = schedule_prefetch, .schedule_num_prio = number_of_priorites, .schedule_group_create = schedule_group_create, diff --git a/platform/linux-generic/odp_schedule_scalable.c b/platform/linux-generic/odp_schedule_scalable.c index 78159b53..3cd9722f 100644 --- a/platform/linux-generic/odp_schedule_scalable.c +++ b/platform/linux-generic/odp_schedule_scalable.c @@ -1055,6 +1055,27 @@ static void schedule_release_ordered(void) _schedule_release_ordered(ts); } +static void schedule_release_context(void) +{ + sched_scalable_thread_state_t *ts; + + ts = sched_ts; + if (ts->rctx != NULL) + _schedule_release_ordered(ts); + else if (odp_likely(ts->atomq != NULL)) { +#ifdef CONFIG_QSCHST_LOCK + sched_elem_t *atomq; + + atomq = ts->atomq; + LOCK(&atomq->qschlock); +#endif + _schedule_release_atomic(ts); +#ifdef CONFIG_QSCHST_LOCK + UNLOCK(&atomq->qschlock); +#endif + } +} + static int schedule_multi(odp_queue_t *from, uint64_t wait, odp_event_t ev[], int num) { @@ -1966,6 +1987,7 @@ const schedule_api_t schedule_scalable_api = { .schedule_resume = schedule_resume, .schedule_release_atomic = schedule_release_atomic, .schedule_release_ordered = schedule_release_ordered, + .schedule_release_context = schedule_release_context, .schedule_prefetch = schedule_prefetch, .schedule_num_prio = schedule_num_prio, .schedule_group_create = schedule_group_create, diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c index 9829acc5..47e99c1b 100644 --- a/platform/linux-generic/odp_schedule_sp.c +++ b/platform/linux-generic/odp_schedule_sp.c @@ -608,6 +608,10 @@ static void schedule_release_ordered(void) { } +static void schedule_release_context(void) +{ +} + static void schedule_prefetch(int num) { (void)num; @@ -856,6 +860,7 @@ const schedule_api_t schedule_sp_api = { .schedule_resume = schedule_resume, .schedule_release_atomic = schedule_release_atomic, .schedule_release_ordered = schedule_release_ordered, + .schedule_release_context = schedule_release_context, .schedule_prefetch = schedule_prefetch, .schedule_num_prio = schedule_num_prio, .schedule_group_create = schedule_group_create,