From patchwork Thu Sep 14 15:00:11 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: 112570 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp851063qgf; Thu, 14 Sep 2017 08:09:14 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDRSvsWmOro84D9wC0yWq53DPHXNw5J6HDXs0jEEmuQJP0Lco4xgZO7M4avy7mRTq3xBHXG X-Received: by 10.55.15.65 with SMTP id z62mr3270686qkg.2.1505401753785; Thu, 14 Sep 2017 08:09:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505401753; cv=none; d=google.com; s=arc-20160816; b=DrjaFhzJvcHiv3Lmu1i8PmMUdtZmly2GlEXZxQZWGGRO1dpSGY6SSTg20f44pGRD7+ 7mmz6aAjBzrw85x0ZW7xved0fpDHUZtkaZqf4gw6+H2LSY93nKInD1yhmE1CzgONNzFh 9hQH0l2InDu2PGVtLtez8ntZWBURmPh8cMVJwZepLWV7bq1Y4ffmqMndFK2RP4HULOQC z9nI3bYTIxxfHUBfHE9unHFMy6BGmjQeLEZWzknNAe6F3inBHyG2iMgXrDraw4IaXVYY H/4cyG298Pnfnsjifv75HkW65fn976rr9QxClF8G595WOnHQ5LqfiuzHv0mtg4etdLLu QWkw== 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=H9t3YkfesgOoGQ/OqzWauBJZJaLIHKh/aJGa5CPFGQU=; b=tjAjvH7K5/Z0zJ4Upe6Mep7S2quWBW/dzXHxP4vYOPDHuI4jYFSeLCgfCNmCraJ+T0 8rtWizVsX30/6EHSgZs++I9sxY4l22RXW/tjFIxBKYsfMUvzLu90Nt13uawkMMrWgyim ut5SBflUMYzSbn+MxMr0jwi9jpcNx7VpTiLDDqlbU9xM3z3G6d2k6D/7bXJdVPZVY9PG M7Wn7rFjEBT4dowg2xYlWd+Fxjp4hjbiNcDi2pqAyhZS4O8dxq7RlgHHyYBGpjihoVh3 LGOOVq9BSZqFkdDRDjy+bnx2SgDuJjOXc0CwT7C/gbyOGDDohi/9Gw41J0QaCwWCdhP5 Qx1g== 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 n190si16656840qkb.508.2017.09.14.08.09.13; Thu, 14 Sep 2017 08:09:13 -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 549ED60EC3; Thu, 14 Sep 2017 15:09:13 +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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,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 1385760966; Thu, 14 Sep 2017 15:01:32 +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 B198A60900; Thu, 14 Sep 2017 15:00:33 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id E49936088A for ; Thu, 14 Sep 2017 15:00:27 +0000 (UTC) Received: from mxback18j.mail.yandex.net (mxback18j.mail.yandex.net [IPv6:2a02:6b8:0:1619::94]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 342F45A03B64 for ; Thu, 14 Sep 2017 18:00:26 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback18j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 6f53Iy9LZA-0Q68Zb7r; Thu, 14 Sep 2017 18:00:26 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id gNZkqRzw9k-0P7KBklR; Thu, 14 Sep 2017 18:00:25 +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, 14 Sep 2017 18:00:11 +0300 Message-Id: <1505401213-7265-11-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505401213-7265-1-git-send-email-odpbot@yandex.ru> References: <1505401213-7265-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 160 Subject: [lng-odp] [PATCH API-NEXT v11 10/12] 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: 438a3bab5df9c05dc06f0b4e4b22c0a7db0864fd **/ 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 };