[dpdk-dev,3/3] Add RTE_ prefix to CACHE_LINE_ROUNDUP macro
Commit Message
Adding RTE_ for consistency with other renamed macros and to avoid
potential conflicts.
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
app/test-pmd/testpmd.c | 2 +-
lib/librte_eal/common/include/rte_memory.h | 2 +-
lib/librte_malloc/malloc_heap.c | 4 ++--
lib/librte_malloc/rte_malloc.c | 2 +-
lib/librte_sched/rte_sched.c | 14 +++++++-------
lib/librte_table/rte_table_acl.c | 6 +++---
lib/librte_table/rte_table_hash_ext.c | 14 +++++++-------
lib/librte_table/rte_table_hash_lru.c | 10 +++++-----
8 files changed, 27 insertions(+), 27 deletions(-)
@@ -444,7 +444,7 @@ mbuf_pool_create(uint16_t mbuf_seg_size, unsigned nb_mbuf,
mbp_ctor_arg.seg_buf_size = (uint16_t) (RTE_PKTMBUF_HEADROOM +
mbuf_seg_size);
mb_ctor_arg.seg_buf_offset =
- (uint16_t) CACHE_LINE_ROUNDUP(sizeof(struct rte_mbuf));
+ (uint16_t) RTE_CACHE_LINE_ROUNDUP(sizeof(struct rte_mbuf));
mb_ctor_arg.seg_buf_size = mbp_ctor_arg.seg_buf_size;
mb_size = mb_ctor_arg.seg_buf_offset + mb_ctor_arg.seg_buf_size;
mbuf_poolname_build(socket_id, pool_name, sizeof(pool_name));
@@ -64,7 +64,7 @@ enum rte_page_sizes {
#endif
#define RTE_CACHE_LINE_MASK (RTE_CACHE_LINE_SIZE-1) /**< Cache line mask. */
-#define CACHE_LINE_ROUNDUP(size) \
+#define RTE_CACHE_LINE_ROUNDUP(size) \
(RTE_CACHE_LINE_SIZE * ((size + RTE_CACHE_LINE_SIZE - 1) / RTE_CACHE_LINE_SIZE))
/**< Return the first cache-aligned value greater or equal to size. */
@@ -155,8 +155,8 @@ void *
malloc_heap_alloc(struct malloc_heap *heap,
const char *type __attribute__((unused)), size_t size, unsigned align)
{
- size = CACHE_LINE_ROUNDUP(size);
- align = CACHE_LINE_ROUNDUP(align);
+ size = RTE_CACHE_LINE_ROUNDUP(size);
+ align = RTE_CACHE_LINE_ROUNDUP(align);
rte_spinlock_lock(&heap->lock);
struct malloc_elem *elem = find_suitable_element(heap, size, align);
if (elem == NULL){
@@ -169,7 +169,7 @@ rte_realloc(void *ptr, size_t size, unsigned align)
if (elem == NULL)
rte_panic("Fatal error: memory corruption detected\n");
- size = CACHE_LINE_ROUNDUP(size), align = CACHE_LINE_ROUNDUP(align);
+ size = RTE_CACHE_LINE_ROUNDUP(size), align = RTE_CACHE_LINE_ROUNDUP(align);
/* check alignment matches first, and if ok, see if we can resize block */
if (RTE_PTR_ALIGN(ptr,align) == ptr &&
malloc_elem_resize(elem, size) == 0)
@@ -417,25 +417,25 @@ rte_sched_port_get_array_base(struct rte_sched_port_params *params, enum rte_sch
base = 0;
if (array == e_RTE_SCHED_PORT_ARRAY_SUBPORT) return base;
- base += CACHE_LINE_ROUNDUP(size_subport);
+ base += RTE_CACHE_LINE_ROUNDUP(size_subport);
if (array == e_RTE_SCHED_PORT_ARRAY_PIPE) return base;
- base += CACHE_LINE_ROUNDUP(size_pipe);
+ base += RTE_CACHE_LINE_ROUNDUP(size_pipe);
if (array == e_RTE_SCHED_PORT_ARRAY_QUEUE) return base;
- base += CACHE_LINE_ROUNDUP(size_queue);
+ base += RTE_CACHE_LINE_ROUNDUP(size_queue);
if (array == e_RTE_SCHED_PORT_ARRAY_QUEUE_EXTRA) return base;
- base += CACHE_LINE_ROUNDUP(size_queue_extra);
+ base += RTE_CACHE_LINE_ROUNDUP(size_queue_extra);
if (array == e_RTE_SCHED_PORT_ARRAY_PIPE_PROFILES) return base;
- base += CACHE_LINE_ROUNDUP(size_pipe_profiles);
+ base += RTE_CACHE_LINE_ROUNDUP(size_pipe_profiles);
if (array == e_RTE_SCHED_PORT_ARRAY_BMP_ARRAY) return base;
- base += CACHE_LINE_ROUNDUP(size_bmp_array);
+ base += RTE_CACHE_LINE_ROUNDUP(size_bmp_array);
if (array == e_RTE_SCHED_PORT_ARRAY_QUEUE_ARRAY) return base;
- base += CACHE_LINE_ROUNDUP(size_queue_array);
+ base += RTE_CACHE_LINE_ROUNDUP(size_queue_array);
return base;
}
@@ -102,10 +102,10 @@ rte_table_acl_create(
entry_size = RTE_ALIGN(entry_size, sizeof(uint64_t));
/* Memory allocation */
- action_table_size = CACHE_LINE_ROUNDUP(p->n_rules * entry_size);
+ action_table_size = RTE_CACHE_LINE_ROUNDUP(p->n_rules * entry_size);
acl_rule_list_size =
- CACHE_LINE_ROUNDUP(p->n_rules * sizeof(struct rte_acl_rule *));
- acl_rule_memory_size = CACHE_LINE_ROUNDUP(p->n_rules *
+ RTE_CACHE_LINE_ROUNDUP(p->n_rules * sizeof(struct rte_acl_rule *));
+ acl_rule_memory_size = RTE_CACHE_LINE_ROUNDUP(p->n_rules *
RTE_ACL_RULE_SZ(p->n_rule_fields));
total_size = sizeof(struct rte_table_acl) + action_table_size +
acl_rule_list_size + acl_rule_memory_size;
@@ -185,15 +185,15 @@ rte_table_hash_ext_create(void *params, int socket_id, uint32_t entry_size)
return NULL;
/* Memory allocation */
- table_meta_sz = CACHE_LINE_ROUNDUP(sizeof(struct rte_table_hash));
- bucket_sz = CACHE_LINE_ROUNDUP(p->n_buckets * sizeof(struct bucket));
+ table_meta_sz = RTE_CACHE_LINE_ROUNDUP(sizeof(struct rte_table_hash));
+ bucket_sz = RTE_CACHE_LINE_ROUNDUP(p->n_buckets * sizeof(struct bucket));
bucket_ext_sz =
- CACHE_LINE_ROUNDUP(p->n_buckets_ext * sizeof(struct bucket));
- key_sz = CACHE_LINE_ROUNDUP(p->n_keys * p->key_size);
- key_stack_sz = CACHE_LINE_ROUNDUP(p->n_keys * sizeof(uint32_t));
+ RTE_CACHE_LINE_ROUNDUP(p->n_buckets_ext * sizeof(struct bucket));
+ key_sz = RTE_CACHE_LINE_ROUNDUP(p->n_keys * p->key_size);
+ key_stack_sz = RTE_CACHE_LINE_ROUNDUP(p->n_keys * sizeof(uint32_t));
bkt_ext_stack_sz =
- CACHE_LINE_ROUNDUP(p->n_buckets_ext * sizeof(uint32_t));
- data_sz = CACHE_LINE_ROUNDUP(p->n_keys * entry_size);
+ RTE_CACHE_LINE_ROUNDUP(p->n_buckets_ext * sizeof(uint32_t));
+ data_sz = RTE_CACHE_LINE_ROUNDUP(p->n_keys * entry_size);
total_size = table_meta_sz + bucket_sz + bucket_ext_sz + key_sz +
key_stack_sz + bkt_ext_stack_sz + data_sz;
@@ -161,11 +161,11 @@ rte_table_hash_lru_create(void *params, int socket_id, uint32_t entry_size)
}
/* Memory allocation */
- table_meta_sz = CACHE_LINE_ROUNDUP(sizeof(struct rte_table_hash));
- bucket_sz = CACHE_LINE_ROUNDUP(p->n_buckets * sizeof(struct bucket));
- key_sz = CACHE_LINE_ROUNDUP(p->n_keys * p->key_size);
- key_stack_sz = CACHE_LINE_ROUNDUP(p->n_keys * sizeof(uint32_t));
- data_sz = CACHE_LINE_ROUNDUP(p->n_keys * entry_size);
+ table_meta_sz = RTE_CACHE_LINE_ROUNDUP(sizeof(struct rte_table_hash));
+ bucket_sz = RTE_CACHE_LINE_ROUNDUP(p->n_buckets * sizeof(struct bucket));
+ key_sz = RTE_CACHE_LINE_ROUNDUP(p->n_keys * p->key_size);
+ key_stack_sz = RTE_CACHE_LINE_ROUNDUP(p->n_keys * sizeof(uint32_t));
+ data_sz = RTE_CACHE_LINE_ROUNDUP(p->n_keys * entry_size);
total_size = table_meta_sz + bucket_sz + key_sz + key_stack_sz +
data_sz;