From patchwork Fri Jan 23 11:42:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 43625 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 6633C240D9 for ; Fri, 23 Jan 2015 11:44:21 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id gm9sf3971336lab.0 for ; Fri, 23 Jan 2015 03:44:20 -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=nFlxvPEMPkpZDFmNsd6RNuCXUJa6xzTioUhMds8tT+Emo2R3YBkqwQBpoYUnCcDV9P JgT8tHms67qvOz9IA/9uGIRTFHh9RCVaR7X0JYrwAdo+cqMkKn/EcjEP7mdlzl3YPiwD 7nW++FRlQqFUKq8ShjDOlT0cjHJOIp9ZUYx569N704BNeMltBTPJg+ZHX0zYOTcOo63s 7Wj6N2d3qVr5uGxfmPZd0//zqXD5zFJaCm5hY8cUUzsIUjteA2pmjAHpu/RumnaJjqeE t2CJx7fCo8x1Lx6zyX89+Ug5ZqmRXdkVoEOwq5hHjAzPtlgs9u2Cw6JNoRbvCKHRG0AG gSEw== X-Gm-Message-State: ALoCoQkVAicJI32nXasnZlfisK530tYrsyzrl+K+N/FZxiNFHoeBkm0wRucFJnXNeBDJ0PLShx6k X-Received: by 10.112.42.104 with SMTP id n8mr12527lbl.19.1422013460327; Fri, 23 Jan 2015 03:44:20 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.193 with SMTP id ao1ls168861lac.20.gmail; Fri, 23 Jan 2015 03:44:20 -0800 (PST) X-Received: by 10.152.234.140 with SMTP id ue12mr6652896lac.78.1422013460112; Fri, 23 Jan 2015 03:44:20 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id yh1si1102984lab.112.2015.01.23.03.44.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jan 2015 03:44:20 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id u10so6534304lbd.12 for ; Fri, 23 Jan 2015 03:44:20 -0800 (PST) X-Received: by 10.152.43.103 with SMTP id v7mr6830681lal.29.1422013459981; Fri, 23 Jan 2015 03:44:19 -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 c8csp221102lbb; Fri, 23 Jan 2015 03:44:19 -0800 (PST) X-Received: by 10.229.225.68 with SMTP id ir4mr13118170qcb.23.1422013458549; Fri, 23 Jan 2015 03:44:18 -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 a7si1704713qam.2.2015.01.23.03.44.17 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 23 Jan 2015 03:44:18 -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 1YEcet-0003Wq-Oq; Fri, 23 Jan 2015 11:44:15 +0000 Received: from mail-qg0-f46.google.com ([209.85.192.46]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YEce8-0003Oh-S0 for lng-odp@lists.linaro.org; Fri, 23 Jan 2015 11:43:28 +0000 Received: by mail-qg0-f46.google.com with SMTP id i50so5565681qgf.5 for ; Fri, 23 Jan 2015 03:43:23 -0800 (PST) X-Received: by 10.140.17.70 with SMTP id 64mr12187175qgc.53.1422013403672; Fri, 23 Jan 2015 03:43:23 -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 f7sm1182892qaq.42.2015.01.23.03.43.21 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 Jan 2015 03:43:22 -0800 (PST) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Fri, 23 Jan 2015 13:42:23 +0200 Message-Id: <1422013344-6655-16-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1422013344-6655-1-git-send-email-petri.savolainen@linaro.org> References: <1422013344-6655-1-git-send-email-petri.savolainen@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v4 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.181 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); }