From patchwork Tue Jan 20 11:18:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 43359 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 791BE2034D for ; Tue, 20 Jan 2015 11:20:30 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id fb4sf4829051wid.3 for ; Tue, 20 Jan 2015 03:20:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=np/v2L3Phj3gpJ+AtCus2ybZiU0Aoz8XBuzGUxhPmnQ=; b=WY4ugT6zcj88LSi1jbVDdTbdM2bkpPR2U3AIuOZBxCYSGJ7E5tlZypr93EHZYKggMK I5I1Rtqbax8pGBykxyGwGvr9V/L3imb1ZyPrnJhjaH2mGmhdWehFL2H7Xkbh3lXeTAVQ AiKE4MN8YvrNDNQ6wH58HaL5lx4q6wjSQT9IdUlfEsTbHpWnQKEb3RXqIIhGWcgIWyaX MeiC44wX5jyBmLzPR/ARNO0Br0nVHnb5SyGCKwF7L3NzbtDwphRnRonYlj3ADfZpWyKn iEhQVeSvNY4zwboXZ++24gstOysyJ7JlbFeKY+8RBZSwYE3UokZVOrhN5cm4csQfhGNm MbcA== X-Gm-Message-State: ALoCoQlAAIQS5QdZfdlmmwPhBNG47hI4GnCs5G7FCEXVd5AkiAG6DXzMb1Hg3bQNoHNKIonMjwZk X-Received: by 10.194.178.234 with SMTP id db10mr4267902wjc.2.1421752829788; Tue, 20 Jan 2015 03:20:29 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.130 with SMTP id b2ls590797laa.27.gmail; Tue, 20 Jan 2015 03:20:29 -0800 (PST) X-Received: by 10.112.156.169 with SMTP id wf9mr37283354lbb.85.1421752829631; Tue, 20 Jan 2015 03:20:29 -0800 (PST) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id wz2si4237901lbb.65.2015.01.20.03.20.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 Jan 2015 03:20:29 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id p9so9615776lbv.4 for ; Tue, 20 Jan 2015 03:20:29 -0800 (PST) X-Received: by 10.112.125.41 with SMTP id mn9mr37145824lbb.80.1421752829546; Tue, 20 Jan 2015 03:20:29 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp1381032lbb; Tue, 20 Jan 2015 03:20:28 -0800 (PST) X-Received: by 10.229.59.69 with SMTP id k5mr56939719qch.14.1421752828047; Tue, 20 Jan 2015 03:20:28 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id e9si21632940qgf.109.2015.01.20.03.20.26 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 20 Jan 2015 03:20:28 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YDWrA-0006SZ-Te; Tue, 20 Jan 2015 11:20:24 +0000 Received: from mail-qa0-f47.google.com ([209.85.216.47]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YDWqP-0006Gk-4N for lng-odp@lists.linaro.org; Tue, 20 Jan 2015 11:19:37 +0000 Received: by mail-qa0-f47.google.com with SMTP id n8so27744490qaq.6 for ; Tue, 20 Jan 2015 03:19:32 -0800 (PST) X-Received: by 10.224.161.81 with SMTP id q17mr55645986qax.34.1421752771962; Tue, 20 Jan 2015 03:19:31 -0800 (PST) Received: from mcpro03.emea.nsn-net.net (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id t2sm14975907qae.6.2015.01.20.03.19.30 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 Jan 2015 03:19:31 -0800 (PST) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Tue, 20 Jan 2015 13:18:11 +0200 Message-Id: <1421752692-24439-16-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1421752692-24439-1-git-send-email-petri.savolainen@linaro.org> References: <1421752692-24439-1-git-send-email-petri.savolainen@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v2 15/16] api: config: Renamed ODP_CONFIG_BUFFER_POOLS X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: petri.savolainen@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Replaced ODP_CONFIG_BUFFER_POOLS with ODP_CONFIG_POOLS. Signed-off-by: Petri Savolainen --- platform/linux-generic/include/api/odp_config.h | 4 ++-- platform/linux-generic/include/odp_buffer_inlines.h | 4 ++-- platform/linux-generic/include/odp_buffer_internal.h | 2 +- platform/linux-generic/odp_buffer_pool.c | 18 +++++++++--------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/platform/linux-generic/include/api/odp_config.h b/platform/linux-generic/include/api/odp_config.h index 542a719..3529fca 100644 --- a/platform/linux-generic/include/api/odp_config.h +++ b/platform/linux-generic/include/api/odp_config.h @@ -29,9 +29,9 @@ extern "C" { #define ODP_CONFIG_MAX_THREADS 128 /** - * Maximum number of buffer pools + * Maximum number of pools */ -#define ODP_CONFIG_BUFFER_POOLS 16 +#define ODP_CONFIG_POOLS 16 /** * Maximum number of queues diff --git a/platform/linux-generic/include/odp_buffer_inlines.h b/platform/linux-generic/include/odp_buffer_inlines.h index 000e673..6a30a07 100644 --- a/platform/linux-generic/include/odp_buffer_inlines.h +++ b/platform/linux-generic/include/odp_buffer_inlines.h @@ -51,7 +51,7 @@ static inline odp_buffer_hdr_t *odp_buf_to_hdr(odp_buffer_t buf) index = handle.index; #ifdef POOL_ERROR_CHECK - if (odp_unlikely(pool_id > ODP_CONFIG_BUFFER_POOLS)) { + if (odp_unlikely(pool_id > ODP_CONFIG_POOLS)) { ODP_ERR("odp_buf_to_hdr: Bad pool id\n"); return NULL; } @@ -103,7 +103,7 @@ static inline odp_buffer_hdr_t *validate_buf(odp_buffer_t buf) handle.u32 = buf; /* For buffer handles, segment index must be 0 and pool id in range */ - if (handle.seg != 0 || handle.pool_id >= ODP_CONFIG_BUFFER_POOLS) + if (handle.seg != 0 || handle.pool_id >= ODP_CONFIG_POOLS) return NULL; pool_entry_t *pool = odp_pool_to_entry(handle.pool_id); diff --git a/platform/linux-generic/include/odp_buffer_internal.h b/platform/linux-generic/include/odp_buffer_internal.h index e32bce0..5a42653 100644 --- a/platform/linux-generic/include/odp_buffer_internal.h +++ b/platform/linux-generic/include/odp_buffer_internal.h @@ -66,7 +66,7 @@ _ODP_STATIC_ASSERT((ODP_CONFIG_PACKET_BUF_LEN_MAX % /* We can optimize storage of small raw buffers within metadata area */ #define ODP_MAX_INLINE_BUF ((sizeof(void *)) * (ODP_BUFFER_MAX_SEG - 1)) -#define ODP_BUFFER_POOL_BITS ODP_BITSIZE(ODP_CONFIG_BUFFER_POOLS) +#define ODP_BUFFER_POOL_BITS ODP_BITSIZE(ODP_CONFIG_POOLS) #define ODP_BUFFER_SEG_BITS ODP_BITSIZE(ODP_BUFFER_MAX_SEG) #define ODP_BUFFER_INDEX_BITS (32 - ODP_BUFFER_POOL_BITS - ODP_BUFFER_SEG_BITS) #define ODP_BUFFER_PREFIX_BITS (ODP_BUFFER_POOL_BITS + ODP_BUFFER_INDEX_BITS) diff --git a/platform/linux-generic/odp_buffer_pool.c b/platform/linux-generic/odp_buffer_pool.c index 35101c7..dcb1e5e 100644 --- a/platform/linux-generic/odp_buffer_pool.c +++ b/platform/linux-generic/odp_buffer_pool.c @@ -24,8 +24,8 @@ #include -#if ODP_CONFIG_BUFFER_POOLS > ODP_BUFFER_MAX_POOLS -#error ODP_CONFIG_BUFFER_POOLS > ODP_BUFFER_MAX_POOLS +#if ODP_CONFIG_POOLS > ODP_BUFFER_MAX_POOLS +#error ODP_CONFIG_POOLS > ODP_BUFFER_MAX_POOLS #endif @@ -49,7 +49,7 @@ typedef struct odp_any_hdr_stride { typedef struct pool_table_t { - pool_entry_t pool[ODP_CONFIG_BUFFER_POOLS]; + pool_entry_t pool[ODP_CONFIG_POOLS]; } pool_table_t; @@ -57,10 +57,10 @@ typedef struct pool_table_t { static pool_table_t *pool_tbl; /* Pool entry pointers (for inlining) */ -void *pool_entry_ptr[ODP_CONFIG_BUFFER_POOLS]; +void *pool_entry_ptr[ODP_CONFIG_POOLS]; /* Local cache for buffer alloc/free acceleration */ -static __thread local_cache_t local_cache[ODP_CONFIG_BUFFER_POOLS]; +static __thread local_cache_t local_cache[ODP_CONFIG_POOLS]; int odp_buffer_pool_init_global(void) { @@ -78,7 +78,7 @@ int odp_buffer_pool_init_global(void) memset(pool_tbl, 0, sizeof(pool_table_t)); - for (i = 0; i < ODP_CONFIG_BUFFER_POOLS; i++) { + for (i = 0; i < ODP_CONFIG_POOLS; i++) { /* init locks */ pool_entry_t *pool = &pool_tbl->pool[i]; POOL_LOCK_INIT(&pool->s.lock); @@ -188,7 +188,7 @@ odp_pool_t odp_pool_create(const char *name, return ODP_POOL_INVALID; /* Find an unused buffer pool slot and iniitalize it as requested */ - for (i = 0; i < ODP_CONFIG_BUFFER_POOLS; i++) { + for (i = 0; i < ODP_CONFIG_POOLS; i++) { pool = get_pool_entry(i); POOL_LOCK(&pool->s.lock); @@ -380,7 +380,7 @@ odp_pool_t odp_pool_lookup(const char *name) uint32_t i; pool_entry_t *pool; - for (i = 0; i < ODP_CONFIG_BUFFER_POOLS; i++) { + for (i = 0; i < ODP_CONFIG_POOLS; i++) { pool = get_pool_entry(i); POOL_LOCK(&pool->s.lock); @@ -525,7 +525,7 @@ void _odp_flush_caches(void) { int i; - for (i = 0; i < ODP_CONFIG_BUFFER_POOLS; i++) { + for (i = 0; i < ODP_CONFIG_POOLS; i++) { pool_entry_t *pool = get_pool_entry(i); flush_cache(&local_cache[i], &pool->s); }