From patchwork Tue Feb 6 10:00:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 126972 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp2762386ljc; Tue, 6 Feb 2018 02:01:39 -0800 (PST) X-Google-Smtp-Source: AH8x225FpZuhA+aLsHpb8y07Wj7TpRFMwQmSP9Lvm1lKjCzrJp+OfXOVLVVgYZ1ce1EyrBrPtOVh X-Received: by 10.200.40.165 with SMTP id i34mr2529617qti.176.1517911299464; Tue, 06 Feb 2018 02:01:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517911299; cv=none; d=google.com; s=arc-20160816; b=MSMq4QrYA/1Qe9vMHyudKRu7Av5p9PlKi0HrtlnzSJDjdqWk/vhbhEEMHpqsFJLvpL okozIxkddJxkaEXWAwXqG6brtQ7ClBHlxL5piWyO59oxHWrebljvA/OhqqUKj2j4RrL8 rK4bMnEHh8ChpqqGM5QL3GayPxbfc2RjTqzdUMCpQox1B7SaOZNU/T/63/Eq/RxoWpka LjpQj2xgIerN+qKhoZ/99SVpF+TKwfSnZb0DqDPx7Xo/RpheSlk3WIyLW+4hgn7oSfIc INuxgN+uT0p9tFiR048Kl2g7YP2Tj0IhH49oe47Tkdls0Qsy+fQcjAmIVh9lBFiKrmuN afBQ== 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=LLrteGgrsq/IX19FUhUb8GJXelAxDH6mD0zNrPJBgPA=; b=I70nYdotOptfTGw2CdlsaGxxYz9fEdLsZytoL33b5TadHkZtIj9vAce98s+YyMYqh5 z6HAKDNpL5bRthf2c5JEQdhO/ub9Q1PtMQxkWFNQxCtt55bF42HcR6X3ACRgS7DKI9ob 0LYt9zGk38pUX7F/pY2c9sD3VdtW2DB3CsFz3mnmB2bYT11wKkS2eTxo2BLNs5vztZ9j IY/1p96/m2uQDUVzySVSI7uWZrLNKGKRcTb7IjAuo0DWiKgBvR4mQdKblkMej4IwycYJ OHs18nyiAbpGmkdhJFK/+XhOdUm7rtOiumStCEAU0+gY/AjapAONwaUQf6XZ7O+bnu6m RGOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 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 (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id h14si1404688qkj.433.2018.02.06.02.01.39; Tue, 06 Feb 2018 02:01:39 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 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 28F9E61818; Tue, 6 Feb 2018 10:01:39 +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, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL 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 E71B560D3D; Tue, 6 Feb 2018 10:00:26 +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 4364F60919; Tue, 6 Feb 2018 10:00:22 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id E673360A59 for ; Tue, 6 Feb 2018 10:00:15 +0000 (UTC) Received: from mxback10g.mail.yandex.net (mxback10g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:171]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 483B91801E9C for ; Tue, 6 Feb 2018 13:00:10 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback10g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id clQPLPRhua-0ApaOxFF; Tue, 06 Feb 2018 13:00:10 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id oMX7ufMruB-0A6SHcjn; Tue, 06 Feb 2018 13:00:10 +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: Tue, 6 Feb 2018 13:00:08 +0300 Message-Id: <1517911208-3820-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517911208-3820-1-git-send-email-odpbot@yandex.ru> References: <1517911208-3820-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 453 Subject: [lng-odp] [PATCH API-NEXT v3 2/2] linux-gen: schedule: implements async ordered lock 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 asynchronous order context lock Signed-off-by: Balasubramanian Manoharan --- /** Email created from pull request 453 (bala-manoharan:async_order_lock) ** https://github.com/Linaro/odp/pull/453 ** Patch: https://github.com/Linaro/odp/pull/453.patch ** Base sha: 1836820278b57de6144c75872e148976d49d28a2 ** Merge commit sha: 4a224aabaa82727f0e2038fd0361ae561e020e17 **/ platform/linux-generic/include/odp_schedule_if.h | 6 ++++++ platform/linux-generic/odp_schedule.c | 14 +++++++++++++- platform/linux-generic/odp_schedule_if.c | 11 +++++++++++ platform/linux-generic/odp_schedule_iquery.c | 14 +++++++++++++- platform/linux-generic/odp_schedule_scalable.c | 12 ++++++++++++ platform/linux-generic/odp_schedule_sp.c | 14 +++++++++++++- 6 files changed, 68 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/include/odp_schedule_if.h b/platform/linux-generic/include/odp_schedule_if.h index 8605ca663..66e050438 100644 --- a/platform/linux-generic/include/odp_schedule_if.h +++ b/platform/linux-generic/include/odp_schedule_if.h @@ -41,6 +41,8 @@ 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 void (*schedule_order_lock_start_fn_t)(void); +typedef void (*schedule_order_lock_wait_fn_t)(void); typedef uint32_t (*schedule_max_ordered_locks_fn_t)(void); typedef void (*schedule_save_context_fn_t)(uint32_t queue_index); @@ -60,6 +62,8 @@ 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_lock_start_fn_t start_order_lock; + schedule_order_lock_wait_fn_t wait_order_lock; schedule_order_unlock_lock_fn_t order_unlock_lock; schedule_max_ordered_locks_fn_t max_ordered_locks; @@ -105,6 +109,8 @@ typedef struct { void (*schedule_order_lock)(uint32_t); void (*schedule_order_unlock)(uint32_t); void (*schedule_order_unlock_lock)(uint32_t, uint32_t); + void (*schedule_order_lock_start)(uint32_t); + void (*schedule_order_lock_wait)(uint32_t); } schedule_api_t; diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index c91a93380..a6581bed8 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -1152,6 +1152,16 @@ static void schedule_order_unlock_lock(uint32_t unlock_index, schedule_order_lock(lock_index); } +static void schedule_order_lock_start(uint32_t lock_index) +{ + (void)lock_index; +} + +static void schedule_order_lock_wait(uint32_t lock_index) +{ + schedule_order_lock(lock_index); +} + static void schedule_pause(void) { sched_local.pause = 1; @@ -1438,5 +1448,7 @@ const schedule_api_t schedule_default_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 + .schedule_order_unlock_lock = schedule_order_unlock_lock, + .schedule_order_lock_start = schedule_order_lock_start, + .schedule_order_lock_wait = schedule_order_lock_wait }; diff --git a/platform/linux-generic/odp_schedule_if.c b/platform/linux-generic/odp_schedule_if.c index e5f734aea..6a3b4e4ba 100644 --- a/platform/linux-generic/odp_schedule_if.c +++ b/platform/linux-generic/odp_schedule_if.c @@ -134,3 +134,14 @@ void odp_schedule_order_unlock_lock(uint32_t unlock_index, uint32_t lock_index) { sched_api->schedule_order_unlock_lock(unlock_index, lock_index); } + +void odp_schedule_order_lock_start(uint32_t lock_index) +{ + sched_api->schedule_order_lock_start(lock_index); +} + +void odp_schedule_order_lock_wait(uint32_t lock_index) +{ + sched_api->schedule_order_lock_wait(lock_index); +} + diff --git a/platform/linux-generic/odp_schedule_iquery.c b/platform/linux-generic/odp_schedule_iquery.c index 02396aa05..3ce85394e 100644 --- a/platform/linux-generic/odp_schedule_iquery.c +++ b/platform/linux-generic/odp_schedule_iquery.c @@ -1308,6 +1308,16 @@ static uint32_t schedule_max_ordered_locks(void) return CONFIG_QUEUE_MAX_ORD_LOCKS; } +static void schedule_order_lock_start(uint32_t lock_index) +{ + (void)lock_index; +} + +static void schedule_order_lock_wait(uint32_t lock_index) +{ + schedule_order_lock(lock_index); +} + static inline bool is_atomic_queue(unsigned int queue_index) { return (sched->queues[queue_index].sync == ODP_SCHED_SYNC_ATOMIC); @@ -1376,7 +1386,9 @@ const schedule_api_t schedule_iquery_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 + .schedule_order_unlock_lock = schedule_order_unlock_lock, + .schedule_order_lock_start = schedule_order_lock_start, + .schedule_order_lock_wait = schedule_order_lock_wait }; 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 761f93d3f..f5974442d 100644 --- a/platform/linux-generic/odp_schedule_scalable.c +++ b/platform/linux-generic/odp_schedule_scalable.c @@ -1186,6 +1186,16 @@ static void schedule_order_unlock_lock(uint32_t unlock_index, schedule_order_lock(lock_index); } +static void schedule_order_lock_start(uint32_t lock_index) +{ + (void)lock_index; +} + +static void schedule_order_lock_wait(uint32_t lock_index) +{ + schedule_order_lock(lock_index); +} + static void schedule_release_atomic(void) { sched_scalable_thread_state_t *ts; @@ -2096,4 +2106,6 @@ const schedule_api_t schedule_scalable_api = { .schedule_order_lock = schedule_order_lock, .schedule_order_unlock = schedule_order_unlock, .schedule_order_unlock_lock = schedule_order_unlock_lock, + .schedule_order_lock_start = schedule_order_lock_start, + .schedule_order_lock_wait = schedule_order_lock_wait }; diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c index bad47cad9..e46ae4480 100644 --- a/platform/linux-generic/odp_schedule_sp.c +++ b/platform/linux-generic/odp_schedule_sp.c @@ -829,6 +829,16 @@ static void schedule_order_unlock_lock(uint32_t unlock_index, (void)lock_index; } +static void schedule_order_lock_start(uint32_t lock_index) +{ + (void)lock_index; +} + +static void schedule_order_lock_wait(uint32_t lock_index) +{ + (void)lock_index; +} + static void order_lock(void) { } @@ -879,5 +889,7 @@ const schedule_api_t schedule_sp_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 + .schedule_order_unlock_lock = schedule_order_unlock_lock, + .schedule_order_lock_start = schedule_order_lock_start, + .schedule_order_lock_wait = schedule_order_lock_wait };