From patchwork Fri Sep 15 07: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: 112683 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp294409qgf; Fri, 15 Sep 2017 00:06:10 -0700 (PDT) X-Google-Smtp-Source: AOwi7QA8eInEwo+AaZ9WIKr5GeFRLnMQkP3YdHYHG46Ti1eA3nbqqBLsKQMRquDtKpGQvIofstDt X-Received: by 10.107.163.9 with SMTP id m9mr6132202ioe.230.1505459170460; Fri, 15 Sep 2017 00:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505459170; cv=none; d=google.com; s=arc-20160816; b=YjLqGCKNK/odbAz3OpbhEKAoGOriWsPicct1ONLENBdB2Fpzog6TrH30QweOZMLITa Zs+rh+vsgxeu7W8ae9nrzVHdA1VhjJzgZVIOK32rxo1t64bshZ8GJqHOeF7tW5FX4VBN yvxOiG3jkyLbBIiJS/B4EsR+SEjPDSfjWO5s0IOfdjtiF5Nw5rhNvWwSMO2OSvgJScnI +/04UireVJwy13BV25rtHwbgQPLkMJVPUwv/Dm/u+WHIA7R2lrLJczNTgb4aQOsV5OTx 7XxhckH4/H+fmlmlH6swjzfD87GnNEo16wm7spf5jD6OTiSqFLWdHsbgOhpCLN3MF4D1 7ncA== 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=kUyYfQOX4T86Ti9dk9ivU3lv9pn2newa176E7vDPk7g=; b=duRkTlNZBlSqvEjbMwYc4+HXAXisGo4SpmL6PAo/NWWj/Uh8TMAFYZ892NXpW/MsBJ 2eGT3LkVUc74Wao1jh1XnYesiYQsmM4hbJRTWt6sLtaXizclHuy7Z5V3TmBsRwDb4u+/ DJgxXxPP37MIQ69UQKgMeYeCJQN0IQGAIu18iKZvC36zDpftMG12aXHf1LHUMoJhFx4i 1Qwq0zh1s/RETIXMr7bjKQuymHE5RcCXvCyDFbAYtoG05Ys7er812Ovt+nFIvGOl3+rg H/EsHKcJiqEoWMqs3YVxTRWwqF1ZdNnL68TSkqj4yC3Mc6Di1uUpCUjpQMrIg7tHDIKe uM9A== 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 v185si214673iof.272.2017.09.15.00.06.10; Fri, 15 Sep 2017 00:06:10 -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 02293609EB; Fri, 15 Sep 2017 07:06:10 +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,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 9BE346071F; Fri, 15 Sep 2017 07:01:19 +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 4E7FC60976; Fri, 15 Sep 2017 07:00:43 +0000 (UTC) Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [37.140.190.180]) by lists.linaro.org (Postfix) with ESMTPS id 358D76097C for ; Fri, 15 Sep 2017 07:00:33 +0000 (UTC) Received: from mxback4g.mail.yandex.net (mxback4g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:165]) by forward100o.mail.yandex.net (Yandex) with ESMTP id 8D5D32A22941 for ; Fri, 15 Sep 2017 10:00:31 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback4g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 2iAqcHBXuv-0VVa6ilS; Fri, 15 Sep 2017 10:00:31 +0300 Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id lLHR2ftQSF-0VtqaZCe; 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:11 +0300 Message-Id: <1505458814-11509-6-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 5/8] linux-generic: schedule: change order lock function signature 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 change function param signature from unsigned to uint32_t 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 | 6 +++--- .../linux-generic/include/odp_schedule_scalable_ordered.h | 2 +- platform/linux-generic/odp_schedule.c | 10 +++++----- platform/linux-generic/odp_schedule_if.c | 4 ++-- platform/linux-generic/odp_schedule_iquery.c | 15 +++++++++++---- platform/linux-generic/odp_schedule_scalable.c | 6 +++--- platform/linux-generic/odp_schedule_scalable_ordered.c | 2 +- platform/linux-generic/odp_schedule_sp.c | 6 +++--- 8 files changed, 29 insertions(+), 22 deletions(-) diff --git a/platform/linux-generic/include/odp_schedule_if.h b/platform/linux-generic/include/odp_schedule_if.h index 657993b13..3815a27e6 100644 --- a/platform/linux-generic/include/odp_schedule_if.h +++ b/platform/linux-generic/include/odp_schedule_if.h @@ -34,7 +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 unsigned (*schedule_max_ordered_locks_fn_t)(void); +typedef uint32_t (*schedule_max_ordered_locks_fn_t)(void); typedef void (*schedule_save_context_fn_t)(uint32_t queue_index); typedef struct schedule_fn_t { @@ -93,8 +93,8 @@ typedef struct { int (*schedule_group_thrmask)(odp_schedule_group_t, odp_thrmask_t *); int (*schedule_group_info)(odp_schedule_group_t, odp_schedule_group_info_t *); - void (*schedule_order_lock)(unsigned); - void (*schedule_order_unlock)(unsigned); + void (*schedule_order_lock)(uint32_t); + void (*schedule_order_unlock)(uint32_t); } schedule_api_t; diff --git a/platform/linux-generic/include/odp_schedule_scalable_ordered.h b/platform/linux-generic/include/odp_schedule_scalable_ordered.h index 1c365a2b0..f88f973c6 100644 --- a/platform/linux-generic/include/odp_schedule_scalable_ordered.h +++ b/platform/linux-generic/include/odp_schedule_scalable_ordered.h @@ -79,7 +79,7 @@ typedef struct reorder_window { uint32_t tail; uint32_t turn; uint32_t olock[CONFIG_QUEUE_MAX_ORD_LOCKS]; - uint16_t lock_count; + uint32_t lock_count; /* Reorder contexts in this window */ reorder_context_t *ring[RWIN_SIZE]; } reorder_window_t; diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index 5b9407624..e6fbd5c65 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -250,7 +250,7 @@ typedef struct { int prio; int queue_per_prio; int sync; - unsigned order_lock_count; + uint32_t order_lock_count; } queue[ODP_CONFIG_QUEUES]; struct { @@ -465,7 +465,7 @@ static inline int grp_update_tbl(void) return num; } -static unsigned schedule_max_ordered_locks(void) +static uint32_t schedule_max_ordered_locks(void) { return CONFIG_QUEUE_MAX_ORD_LOCKS; } @@ -699,7 +699,7 @@ static inline void ordered_stash_release(void) static inline void release_ordered(void) { uint32_t qi; - unsigned i; + uint32_t i; qi = sched_local.ordered.src_queue; @@ -1100,7 +1100,7 @@ static void order_unlock(void) { } -static void schedule_order_lock(unsigned lock_index) +static void schedule_order_lock(uint32_t lock_index) { odp_atomic_u64_t *ord_lock; uint32_t queue_index; @@ -1127,7 +1127,7 @@ static void schedule_order_lock(unsigned lock_index) } } -static void schedule_order_unlock(unsigned lock_index) +static void schedule_order_unlock(uint32_t lock_index) { odp_atomic_u64_t *ord_lock; uint32_t queue_index; diff --git a/platform/linux-generic/odp_schedule_if.c b/platform/linux-generic/odp_schedule_if.c index e56e3722b..ff664420f 100644 --- a/platform/linux-generic/odp_schedule_if.c +++ b/platform/linux-generic/odp_schedule_if.c @@ -120,12 +120,12 @@ int odp_schedule_group_info(odp_schedule_group_t group, return sched_api->schedule_group_info(group, info); } -void odp_schedule_order_lock(unsigned lock_index) +void odp_schedule_order_lock(uint32_t lock_index) { return sched_api->schedule_order_lock(lock_index); } -void odp_schedule_order_unlock(unsigned lock_index) +void odp_schedule_order_unlock(uint32_t lock_index) { return sched_api->schedule_order_unlock(lock_index); } diff --git a/platform/linux-generic/odp_schedule_iquery.c b/platform/linux-generic/odp_schedule_iquery.c index b81e5dab1..850c5d8b7 100644 --- a/platform/linux-generic/odp_schedule_iquery.c +++ b/platform/linux-generic/odp_schedule_iquery.c @@ -1150,7 +1150,7 @@ static inline void ordered_stash_release(void) static inline void release_ordered(void) { uint32_t qi; - unsigned i; + uint32_t i; qi = thread_local.ordered.src_queue; @@ -1252,7 +1252,7 @@ static void order_unlock(void) { } -static void schedule_order_lock(unsigned lock_index) +static void schedule_order_lock(uint32_t lock_index) { odp_atomic_u64_t *ord_lock; uint32_t queue_index; @@ -1279,7 +1279,7 @@ static void schedule_order_lock(unsigned lock_index) } } -static void schedule_order_unlock(unsigned lock_index) +static void schedule_order_unlock(uint32_t lock_index) { odp_atomic_u64_t *ord_lock; uint32_t queue_index; @@ -1296,7 +1296,14 @@ static void schedule_order_unlock(unsigned lock_index) odp_atomic_store_rel_u64(ord_lock, thread_local.ordered.ctx + 1); } -static unsigned schedule_max_ordered_locks(void) +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 uint32_t schedule_max_ordered_locks(void) { return CONFIG_QUEUE_MAX_ORD_LOCKS; } diff --git a/platform/linux-generic/odp_schedule_scalable.c b/platform/linux-generic/odp_schedule_scalable.c index 765326e8e..86018b0a2 100644 --- a/platform/linux-generic/odp_schedule_scalable.c +++ b/platform/linux-generic/odp_schedule_scalable.c @@ -990,7 +990,7 @@ static int _schedule(odp_queue_t *from, odp_event_t ev[], int num_evts) /******************************************************************************/ -static void schedule_order_lock(unsigned lock_index) +static void schedule_order_lock(uint32_t lock_index) { struct reorder_context *rctx = sched_ts->rctx; @@ -1010,7 +1010,7 @@ static void schedule_order_lock(unsigned lock_index) } } -static void schedule_order_unlock(unsigned lock_index) +static void schedule_order_unlock(uint32_t lock_index) { struct reorder_context *rctx; @@ -1936,7 +1936,7 @@ static void order_unlock(void) { } -static unsigned schedule_max_ordered_locks(void) +static uint32_t schedule_max_ordered_locks(void) { return CONFIG_QUEUE_MAX_ORD_LOCKS; } diff --git a/platform/linux-generic/odp_schedule_scalable_ordered.c b/platform/linux-generic/odp_schedule_scalable_ordered.c index 80ff2490b..9396cd031 100644 --- a/platform/linux-generic/odp_schedule_scalable_ordered.c +++ b/platform/linux-generic/odp_schedule_scalable_ordered.c @@ -220,7 +220,7 @@ static inline void olock_unlock(const reorder_context_t *rctx, static void olock_release(const reorder_context_t *rctx) { reorder_window_t *rwin; - int i; + uint32_t i; rwin = rctx->rwin; diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c index 05241275d..62efe1bb8 100644 --- a/platform/linux-generic/odp_schedule_sp.c +++ b/platform/linux-generic/odp_schedule_sp.c @@ -243,7 +243,7 @@ static int term_local(void) return 0; } -static unsigned max_ordered_locks(void) +static uint32_t max_ordered_locks(void) { return NUM_ORDERED_LOCKS; } @@ -809,12 +809,12 @@ static int schedule_group_info(odp_schedule_group_t group, return 0; } -static void schedule_order_lock(unsigned lock_index) +static void schedule_order_lock(uint32_t lock_index) { (void)lock_index; } -static void schedule_order_unlock(unsigned lock_index) +static void schedule_order_unlock(uint32_t lock_index) { (void)lock_index; }