diff mbox

[PATCHv2,4/8] api: pool: Rename ODP_CONFIG_BUFFER_POOLS to ODP_CONFIG_POOLS

Message ID 1421816266-31223-5-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer Jan. 21, 2015, 4:57 a.m. UTC
Signed-off-by: Bill Fischofer <bill.fischofer@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 |  4 ++--
 platform/linux-generic/odp_buffer_pool.c             | 18 +++++++++---------
 4 files changed, 15 insertions(+), 15 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 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 <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);
@@ -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);
 	}