From patchwork Tue Oct 3 18:00:05 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: 114708 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2165255qgn; Tue, 3 Oct 2017 11:03:44 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAEJLljWGosDqhgfiiyCvZRm5KH0Rrpf+ml/qq0C9eZdOj4X+MdozK5gQy2nnPuxab63bTg X-Received: by 10.200.57.83 with SMTP id t19mr25413715qtb.150.1507053824400; Tue, 03 Oct 2017 11:03:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507053824; cv=none; d=google.com; s=arc-20160816; b=kxljUM97QKFOfNsgJs0CZNeZR1F6M957kzRu9WkApyJZDFevOWAQmH27tOPtTVSLm2 fiaZqM2STo2+Gq72w3Zqu24pCg9KukVtTNvMa2T8LRoOs34uePmGx3csOyztVFIOoIw7 MO8patDtmAp8HlKaNmacQ+KshwOSNzQDMK2/YTLw5Evd3qw2s1GkHdYXEEKYU/rlqxbf q0I1UTcg5pybqv4dvL/OGkBYhsqAIPI5pMDC53UOshOKhfyFLTZwzoygGqBilmAXpNzY U1juLi+9LEzg5b6QjGaM8Qn7DK3Hfj4GgqRsU/ma3RwQZIBjkGiXxLCYVENDVo7LRe09 2bdg== 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=Q5CYpLEnYAts0/DD/8abpJDW5JcVLB3um8FMTJKXH7s=; b=dXrgug1vCUGQH6SmP3uSA7jHjCoqPg7TjQfqTKS2nCs6xGz22oa8mi+tutucdcMXKV QRUGi3bRO6vM+0BD28FZ0gwANYveWBdbg8zapldZFXDTuO24aeN0dGeM+TJzKHop9Tlz jJHfElh29TNLGv7A1AYjXHVixQhSaz7aiy3b1Jv+52Ggw6g/CeZ7wdMdAhJLBsRF8FfW 10Gd4XBlBMjXzq2r/yLUtaoptGoJ+DzFqWpmDGr2xRBHv0zPBssOC35ibyfqMvvTTQp0 GDqRkrvd6gLv06sXekQFhE5Jr4PCJJzUxlSZ5f3pGJ3JwuAmCUdanRWCtaraydD+x/PI P7aQ== 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 q1si5225505qta.21.2017.10.03.11.03.44; Tue, 03 Oct 2017 11:03:44 -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 1D77164459; Tue, 3 Oct 2017 18:03:44 +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, 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 2450C60C6C; Tue, 3 Oct 2017 18:02:04 +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 87AE060CA0; Tue, 3 Oct 2017 18:01:59 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id A81D4607B2 for ; Tue, 3 Oct 2017 18:01:52 +0000 (UTC) Received: from mxback8o.mail.yandex.net (mxback8o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::22]) by forward106j.mail.yandex.net (Yandex) with ESMTP id D81DF1804321 for ; Tue, 3 Oct 2017 21:01:50 +0300 (MSK) Received: from smtp2j.mail.yandex.net (smtp2j.mail.yandex.net [2a02:6b8:0:801::ac]) by mxback8o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id CEnLPrxOzX-1o8eE0ZN; Tue, 03 Oct 2017 21:01:50 +0300 Received: by smtp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id mHeFvvAoGz-1QMWfkGa; Tue, 03 Oct 2017 21:01:26 +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, 3 Oct 2017 21:00:05 +0300 Message-Id: <1507053605-3951-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507053605-3951-1-git-send-email-odpbot@yandex.ru> References: <1507053605-3951-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 205 Subject: [lng-odp] [PATCH v1 4/4] linux-gen: timer: drop odp prefix from odp_timer_s 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: Maxim Uvarov Signed-off-by: Maxim Uvarov --- /** Email created from pull request 205 (muvarov:master_timer_cleanup) ** https://github.com/Linaro/odp/pull/205 ** Patch: https://github.com/Linaro/odp/pull/205.patch ** Base sha: 052d2687930e5a99568e9349ca9704ae507e8dc5 ** Merge commit sha: 86cbffb9c3a034c900ff3e6f84ef68c62c9dfa29 **/ platform/linux-generic/odp_timer.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index fb3b34bb4..242bbad1c 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -116,15 +116,15 @@ ODP_ALIGNED(16) /* 16-byte atomic operations need properly aligned addresses */ ODP_STATIC_ASSERT(sizeof(tick_buf_t) == 16, "sizeof(tick_buf_t) == 16"); #endif -typedef struct odp_timer_s { +typedef struct _timer_s { void *user_ptr; odp_queue_t queue;/* Used for free list when timer is free */ -} odp_timer; +} _timer_t; -static void timer_init(odp_timer *tim, - tick_buf_t *tb, - odp_queue_t _q, - void *_up) +static void timer_init(_timer_t *tim, + tick_buf_t *tb, + odp_queue_t _q, + void *_up) { tim->queue = _q; tim->user_ptr = _up; @@ -140,7 +140,7 @@ static void timer_init(odp_timer *tim, } /* Teardown when timer is freed */ -static void timer_fini(odp_timer *tim, tick_buf_t *tb) +static void timer_fini(_timer_t *tim, tick_buf_t *tb) { ODP_ASSERT(tb->exp_tck.v == TMO_UNUSED); ODP_ASSERT(tb->tmo_buf == ODP_BUFFER_INVALID); @@ -148,13 +148,13 @@ static void timer_fini(odp_timer *tim, tick_buf_t *tb) tim->user_ptr = NULL; } -static inline uint32_t get_next_free(odp_timer *tim) +static inline uint32_t get_next_free(_timer_t *tim) { /* Reusing 'queue' for next free index */ return _odp_typeval(tim->queue); } -static inline void set_next_free(odp_timer *tim, uint32_t nf) +static inline void set_next_free(_timer_t *tim, uint32_t nf) { ODP_ASSERT(tim->queue == ODP_QUEUE_INVALID); /* Reusing 'queue' for next free index */ @@ -172,7 +172,7 @@ typedef struct _timer_pool_s { uint64_t min_rel_tck; uint64_t max_rel_tck; tick_buf_t *tick_buf; /* Expiration tick and timeout buffer */ - odp_timer *timers; /* User pointer and queue handle (and lock) */ + _timer_t *timers; /* User pointer and queue handle (and lock) */ odp_atomic_u32_t high_wm;/* High watermark of allocated timers */ odp_spinlock_t lock; uint32_t num_alloc;/* Current number of allocated timers */ @@ -237,7 +237,7 @@ static odp_timer_pool_t timer_pool_new(const char *name, } size_t sz0 = ROUNDUP_CACHE_LINE(sizeof(_timer_pool_t)); size_t sz1 = ROUNDUP_CACHE_LINE(sizeof(tick_buf_t) * param->num_timers); - size_t sz2 = ROUNDUP_CACHE_LINE(sizeof(odp_timer) * param->num_timers); + size_t sz2 = ROUNDUP_CACHE_LINE(sizeof(_timer_t) * param->num_timers); odp_shm_t shm = odp_shm_reserve(name, sz0 + sz1 + sz2, ODP_CACHE_LINE_SIZE, ODP_SHM_SW_ONLY); if (odp_unlikely(shm == ODP_SHM_INVALID)) @@ -337,7 +337,7 @@ static inline odp_timer_t timer_alloc(_timer_pool_t *tp, /* Remove first unused timer from free list */ ODP_ASSERT(tp->first_free != tp->param.num_timers); uint32_t idx = tp->first_free; - odp_timer *tim = &tp->timers[idx]; + _timer_t *tim = &tp->timers[idx]; tp->first_free = get_next_free(tim); /* Initialize timer */ timer_init(tim, &tp->tick_buf[idx], queue, user_ptr); @@ -363,7 +363,7 @@ static odp_buffer_t timer_cancel(_timer_pool_t *tp, static inline odp_buffer_t timer_free(_timer_pool_t *tp, uint32_t idx) { - odp_timer *tim = &tp->timers[idx]; + _timer_t *tim = &tp->timers[idx]; /* Free the timer by setting timer state to unused and * grab any timeout buffer */ @@ -563,7 +563,7 @@ static odp_buffer_t timer_cancel(_timer_pool_t *tp, static unsigned timer_expire(_timer_pool_t *tp, uint32_t idx, uint64_t tick) { - odp_timer *tim = &tp->timers[idx]; + _timer_t *tim = &tp->timers[idx]; tick_buf_t *tb = &tp->tick_buf[idx]; odp_buffer_t tmo_buf = ODP_BUFFER_INVALID; uint64_t exp_tck; @@ -691,7 +691,7 @@ static void timer_notify(_timer_pool_t *tp) } } - odp_timer *array = &tp->timers[0]; + _timer_t *array = &tp->timers[0]; uint32_t i; /* Prefetch initial cache lines (match 32 above) */ for (i = 0; i < 32; i += ODP_CACHE_LINE_SIZE / sizeof(array[0]))