From patchwork Wed Jan 21 15:15:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 43458 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ABEF1218DB for ; Wed, 21 Jan 2015 15:18:52 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id gf13sf11203138lab.0 for ; Wed, 21 Jan 2015 07:18:51 -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=kcZGqwPEpof2hCz09vHBDr1CLtK0Zb3S5gWqzobLLqAB6ygR5e7/L3JAMBVXK3DgBb AH+gTBJbgg8C7edbVWeIpTekPtObWa3SuK1hDlp4ro17iOT6HpapaokCYD9aw5jdzzBE r+QlLKo289sXmU1fJ6ALM/tINJdhGjgazi8Qfx0/MYa/ndG9plEPrnIpl4+IA3u0TY8k diUKx2MG+pWLzoI4rJlw1JD4pduicExhtIuBwQZREXIRxuzovnUUJgAVqN6RP5lB9LpK ucndiclbBMMUwG2rKWXoxsgRsJTR8STpGiWGZqHGdJRVupH0t2LQB0jauIPlipGZ16Rt Yv8g== X-Gm-Message-State: ALoCoQlONLxpklTacgCjnXgSA2Cip833grwvgXAngWxvFNz2xdb9XrBqrZEJ2AC55ukxWVpbLom2 X-Received: by 10.152.37.130 with SMTP id y2mr327559laj.8.1421853531550; Wed, 21 Jan 2015 07:18:51 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.2.137 with SMTP id 9ls45261lau.26.gmail; Wed, 21 Jan 2015 07:18:51 -0800 (PST) X-Received: by 10.112.150.194 with SMTP id uk2mr45026724lbb.84.1421853531413; Wed, 21 Jan 2015 07:18:51 -0800 (PST) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id wr2si14153690lbc.6.2015.01.21.07.18.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Jan 2015 07:18:51 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id u14so3322142lbd.2 for ; Wed, 21 Jan 2015 07:18:51 -0800 (PST) X-Received: by 10.152.7.229 with SMTP id m5mr15574180laa.80.1421853531262; Wed, 21 Jan 2015 07:18:51 -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 c8csp1810614lbb; Wed, 21 Jan 2015 07:18:50 -0800 (PST) X-Received: by 10.140.22.233 with SMTP id 96mr64032963qgn.86.1421853529459; Wed, 21 Jan 2015 07:18:49 -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 k4si4912002qaz.40.2015.01.21.07.18.48 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 21 Jan 2015 07:18:49 -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 1YDx3N-0008CR-Eu; Wed, 21 Jan 2015 15:18:45 +0000 Received: from mail-qc0-f170.google.com ([209.85.216.170]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YDx2I-0007zh-CD for lng-odp@lists.linaro.org; Wed, 21 Jan 2015 15:17:38 +0000 Received: by mail-qc0-f170.google.com with SMTP id p6so11355523qcv.1 for ; Wed, 21 Jan 2015 07:17:33 -0800 (PST) X-Received: by 10.140.81.208 with SMTP id f74mr19127349qgd.94.1421853453187; Wed, 21 Jan 2015 07:17:33 -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 91sm415056qgf.1.2015.01.21.07.17.31 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Jan 2015 07:17:32 -0800 (PST) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Wed, 21 Jan 2015 17:15:42 +0200 Message-Id: <1421853343-22138-16-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1421853343-22138-1-git-send-email-petri.savolainen@linaro.org> References: <1421853343-22138-1-git-send-email-petri.savolainen@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v3 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.171 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); }