From patchwork Wed Jan 21 04:57:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 43434 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f198.google.com (mail-we0-f198.google.com [74.125.82.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4A4AE2034D for ; Wed, 21 Jan 2015 04:58:27 +0000 (UTC) Received: by mail-we0-f198.google.com with SMTP id q59sf770306wes.1 for ; Tue, 20 Jan 2015 20:58:26 -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=74/yt0VoltKUCNYatsMcojUy86ljQw+XpDpDJ7BtT+8=; b=fJVh5Jx2NCNl2h2wyXrUd6G5CtqB/MF/meCQtie4wTkmd6qunGdblVf+WaIDbb5NbP 8lKAPmHjd7oi+UkjbTIHdLCAy2dkxKCWh+R0F0Fe2h44qi/cVzu1IKSyH0inQBPQ/P9r mN8uYqbmNbstRg0kJr5ehkHjr4M59wyJ60OOsueQqG0LLiRdofI791MLfkAQ8OJ8m9KP b62DJBKVYuz30obW9cnWfCmFoFCdGXod9cymF6yMpGvAGPWcYwcunrX5aOErA3Iq7DfC sF5WlE4XsIW0Q62y4eLQAuyyzbvlb2MoenIFAw1xZS45Pu3D8FzTkJpaklH2yGV1srJL l92g== X-Gm-Message-State: ALoCoQlmNmJclIgcjTueJs+HUywrTJQckuhOLQ0SmKOzm2gEDzbyqg0Ia4NnZ/K3eRfyUOO8SyoU X-Received: by 10.194.86.1 with SMTP id l1mr3432734wjz.0.1421816306618; Tue, 20 Jan 2015 20:58:26 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.74 with SMTP id q10ls802771laq.43.gmail; Tue, 20 Jan 2015 20:58:26 -0800 (PST) X-Received: by 10.112.132.2 with SMTP id oq2mr42226156lbb.11.1421816306175; Tue, 20 Jan 2015 20:58:26 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id t1si6638472laz.36.2015.01.20.20.58.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 Jan 2015 20:58:26 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id gf13so38104325lab.7 for ; Tue, 20 Jan 2015 20:58:26 -0800 (PST) X-Received: by 10.112.90.170 with SMTP id bx10mr42074444lbb.69.1421816306098; Tue, 20 Jan 2015 20:58:26 -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 c8csp1651568lbb; Tue, 20 Jan 2015 20:58:25 -0800 (PST) X-Received: by 10.140.90.112 with SMTP id w103mr49593487qgd.65.1421816304685; Tue, 20 Jan 2015 20:58:24 -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 q13si3095744qay.125.2015.01.20.20.58.23 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 20 Jan 2015 20:58:24 -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 1YDnMz-0002LY-PL; Wed, 21 Jan 2015 04:58:21 +0000 Received: from mail-oi0-f47.google.com ([209.85.218.47]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YDnMk-0002Cg-Eq for lng-odp@lists.linaro.org; Wed, 21 Jan 2015 04:58:06 +0000 Received: by mail-oi0-f47.google.com with SMTP id a141so10090138oig.6 for ; Tue, 20 Jan 2015 20:58:01 -0800 (PST) X-Received: by 10.202.97.9 with SMTP id v9mr22542691oib.34.1421816281222; Tue, 20 Jan 2015 20:58:01 -0800 (PST) Received: from localhost.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by mx.google.com with ESMTPSA id a15sm2891071oic.18.2015.01.20.20.58.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jan 2015 20:58:00 -0800 (PST) From: Bill Fischofer To: lng-odp@lists.linaro.org Date: Tue, 20 Jan 2015 22:57:42 -0600 Message-Id: <1421816266-31223-5-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1421816266-31223-1-git-send-email-bill.fischofer@linaro.org> References: <1421816266-31223-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 4/8] api: pool: Rename ODP_CONFIG_BUFFER_POOLS to ODP_CONFIG_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: bill.fischofer@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.215.48 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 Signed-off-by: Bill Fischofer --- 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 | 4 ++-- platform/linux-generic/odp_buffer_pool.c | 18 +++++++++--------- 4 files changed, 15 insertions(+), 15 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 ee264a6..c120b69 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 43d8619..4a3c7f2 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) @@ -121,7 +121,7 @@ typedef struct odp_buffer_hdr_t { int type; /* buffer type */ uint32_t size; /* max data size */ odp_atomic_u32_t ref_count; /* reference count */ - odp_buffer_pool_t pool_hdl; /* buffer pool handle */ + odp_pool_t pool_hdl; /* buffer pool handle */ union { uint64_t buf_u64; /* user u64 */ void *buf_ctx; /* user context */ diff --git a/platform/linux-generic/odp_buffer_pool.c b/platform/linux-generic/odp_buffer_pool.c index eedb380..caadc7f 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); @@ -189,7 +189,7 @@ odp_buffer_pool_t odp_buffer_pool_create(const char *name, return ODP_BUFFER_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); @@ -381,7 +381,7 @@ odp_buffer_pool_t odp_buffer_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); @@ -527,7 +527,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); }