aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2023-10-25 15:52:25 +0300
committerMatias Elo <matias.elo@nokia.com>2023-10-27 13:07:10 +0300
commite928570b1a567cf8137bd15b4f500151ea0e385a (patch)
tree31ea1c62c28494af1eadd98fdd26f37dae105baf
parent1478e86dd71a358fba1bf6c83f6a1c7f18e5c1f3 (diff)
linux-gen: config: remove ODP_ prefix from internal defines
Remove ODP_ prefix from implementation internal config defines to distinguish them from official APIs. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
-rw-r--r--doc/implementers-guide/implementers-guide.adoc2
-rw-r--r--platform/linux-generic/include/odp_config_internal.h8
-rw-r--r--platform/linux-generic/include/odp_event_internal.h2
-rw-r--r--platform/linux-generic/include/odp_packet_internal.h2
-rw-r--r--platform/linux-generic/include/odp_packet_io_internal.h6
-rw-r--r--platform/linux-generic/include/odp_pool_internal.h2
-rw-r--r--platform/linux-generic/odp_packet_io.c18
-rw-r--r--platform/linux-generic/odp_pcapng.c4
-rw-r--r--platform/linux-generic/odp_pool.c28
-rw-r--r--platform/linux-generic/odp_schedule_basic.c2
-rw-r--r--platform/linux-generic/odp_schedule_scalable.c4
-rw-r--r--platform/linux-generic/odp_schedule_sp.c2
-rw-r--r--platform/linux-generic/odp_system_info.c4
13 files changed, 42 insertions, 42 deletions
diff --git a/doc/implementers-guide/implementers-guide.adoc b/doc/implementers-guide/implementers-guide.adoc
index 568760e3a..7b234ecea 100644
--- a/doc/implementers-guide/implementers-guide.adoc
+++ b/doc/implementers-guide/implementers-guide.adoc
@@ -716,7 +716,7 @@ reference implementation in the file
/*
* Maximum number of pools
*/
-#define ODP_CONFIG_POOLS 64
+#define CONFIG_POOLS 64
-----
Here two fundamental limits, the number of CPUs supported and the maximum
diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h
index 279a43687..5a46bf8c8 100644
--- a/platform/linux-generic/include/odp_config_internal.h
+++ b/platform/linux-generic/include/odp_config_internal.h
@@ -22,7 +22,7 @@ extern "C" {
/*
* Maximum number of pools.
*/
-#define ODP_CONFIG_POOLS 32
+#define CONFIG_POOLS 32
/*
* Queues reserved for ODP internal use
@@ -71,7 +71,7 @@ extern "C" {
/*
* Maximum number of packet IO resources
*/
-#define ODP_CONFIG_PKTIO_ENTRIES 64
+#define CONFIG_PKTIO_ENTRIES 64
/*
* Maximum buffer alignment
@@ -79,7 +79,7 @@ extern "C" {
* This defines the maximum supported buffer alignment. Requests for values
* above this will fail.
*/
-#define ODP_CONFIG_BUFFER_ALIGN_MAX (4 * 1024)
+#define CONFIG_BUFFER_ALIGN_MAX (4 * 1024)
/*
* Default packet headroom
@@ -138,7 +138,7 @@ extern "C" {
* are reserved for per ODP module global data and one block per packet I/O is
* reserved for TX completion usage.
*/
-#define CONFIG_INTERNAL_SHM_BLOCKS ((ODP_CONFIG_POOLS * 3) + 20 + ODP_CONFIG_PKTIO_ENTRIES)
+#define CONFIG_INTERNAL_SHM_BLOCKS ((CONFIG_POOLS * 3) + 20 + CONFIG_PKTIO_ENTRIES)
/*
* Maximum number of shared memory blocks.
diff --git a/platform/linux-generic/include/odp_event_internal.h b/platform/linux-generic/include/odp_event_internal.h
index 4bc28d708..d9957e530 100644
--- a/platform/linux-generic/include/odp_event_internal.h
+++ b/platform/linux-generic/include/odp_event_internal.h
@@ -35,7 +35,7 @@ typedef union _odp_event_index_t {
} _odp_event_index_t;
/* Check that pool index fit into bit field */
-ODP_STATIC_ASSERT(ODP_CONFIG_POOLS <= (0xFF + 1), "TOO_MANY_POOLS");
+ODP_STATIC_ASSERT(CONFIG_POOLS <= (0xFF + 1), "TOO_MANY_POOLS");
/* Check that buffer index fit into bit field */
ODP_STATIC_ASSERT(CONFIG_POOL_MAX_NUM <= (0xFFFFFF + 1), "TOO_LARGE_POOL");
diff --git a/platform/linux-generic/include/odp_packet_internal.h b/platform/linux-generic/include/odp_packet_internal.h
index eef0239f2..41a44b83c 100644
--- a/platform/linux-generic/include/odp_packet_internal.h
+++ b/platform/linux-generic/include/odp_packet_internal.h
@@ -176,7 +176,7 @@ typedef struct ODP_ALIGNED_CACHE odp_packet_hdr_t {
* grow over 256 bytes. */
ODP_STATIC_ASSERT(sizeof(odp_packet_hdr_t) <= 256, "PACKET_HDR_SIZE_ERROR");
-ODP_STATIC_ASSERT(ODP_CONFIG_PKTIO_ENTRIES < UINT8_MAX, "MS_PKTIO_IDX_SIZE_ERROR");
+ODP_STATIC_ASSERT(CONFIG_PKTIO_ENTRIES < UINT8_MAX, "MS_PKTIO_IDX_SIZE_ERROR");
/**
* Return the packet header
diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h
index 5490c3d01..6c8a2305b 100644
--- a/platform/linux-generic/include/odp_packet_io_internal.h
+++ b/platform/linux-generic/include/odp_packet_io_internal.h
@@ -184,7 +184,7 @@ typedef struct {
uint32_t tx_compl_pool_size;
} config;
- pktio_entry_t entries[ODP_CONFIG_PKTIO_ENTRIES];
+ pktio_entry_t entries[CONFIG_PKTIO_ENTRIES];
lso_profile_t lso_profile[PKTIO_LSO_PROFILES];
int num_lso_profiles;
@@ -257,9 +257,9 @@ static inline pktio_entry_t *get_pktio_entry(odp_pktio_t pktio)
if (odp_unlikely(pktio == ODP_PKTIO_INVALID))
return NULL;
- if (odp_unlikely(_odp_typeval(pktio) > ODP_CONFIG_PKTIO_ENTRIES)) {
+ if (odp_unlikely(_odp_typeval(pktio) > CONFIG_PKTIO_ENTRIES)) {
_ODP_DBG("pktio limit %" PRIuPTR "/%d exceed\n",
- _odp_typeval(pktio), ODP_CONFIG_PKTIO_ENTRIES);
+ _odp_typeval(pktio), CONFIG_PKTIO_ENTRIES);
return NULL;
}
diff --git a/platform/linux-generic/include/odp_pool_internal.h b/platform/linux-generic/include/odp_pool_internal.h
index c8d2168f3..2c33bb4a2 100644
--- a/platform/linux-generic/include/odp_pool_internal.h
+++ b/platform/linux-generic/include/odp_pool_internal.h
@@ -116,7 +116,7 @@ typedef struct pool_t {
} pool_t;
typedef struct pool_global_t {
- pool_t pool[ODP_CONFIG_POOLS];
+ pool_t pool[CONFIG_POOLS];
odp_shm_t shm;
struct {
diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c
index 38c1c2b03..a328423ae 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -74,7 +74,7 @@ typedef struct {
static pktio_global_t *pktio_global;
/* pktio pointer entries ( for inlines) */
-void *_odp_pktio_entry_ptr[ODP_CONFIG_PKTIO_ENTRIES];
+void *_odp_pktio_entry_ptr[CONFIG_PKTIO_ENTRIES];
static inline pktio_entry_t *pktio_entry_by_index(int index)
{
@@ -145,7 +145,7 @@ int _odp_pktio_init_global(void)
return -1;
}
- for (i = 0; i < ODP_CONFIG_PKTIO_ENTRIES; ++i) {
+ for (i = 0; i < CONFIG_PKTIO_ENTRIES; ++i) {
pktio_entry = &pktio_global->entries[i];
pktio_entry->handle = _odp_cast_scalar(odp_pktio_t, i + 1);
@@ -311,7 +311,7 @@ static odp_pktio_t setup_pktio_entry(const char *name, odp_pool_t pool,
if_name = strip_pktio_type(name, pktio_type);
- for (i = 0; i < ODP_CONFIG_PKTIO_ENTRIES; ++i) {
+ for (i = 0; i < CONFIG_PKTIO_ENTRIES; ++i) {
pktio_entry = &pktio_global->entries[i];
if (is_free(pktio_entry)) {
lock_entry(pktio_entry);
@@ -322,7 +322,7 @@ static odp_pktio_t setup_pktio_entry(const char *name, odp_pool_t pool,
}
}
- if (i == ODP_CONFIG_PKTIO_ENTRIES) {
+ if (i == CONFIG_PKTIO_ENTRIES) {
_ODP_ERR("All pktios used already\n");
return ODP_PKTIO_INVALID;
}
@@ -809,7 +809,7 @@ odp_pktio_t odp_pktio_lookup(const char *name)
odp_spinlock_lock(&pktio_global->lock);
- for (i = 0; i < ODP_CONFIG_PKTIO_ENTRIES; ++i) {
+ for (i = 0; i < CONFIG_PKTIO_ENTRIES; ++i) {
entry = pktio_entry_by_index(i);
if (!entry || is_free(entry))
continue;
@@ -1509,7 +1509,7 @@ int _odp_pktio_term_global(void)
if (pktio_global == NULL)
return 0;
- for (i = 0; i < ODP_CONFIG_PKTIO_ENTRIES; ++i) {
+ for (i = 0; i < CONFIG_PKTIO_ENTRIES; ++i) {
pktio_entry_t *pktio_entry;
pktio_entry = &pktio_global->entries[i];
@@ -1626,12 +1626,12 @@ int odp_pktio_capability(odp_pktio_t pktio, odp_pktio_capability_t *capa)
return 0;
}
-ODP_STATIC_ASSERT(ODP_CONFIG_PKTIO_ENTRIES - 1 <= ODP_PKTIO_MAX_INDEX,
- "ODP_CONFIG_PKTIO_ENTRIES larger than ODP_PKTIO_MAX_INDEX");
+ODP_STATIC_ASSERT(CONFIG_PKTIO_ENTRIES - 1 <= ODP_PKTIO_MAX_INDEX,
+ "CONFIG_PKTIO_ENTRIES larger than ODP_PKTIO_MAX_INDEX");
unsigned int odp_pktio_max_index(void)
{
- return ODP_CONFIG_PKTIO_ENTRIES - 1;
+ return CONFIG_PKTIO_ENTRIES - 1;
}
int odp_pktio_stats(odp_pktio_t pktio,
diff --git a/platform/linux-generic/odp_pcapng.c b/platform/linux-generic/odp_pcapng.c
index 4423b0483..7f11f4340 100644
--- a/platform/linux-generic/odp_pcapng.c
+++ b/platform/linux-generic/odp_pcapng.c
@@ -99,7 +99,7 @@ typedef struct ODP_ALIGNED_CACHE {
int inotify_watch_fd;
int inotify_is_running;
odp_spinlock_t lock;
- pcapng_entry_t entry[ODP_CONFIG_PKTIO_ENTRIES];
+ pcapng_entry_t entry[CONFIG_PKTIO_ENTRIES];
} pcapng_global_t;
static pcapng_global_t *pcapng_gbl;
@@ -230,7 +230,7 @@ static pktio_entry_t *pktio_from_event(struct inotify_event *event)
odp_spinlock_lock(&pcapng_gbl->lock);
- for (i = 0; i < ODP_CONFIG_PKTIO_ENTRIES; i++) {
+ for (i = 0; i < CONFIG_PKTIO_ENTRIES; i++) {
pktio_entry_t *entry = pcapng_gbl->entry[i].pktio_entry;
if (entry == NULL)
diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c
index b3b6f9c40..6d464cd37 100644
--- a/platform/linux-generic/odp_pool.c
+++ b/platform/linux-generic/odp_pool.c
@@ -63,7 +63,7 @@ ODP_STATIC_ASSERT(CONFIG_PACKET_SEG_SIZE < 0xffff,
/* Thread local variables */
typedef struct pool_local_t {
- pool_cache_t *cache[ODP_CONFIG_POOLS];
+ pool_cache_t *cache[CONFIG_POOLS];
int thr_id;
} pool_local_t;
@@ -328,7 +328,7 @@ int _odp_pool_init_global(void)
return -1;
}
- for (i = 0; i < ODP_CONFIG_POOLS; i++) {
+ for (i = 0; i < CONFIG_POOLS; i++) {
pool_t *pool = _odp_pool_entry_from_idx(i);
LOCK_INIT(&pool->lock);
@@ -357,7 +357,7 @@ int _odp_pool_term_global(void)
if (_odp_pool_glb == NULL)
return 0;
- for (i = 0; i < ODP_CONFIG_POOLS; i++) {
+ for (i = 0; i < CONFIG_POOLS; i++) {
pool = _odp_pool_entry_from_idx(i);
LOCK(&pool->lock);
@@ -385,7 +385,7 @@ int _odp_pool_init_local(void)
memset(&local, 0, sizeof(pool_local_t));
- for (i = 0; i < ODP_CONFIG_POOLS; i++) {
+ for (i = 0; i < CONFIG_POOLS; i++) {
pool = _odp_pool_entry_from_idx(i);
local.cache[i] = &pool->local_cache[thr_id];
cache_init(local.cache[i]);
@@ -399,7 +399,7 @@ int _odp_pool_term_local(void)
{
int i;
- for (i = 0; i < ODP_CONFIG_POOLS; i++) {
+ for (i = 0; i < CONFIG_POOLS; i++) {
pool_t *pool = _odp_pool_entry_from_idx(i);
cache_flush(local.cache[i], pool);
@@ -416,7 +416,7 @@ static pool_t *reserve_pool(uint32_t shmflags, uint8_t pool_ext, uint32_t num)
pool_t *pool;
char ring_name[ODP_POOL_NAME_LEN];
- for (i = 0; i < ODP_CONFIG_POOLS; i++) {
+ for (i = 0; i < CONFIG_POOLS; i++) {
pool = _odp_pool_entry_from_idx(i);
LOCK(&pool->lock);
@@ -756,7 +756,7 @@ odp_pool_t _odp_pool_create(const char *name, const odp_pool_param_t *params,
}
/* Validate requested buffer alignment */
- if (align > ODP_CONFIG_BUFFER_ALIGN_MAX ||
+ if (align > CONFIG_BUFFER_ALIGN_MAX ||
align != _ODP_ROUNDDOWN_POWER2(align, align)) {
_ODP_ERR("Bad align requirement\n");
return ODP_POOL_INVALID;
@@ -1205,7 +1205,7 @@ odp_pool_t odp_pool_lookup(const char *name)
uint32_t i;
pool_t *pool;
- for (i = 0; i < ODP_CONFIG_POOLS; i++) {
+ for (i = 0; i < CONFIG_POOLS; i++) {
pool = _odp_pool_entry_from_idx(i);
LOCK(&pool->lock);
@@ -1464,7 +1464,7 @@ int odp_pool_capability(odp_pool_capability_t *capa)
odp_pool_stats_opt_t supported_stats;
uint32_t max_seg_len = CONFIG_PACKET_MAX_SEG_LEN;
/* Reserve one for internal usage */
- int max_pools = ODP_CONFIG_POOLS - 1;
+ int max_pools = CONFIG_POOLS - 1;
memset(capa, 0, sizeof(odp_pool_capability_t));
@@ -1483,7 +1483,7 @@ int odp_pool_capability(odp_pool_capability_t *capa)
/* Buffer pools */
capa->buf.max_pools = max_pools;
- capa->buf.max_align = ODP_CONFIG_BUFFER_ALIGN_MAX;
+ capa->buf.max_align = CONFIG_BUFFER_ALIGN_MAX;
capa->buf.max_size = MAX_SIZE;
capa->buf.max_num = CONFIG_POOL_MAX_NUM;
capa->buf.max_uarea_size = MAX_UAREA_SIZE;
@@ -1614,7 +1614,7 @@ void odp_pool_print_all(void)
_ODP_PRINT("-----------------\n");
_ODP_PRINT(" idx %-*s type free tot cache buf_len ext\n", col_width, "name");
- for (i = 0; i < ODP_CONFIG_POOLS; i++) {
+ for (i = 0; i < CONFIG_POOLS; i++) {
pool_t *pool = _odp_pool_entry_from_idx(i);
LOCK(&pool->lock);
@@ -1666,7 +1666,7 @@ uint64_t odp_pool_to_u64(odp_pool_t hdl)
unsigned int odp_pool_max_index(void)
{
- return ODP_CONFIG_POOLS - 1;
+ return CONFIG_POOLS - 1;
}
int odp_pool_stats(odp_pool_t pool_hdl, odp_pool_stats_t *stats)
@@ -1800,7 +1800,7 @@ static pool_t *find_pool(_odp_event_hdr_t *event_hdr)
int i;
uint8_t *ptr = (uint8_t *)event_hdr;
- for (i = 0; i < ODP_CONFIG_POOLS; i++) {
+ for (i = 0; i < CONFIG_POOLS; i++) {
pool_t *pool = _odp_pool_entry_from_idx(i);
if (pool->reserved == 0)
@@ -1877,7 +1877,7 @@ int odp_pool_ext_capability(odp_pool_type_t type, odp_pool_ext_capability_t *cap
memset(capa, 0, sizeof(odp_pool_ext_capability_t));
capa->type = type;
- capa->max_pools = ODP_CONFIG_POOLS - 1;
+ capa->max_pools = CONFIG_POOLS - 1;
capa->min_cache_size = 0;
capa->max_cache_size = CONFIG_POOL_CACHE_MAX_SIZE;
capa->stats.all = supported_stats.all;
diff --git a/platform/linux-generic/odp_schedule_basic.c b/platform/linux-generic/odp_schedule_basic.c
index d289f1e21..05eb6aa9f 100644
--- a/platform/linux-generic/odp_schedule_basic.c
+++ b/platform/linux-generic/odp_schedule_basic.c
@@ -96,7 +96,7 @@ ODP_STATIC_ASSERT((QUEUE_LOAD * CONFIG_MAX_SCHED_QUEUES) < UINT32_MAX, "Load_val
#define RANDOM_TBL_SIZE 128
/* Maximum number of packet IO interfaces */
-#define NUM_PKTIO ODP_CONFIG_PKTIO_ENTRIES
+#define NUM_PKTIO CONFIG_PKTIO_ENTRIES
/* Maximum pktin index. Needs to fit into 8 bits. */
#define MAX_PKTIN_INDEX 255
diff --git a/platform/linux-generic/odp_schedule_scalable.c b/platform/linux-generic/odp_schedule_scalable.c
index 28245f66b..bb1549e9b 100644
--- a/platform/linux-generic/odp_schedule_scalable.c
+++ b/platform/linux-generic/odp_schedule_scalable.c
@@ -67,7 +67,7 @@ typedef struct {
odp_spinlock_t init_lock;
/** Per thread state */
sched_scalable_thread_state_t thread_state[MAXTHREADS];
- uint16_t poll_count[ODP_CONFIG_PKTIO_ENTRIES];
+ uint16_t poll_count[CONFIG_PKTIO_ENTRIES];
/* Scheduler interface config options (not used in fast path) */
schedule_config_t config_if;
} sched_global_t;
@@ -713,7 +713,7 @@ static void pktio_start(int pktio_idx,
queue_entry_t *qentry;
sched_elem_t *elem;
- _ODP_ASSERT(pktio_idx < ODP_CONFIG_PKTIO_ENTRIES);
+ _ODP_ASSERT(pktio_idx < CONFIG_PKTIO_ENTRIES);
for (i = 0; i < num_in_queue; i++) {
rxq = in_queue_idx[i];
_ODP_ASSERT(rxq < ODP_PKTIN_MAX_QUEUES);
diff --git a/platform/linux-generic/odp_schedule_sp.c b/platform/linux-generic/odp_schedule_sp.c
index c4d18e66e..a42955ee9 100644
--- a/platform/linux-generic/odp_schedule_sp.c
+++ b/platform/linux-generic/odp_schedule_sp.c
@@ -38,7 +38,7 @@
#define NUM_THREAD ODP_THREAD_COUNT_MAX
#define NUM_QUEUE CONFIG_MAX_SCHED_QUEUES
-#define NUM_PKTIO ODP_CONFIG_PKTIO_ENTRIES
+#define NUM_PKTIO CONFIG_PKTIO_ENTRIES
#define NUM_ORDERED_LOCKS 1
#define NUM_STATIC_GROUP 3
#define NUM_GROUP (NUM_STATIC_GROUP + 9)
diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c
index bb0eaa9b1..f95690410 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -599,11 +599,11 @@ void odp_sys_config_print(void)
_ODP_PRINT("\n\nodp_config_internal.h values:\n"
"-----------------------------\n");
- _ODP_PRINT("ODP_CONFIG_POOLS: %i\n", ODP_CONFIG_POOLS);
+ _ODP_PRINT("CONFIG_POOLS: %i\n", CONFIG_POOLS);
_ODP_PRINT("CONFIG_MAX_PLAIN_QUEUES: %i\n", CONFIG_MAX_PLAIN_QUEUES);
_ODP_PRINT("CONFIG_MAX_SCHED_QUEUES: %i\n", CONFIG_MAX_SCHED_QUEUES);
_ODP_PRINT("CONFIG_QUEUE_MAX_ORD_LOCKS: %i\n", CONFIG_QUEUE_MAX_ORD_LOCKS);
- _ODP_PRINT("ODP_CONFIG_PKTIO_ENTRIES: %i\n", ODP_CONFIG_PKTIO_ENTRIES);
+ _ODP_PRINT("CONFIG_PKTIO_ENTRIES: %i\n", CONFIG_PKTIO_ENTRIES);
_ODP_PRINT("CONFIG_PACKET_HEADROOM: %i\n", CONFIG_PACKET_HEADROOM);
_ODP_PRINT("CONFIG_PACKET_TAILROOM: %i\n", CONFIG_PACKET_TAILROOM);
_ODP_PRINT("CONFIG_SHM_BLOCKS: %i\n", CONFIG_SHM_BLOCKS);