diff mbox

[15/15] api: config: Renamed ODP_CONFIG_BUFFER_POOLS

Message ID 1421336423-19382-16-git-send-email-petri.savolainen@linaro.org
State Superseded
Headers show

Commit Message

Petri Savolainen Jan. 15, 2015, 3:40 p.m. UTC
Replaced ODP_CONFIG_BUFFER_POOLS with ODP_CONFIG_POOLS.

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
---
 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 mbox

Patch

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 f88cef7..af2edc5 100644
--- a/platform/linux-generic/odp_buffer_pool.c
+++ b/platform/linux-generic/odp_buffer_pool.c
@@ -24,8 +24,8 @@ 
 #include <stdlib.h>
 
 
-#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);
 	}