From patchwork Fri Sep 15 07:00:12 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: 112678 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp291806qgf; Fri, 15 Sep 2017 00:02:58 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDcnVqWqPH4IPbVD0W9Vtqn8sfGTiukXFYNGH8r+kM1uI6vsULn7dQSS22O4cAS+zfL7O4E X-Received: by 10.107.131.234 with SMTP id n103mr6009228ioi.236.1505458978036; Fri, 15 Sep 2017 00:02:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505458978; cv=none; d=google.com; s=arc-20160816; b=SWlj93AT7mIA592ecbRtcFEsBBuCk7ElbVuurPeqMYr2LE87AdsbswOfODY/+QVs9c Xw2ly+Wm9Tg4YQ4dFD7JEpDEKoNGoOztQ/WEAs/rWsZbc0EfJPGJreg+qQ8J3WPJ0I5C DwQ4hGHO7JIR70Cwv3R7yYv3bBHeWhD5nOLwhg5IHcODzbwD2aY3+k+oWWegHX6r9rv0 TxmFWdIiZWnVXMXztFXOR9OySHf0tIyVTxYb2cANKGOnkY71extgVe1/4ny1YxsgUs+w Yn9XUOcBXcl7/rbgufGLVJePqXxdgXB6YYpaTgX5o6iNmvj/bZgVIf+6f0EixVk77jME azFQ== 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=PypXnPNgjXcmk2z9yU54cYO54WYyEYpADHPdgV8Oa+s=; b=EMspwUjSGds+GyYA+OtzpppgK3b5UnQqLgbbY8HECGpWyNuAO9ufB9XisLGL+XMOVg cvBTnqyB1FlJJyPNHVLQ4GrBWmtK0LI/qwvQp7pFct04V1/jJ15seuq+ar1u8ArtPbci AaFGVEQQsYVXqZbYDmLubTj0Fpnr0gVPHEG3APncsxwOenSyk2qFiLLZkmr3/YvEOY2N GoAfX5GycGN4zy0Kh5qMZaCZ+GdoLwDtziLMNUhLF8kc3x3H6EFQ04ud5EnYF0OhxHRu bcP67WzY31WC0uL0k8ExfAVuUfoznzhpVNLkQnEbD73TCrRw+KdBnrUV3vENFN9PTSo7 UJcQ== 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 c133si529880itb.181.2017.09.15.00.02.57; Fri, 15 Sep 2017 00:02:58 -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 900C6609DA; Fri, 15 Sep 2017 07:02:57 +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 4353B609A2; Fri, 15 Sep 2017 07:00:54 +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 955BF60993; Fri, 15 Sep 2017 07:00:39 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id 224F06097F for ; Fri, 15 Sep 2017 07:00:34 +0000 (UTC) Received: from mxback5o.mail.yandex.net (mxback5o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1f]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 53467186377 for ; Fri, 15 Sep 2017 10:00:32 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback5o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id IK3c5kfske-0WSOM1oN; Fri, 15 Sep 2017 10:00:32 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lLHR2ftQSF-0VtGU1aG; Fri, 15 Sep 2017 10:00:31 +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: Fri, 15 Sep 2017 10:00:12 +0300 Message-Id: <1505458814-11509-7-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505458814-11509-1-git-send-email-odpbot@yandex.ru> References: <1505458814-11509-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 160 Subject: [lng-odp] [PATCH API-NEXT v12 6/8] linux-generic: schedule: implement 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 Implements 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 160 (bala-manoharan:api_sched_order_lock) ** https://github.com/Linaro/odp/pull/160 ** Patch: https://github.com/Linaro/odp/pull/160.patch ** Base sha: 6b6253c30f88c80bf632436ff06c1b000860a2f1 ** Merge commit sha: 8654cc5ecbcd8f0299a0c56a1e2ff23ba87c1d67 **/ platform/linux-generic/include/odp_schedule_if.h | 3 +++ platform/linux-generic/odp_schedule.c | 10 +++++++++- platform/linux-generic/odp_schedule_if.c | 5 +++++ platform/linux-generic/odp_schedule_iquery.c | 3 ++- platform/linux-generic/odp_schedule_scalable.c | 8 ++++++++ platform/linux-generic/odp_schedule_sp.c | 10 +++++++++- 6 files changed, 36 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/include/odp_schedule_if.h b/platform/linux-generic/include/odp_schedule_if.h index 3815a27e6..2384f15b3 100644 --- a/platform/linux-generic/include/odp_schedule_if.h +++ b/platform/linux-generic/include/odp_schedule_if.h @@ -34,6 +34,7 @@ typedef int (*schedule_init_local_fn_t)(void); typedef int (*schedule_term_local_fn_t)(void); typedef void (*schedule_order_lock_fn_t)(void); typedef void (*schedule_order_unlock_fn_t)(void); +typedef void (*schedule_order_unlock_lock_fn_t)(void); typedef uint32_t (*schedule_max_ordered_locks_fn_t)(void); typedef void (*schedule_save_context_fn_t)(uint32_t queue_index); @@ -53,6 +54,7 @@ typedef struct schedule_fn_t { schedule_term_local_fn_t term_local; schedule_order_lock_fn_t order_lock; schedule_order_unlock_fn_t order_unlock; + schedule_order_unlock_lock_fn_t order_unlock_lock; schedule_max_ordered_locks_fn_t max_ordered_locks; /* Called only when status_sync is set */ @@ -95,6 +97,7 @@ typedef struct { odp_schedule_group_info_t *); void (*schedule_order_lock)(uint32_t); void (*schedule_order_unlock)(uint32_t); + void (*schedule_order_unlock_lock)(uint32_t, uint32_t); } schedule_api_t; diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index e6fbd5c65..1071f83de 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -1144,6 +1144,13 @@ static void schedule_order_unlock(uint32_t lock_index) odp_atomic_store_rel_u64(ord_lock, sched_local.ordered.ctx + 1); } +static void schedule_order_unlock_lock(uint32_t unlock_index, + uint32_t lock_index) +{ + schedule_order_unlock(unlock_index); + schedule_order_lock(lock_index); +} + static void schedule_pause(void) { sched_local.pause = 1; @@ -1429,5 +1436,6 @@ const schedule_api_t schedule_default_api = { .schedule_group_thrmask = schedule_group_thrmask, .schedule_group_info = schedule_group_info, .schedule_order_lock = schedule_order_lock, - .schedule_order_unlock = schedule_order_unlock + .schedule_order_unlock = schedule_order_unlock, + .schedule_order_unlock_lock = schedule_order_unlock_lock }; diff --git a/platform/linux-generic/odp_schedule_if.c b/platform/linux-generic/odp_schedule_if.c index ff664420f..08ca813a9 100644 --- a/platform/linux-generic/odp_schedule_if.c +++ b/platform/linux-generic/odp_schedule_if.c @@ -129,3 +129,8 @@ void odp_schedule_order_unlock(uint32_t lock_index) { return sched_api->schedule_order_unlock(lock_index); } + +void odp_schedule_order_unlock_lock(uint32_t unlock_index, uint32_t lock_index) +{ + sched_api->schedule_order_unlock_lock(unlock_index, lock_index); +} diff --git a/platform/linux-generic/odp_schedule_iquery.c b/platform/linux-generic/odp_schedule_iquery.c index 850c5d8b7..e6be5d3c7 100644 --- a/platform/linux-generic/odp_schedule_iquery.c +++ b/platform/linux-generic/odp_schedule_iquery.c @@ -1375,7 +1375,8 @@ const schedule_api_t schedule_iquery_api = { .schedule_group_thrmask = schedule_group_thrmask, .schedule_group_info = schedule_group_info, .schedule_order_lock = schedule_order_lock, - .schedule_order_unlock = schedule_order_unlock + .schedule_order_unlock = schedule_order_unlock, + .schedule_order_unlock_lock = schedule_order_unlock_lock }; static void thread_set_interest(sched_thread_local_t *thread, diff --git a/platform/linux-generic/odp_schedule_scalable.c b/platform/linux-generic/odp_schedule_scalable.c index 86018b0a2..37be471c6 100644 --- a/platform/linux-generic/odp_schedule_scalable.c +++ b/platform/linux-generic/odp_schedule_scalable.c @@ -1028,6 +1028,13 @@ static void schedule_order_unlock(uint32_t lock_index) rctx->olock_flags |= 1U << lock_index; } +static void schedule_order_unlock_lock(uint32_t unlock_index, + uint32_t lock_index) +{ + schedule_order_unlock(unlock_index); + schedule_order_lock(lock_index); +} + static void schedule_release_atomic(void) { sched_scalable_thread_state_t *ts; @@ -1978,4 +1985,5 @@ const schedule_api_t schedule_scalable_api = { .schedule_group_info = schedule_group_info, .schedule_order_lock = schedule_order_lock, .schedule_order_unlock = schedule_order_unlock, + .schedule_order_unlock_lock = schedule_order_unlock_lock, }; diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c index 62efe1bb8..9db587e26 100644 --- a/platform/linux-generic/odp_schedule_sp.c +++ b/platform/linux-generic/odp_schedule_sp.c @@ -819,6 +819,13 @@ static void schedule_order_unlock(uint32_t lock_index) (void)lock_index; } +static void schedule_order_unlock_lock(uint32_t unlock_index, + uint32_t lock_index) +{ + (void)unlock_index; + (void)lock_index; +} + static void order_lock(void) { } @@ -868,5 +875,6 @@ const schedule_api_t schedule_sp_api = { .schedule_group_thrmask = schedule_group_thrmask, .schedule_group_info = schedule_group_info, .schedule_order_lock = schedule_order_lock, - .schedule_order_unlock = schedule_order_unlock + .schedule_order_unlock = schedule_order_unlock, + .schedule_order_unlock_lock = schedule_order_unlock_lock };