From patchwork Fri Aug 4 08:59:56 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: 109374 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp1878119qge; Fri, 4 Aug 2017 02:00:37 -0700 (PDT) X-Received: by 10.237.36.107 with SMTP id s40mr2278917qtc.137.1501837237002; Fri, 04 Aug 2017 02:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501837236; cv=none; d=google.com; s=arc-20160816; b=FxznX8w8GtCuaUeUAWbN76Qitwmwueosc7vs59QCxc71Q8PFFVXvZnettR5cRHeqdC Xv91IsdjpJFBwbm64XtGmlSKp2ijMdBrX139FFBfe1Rn1O28JAspgxJBpThayTDuWsrn PysVmiE77nK89vbjPZZQFHRy/yStMUSi9amWdFkaW26xiq2JNWcM8ZJmSXLYokscPwus b2wUGxNmv/DrcKEAxqf2Rftt1262mIevhAjMwNv0MUlLsRgj+JoxmmlNVj010RF4RtBs o3tYWqrIvuSVHYgkLOjWCdfbdRtASePWdkQxdtTgmPb7yWqZ89xRTT86QpbZkruMDXzv WGAg== 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=p6yKcqfO9P3ZaBVohdrdoj1uVwXiy7/7pyOPoXGcumU=; b=QXvsBcH2MhOi3sp8MdN7TJaViA/nR/N8nHlRpIXYEGKryyNXraVwVsfnJKMekZKXY7 H2TvINypYXOG8dgS253mbAIC3kk8RwLx3bErx7w9xG6MGdDhCYA9lkygxCNQeXCQT+K7 KKyR/6rTtYJq6lv/LTRtxaEucZvyFBJqtf2szHQZcbDlydipyPXkdMXz9/DE/ZS7cCVx IwV+3jYtu+2THZ90sG1pSuJdqc1kBaQr3w1CD7RMaR2tTlemkHsyWI/XxWg0PpD86j1A RC/4urPh8zeqM4X1baVw4g54UT6nlypxI+YFMwQVrZq5EC7rOobFceg89Jlfi0y+y/IB NxDQ== 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 s43si1084561qta.415.2017.08.04.02.00.36; Fri, 04 Aug 2017 02:00:36 -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 F24B864450; Fri, 4 Aug 2017 09:00:35 +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 0BA3062ED2; Fri, 4 Aug 2017 09:00: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 6843762ECD; Fri, 4 Aug 2017 09:00:28 +0000 (UTC) Received: from forward4p.cmail.yandex.net (forward4p.cmail.yandex.net [77.88.31.19]) by lists.linaro.org (Postfix) with ESMTPS id BE43A62ECD for ; Fri, 4 Aug 2017 09:00:26 +0000 (UTC) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::25]) by forward4p.cmail.yandex.net (Yandex) with ESMTP id 4C9C720EF2 for ; Fri, 4 Aug 2017 12:00:24 +0300 (MSK) Received: from smtp1o.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1o.mail.yandex.net (Yandex) with ESMTP id BFDCF1300E47 for ; Fri, 4 Aug 2017 12:00:20 +0300 (MSK) Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id kkQJPUXR1g-0GG8LXWk; Fri, 04 Aug 2017 12:00:16 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) X-Yandex-Suid-Status: 1 0 From: Github ODP bot To: lng-odp@lists.linaro.org Date: Fri, 4 Aug 2017 11:59:56 +0300 Message-Id: <1501837208-7450-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501837208-7450-1-git-send-email-odpbot@yandex.ru> References: <1501837208-7450-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 108 Subject: [lng-odp] [PATCH API-NEXT v1 1/13] linux-gen: hide get_qentry 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: Dmitry Eremin-Solenikov Replace two last index->qentry lookups with pointers to quentry, thus making it possible to make get_qentry static in odp_queue.c Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 108 (lumag:symbols-cleanup) ** https://github.com/Linaro/odp/pull/108 ** Patch: https://github.com/Linaro/odp/pull/108.patch ** Base sha: 8390f890d4bd2babb63a24f7b15d2f4763e44050 ** Merge commit sha: 44fd671a0d2772a32395c7f0574aa545d2a9aa71 **/ platform/linux-generic/include/odp_queue_internal.h | 2 -- platform/linux-generic/odp_queue.c | 4 ++++ platform/linux-generic/odp_schedule.c | 8 +++----- platform/linux-generic/odp_schedule_iquery.c | 8 +++----- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/platform/linux-generic/include/odp_queue_internal.h b/platform/linux-generic/include/odp_queue_internal.h index 032dde88..c5ff1e7d 100644 --- a/platform/linux-generic/include/odp_queue_internal.h +++ b/platform/linux-generic/include/odp_queue_internal.h @@ -61,8 +61,6 @@ union queue_entry_u { uint8_t pad[ROUNDUP_CACHE_LINE(sizeof(struct queue_entry_s))]; }; -queue_entry_t *get_qentry(uint32_t queue_id); - void queue_lock(queue_entry_t *queue); void queue_unlock(queue_entry_t *queue); diff --git a/platform/linux-generic/odp_queue.c b/platform/linux-generic/odp_queue.c index 904c9ef2..e2f8c067 100644 --- a/platform/linux-generic/odp_queue.c +++ b/platform/linux-generic/odp_queue.c @@ -43,6 +43,9 @@ typedef struct queue_table_t { static queue_table_t *queue_tbl; +static +queue_entry_t *get_qentry(uint32_t queue_id); + static inline queue_entry_t *handle_to_qentry(odp_queue_t handle) { uint32_t queue_id; @@ -56,6 +59,7 @@ static inline odp_queue_t queue_from_id(uint32_t queue_id) return _odp_cast_scalar(odp_queue_t, queue_id + 1); } +static queue_entry_t *get_qentry(uint32_t queue_id) { return &queue_tbl->queue[queue_id]; diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index 8af27673..f52ef28c 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -130,7 +130,7 @@ ODP_STATIC_ASSERT((8 * sizeof(pri_mask_t)) >= QUEUES_PER_PRIO, /* Storage for stashed enqueue operation arguments */ typedef struct { odp_buffer_hdr_t *buf_hdr[QUEUE_MULTI_MAX]; - uint32_t queue_index; + queue_entry_t *queue_entry; int num; } ordered_stash_t; @@ -682,12 +682,10 @@ static inline void ordered_stash_release(void) for (i = 0; i < sched_local.ordered.stash_num; i++) { queue_entry_t *queue_entry; - uint32_t queue_index; odp_buffer_hdr_t **buf_hdr; int num; - queue_index = sched_local.ordered.stash[i].queue_index; - queue_entry = get_qentry(queue_index); + queue_entry = sched_local.ordered.stash[i].queue_entry; buf_hdr = sched_local.ordered.stash[i].buf_hdr; num = sched_local.ordered.stash[i].num; @@ -788,7 +786,7 @@ static int schedule_ord_enq_multi(queue_t q_int, void *buf_hdr[], return 0; } - sched_local.ordered.stash[stash_num].queue_index = dst_queue->s.index; + sched_local.ordered.stash[stash_num].queue_entry = dst_queue; sched_local.ordered.stash[stash_num].num = num; for (i = 0; i < num; i++) sched_local.ordered.stash[stash_num].buf_hdr[i] = buf_hdr[i]; diff --git a/platform/linux-generic/odp_schedule_iquery.c b/platform/linux-generic/odp_schedule_iquery.c index 44a725ab..23e36c9a 100644 --- a/platform/linux-generic/odp_schedule_iquery.c +++ b/platform/linux-generic/odp_schedule_iquery.c @@ -174,7 +174,7 @@ typedef struct { /* Storage for stashed enqueue operation arguments */ typedef struct { odp_buffer_hdr_t *buf_hdr[QUEUE_MULTI_MAX]; - uint32_t queue_index; + queue_entry_t *queue_entry; int num; } ordered_stash_t; @@ -1133,12 +1133,10 @@ static inline void ordered_stash_release(void) for (i = 0; i < thread_local.ordered.stash_num; i++) { queue_entry_t *queue_entry; - uint32_t queue_index; odp_buffer_hdr_t **buf_hdr; int num; - queue_index = thread_local.ordered.stash[i].queue_index; - queue_entry = get_qentry(queue_index); + queue_entry = thread_local.ordered.stash[i].queue_entry; buf_hdr = thread_local.ordered.stash[i].buf_hdr; num = thread_local.ordered.stash[i].num; @@ -1225,7 +1223,7 @@ static int schedule_ord_enq_multi(queue_t q_int, void *buf_hdr[], return 0; } - thread_local.ordered.stash[stash_num].queue_index = dst_queue->s.index; + thread_local.ordered.stash[stash_num].queue_entry = dst_queue; thread_local.ordered.stash[stash_num].num = num; for (i = 0; i < num; i++) thread_local.ordered.stash[stash_num].buf_hdr[i] = buf_hdr[i];