From patchwork Thu Sep 14 15:00:10 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: 112567 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp848132qgf; Thu, 14 Sep 2017 08:06:56 -0700 (PDT) X-Google-Smtp-Source: AOwi7QD+hQ1bu0f2aTlhFe64izFzv6PNEGSleFYpUCVjH4ZEmO4lYRo68Tx7NdSzM59EGqCXHDYY X-Received: by 10.55.21.92 with SMTP id f89mr2901693qkh.177.1505401616731; Thu, 14 Sep 2017 08:06:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505401616; cv=none; d=google.com; s=arc-20160816; b=ffpG7kMVXoTeEmIaV6QRUpLYm3XmFAmt74gC2+4W9d1f3a/3/Qb8K8kq6om59uRkBb f+jjSgchZnvEggQwwWfkfBzOiI4uRosNmsVViLXWaOJibLLC7dATyFj+ECyuLc5fLZqw QosCvZo6kPsxIusZfw4TBljqIMQCOdCVgTkcMBfFnSqvuMpbmrvaNrWsry2w4yD2z0DH 4Y3NUDmKAEopSADXT1wSm94hoH1HAgui9L7VZIbib4Fnps/ndY3gYrfECuc0wI5nd04z PViJMKJhnGzV8wX6uoZPlHWaZDHlPVxorPygJGvEehal9MkFa9UP22uWHGTB3lR/uu+o gT/w== 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=ZQAoF848OvNSdGd+5vlKQpq/FQsx841eA0aaxnPBdJQ=; b=x7+NmVi9Dr54CB+p9Qy0hwFzKBtMr+LcUbL/fu3MZ4seIQGBv3hpZ24zQ8wi54QMAd Uq8qgqLIeTeLxfWd+hNiUoDiZVsozORSrF4jYTOfIs4NM0M/vB58hYjoqCIm8QRajRDB s902lMIuPmcxgj2pYo1kSGQT2SgILdMmKSZqruiV39GAmzITmkWLvBCtrPzY3vbheBaB PdhadD39ZQlL1z0zpfkvvJj1oYHTDvnOHM+mskISNqa/sL+D1DtI+D6MGAeDewl15SPL ooR3T/mAXugDDm0IR+6sWriq2L9VlMd1ixpZ3ULnHfu9x/r0UtoKyf5DwsP5G0euWhv+ hMpw== 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 22si19213364qkp.389.2017.09.14.08.06.56; Thu, 14 Sep 2017 08:06:56 -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 03E7E609ED; Thu, 14 Sep 2017 15:06:56 +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 1D64960BE8; Thu, 14 Sep 2017 15:01:14 +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 2E91F609A6; Thu, 14 Sep 2017 15:00:30 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id 85F5F60882 for ; Thu, 14 Sep 2017 15:00:26 +0000 (UTC) Received: from mxback2o.mail.yandex.net (mxback2o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1c]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 85237185ECD for ; Thu, 14 Sep 2017 18:00:25 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback2o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id IOUyfKJlUq-0PfOMW7a; Thu, 14 Sep 2017 18:00:25 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id gNZkqRzw9k-0O786Dnq; Thu, 14 Sep 2017 18:00:24 +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:10 +0300 Message-Id: <1505401213-7265-10-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 9/12] 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: 438a3bab5df9c05dc06f0b4e4b22c0a7db0864fd **/ 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; }