diff options
author | Matias Elo <matias.elo@nokia.com> | 2022-06-06 14:05:05 +0300 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2022-06-20 16:13:53 +0300 |
commit | 7b8debc5093683d2bfde0c226e793e11276540ce (patch) | |
tree | 7494824cdfc45e9a0da36453c208017db8a97a13 /platform | |
parent | 51fef12d7f7b436816bd8eb97b481a4138fa0023 (diff) |
Port 82d0da39f "linux-gen: macros: prefix implementation internal macro names"
Port original commit from linux-generic.
Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Diffstat (limited to 'platform')
-rw-r--r-- | platform/linux-dpdk/Makefile.am | 1 | ||||
-rw-r--r-- | platform/linux-dpdk/include/odp_buffer_internal.h | 1 | ||||
-rw-r--r-- | platform/linux-dpdk/include/odp_eventdev_internal.h | 4 | ||||
-rw-r--r-- | platform/linux-dpdk/include/odp_packet_io_internal.h | 4 | ||||
-rw-r--r-- | platform/linux-dpdk/include/odp_queue_basic_internal.h | 4 | ||||
-rw-r--r-- | platform/linux-dpdk/odp_packet.c | 6 | ||||
-rw-r--r-- | platform/linux-dpdk/odp_pool.c | 22 | ||||
-rw-r--r-- | platform/linux-dpdk/odp_queue_basic.c | 5 | ||||
-rw-r--r-- | platform/linux-dpdk/odp_queue_eventdev.c | 5 | ||||
-rw-r--r-- | platform/linux-dpdk/odp_shared_memory.c | 6 | ||||
-rw-r--r-- | platform/linux-dpdk/odp_timer.c | 5 |
11 files changed, 31 insertions, 32 deletions
diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am index 70ce4b980..b3365be71 100644 --- a/platform/linux-dpdk/Makefile.am +++ b/platform/linux-dpdk/Makefile.am @@ -104,7 +104,6 @@ odpapiabiarchinclude_HEADERS += \ endif noinst_HEADERS = \ - ${top_srcdir}/platform/linux-generic/include/odp_align_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_atomic_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_bitset.h \ include/odp_buffer_internal.h \ diff --git a/platform/linux-dpdk/include/odp_buffer_internal.h b/platform/linux-dpdk/include/odp_buffer_internal.h index 42b686a2a..3b99961c1 100644 --- a/platform/linux-dpdk/include/odp_buffer_internal.h +++ b/platform/linux-dpdk/include/odp_buffer_internal.h @@ -27,7 +27,6 @@ extern "C" { #include <odp/api/std_types.h> #include <odp/api/thread.h> -#include <odp_align_internal.h> #include <odp_config_internal.h> #include <odp_event_internal.h> diff --git a/platform/linux-dpdk/include/odp_eventdev_internal.h b/platform/linux-dpdk/include/odp_eventdev_internal.h index f6b01ec81..66da6daee 100644 --- a/platform/linux-dpdk/include/odp_eventdev_internal.h +++ b/platform/linux-dpdk/include/odp_eventdev_internal.h @@ -25,9 +25,9 @@ extern "C" { #include <odp/api/thread.h> #include <odp/api/ticketlock.h> -#include <odp_align_internal.h> #include <odp_config_internal.h> #include <odp_forward_typedefs_internal.h> +#include <odp_macros_internal.h> #include <odp_packet_io_internal.h> #include <odp_ptr_ring_mpmc_internal.h> #include <odp_queue_if.h> @@ -88,7 +88,7 @@ struct queue_entry_s { union queue_entry_u { struct queue_entry_s s; - uint8_t pad[ROUNDUP_CACHE_LINE(sizeof(struct queue_entry_s))]; + uint8_t pad[_ODP_ROUNDUP_CACHE_LINE(sizeof(struct queue_entry_s))]; }; /* Eventdev global data */ diff --git a/platform/linux-dpdk/include/odp_packet_io_internal.h b/platform/linux-dpdk/include/odp_packet_io_internal.h index 1f3fb650d..59410eef6 100644 --- a/platform/linux-dpdk/include/odp_packet_io_internal.h +++ b/platform/linux-dpdk/include/odp_packet_io_internal.h @@ -26,10 +26,10 @@ extern "C" { #include <odp/api/plat/packet_io_inlines.h> -#include <odp_align_internal.h> #include <odp_classification_datamodel.h> #include <odp_config_internal.h> #include <odp_debug_internal.h> +#include <odp_macros_internal.h> #include <odp_queue_if.h> #include <inttypes.h> @@ -159,7 +159,7 @@ struct pktio_entry { typedef union { struct pktio_entry s; - uint8_t pad[ROUNDUP_CACHE_LINE(sizeof(struct pktio_entry))]; + uint8_t pad[_ODP_ROUNDUP_CACHE_LINE(sizeof(struct pktio_entry))]; } pktio_entry_t; typedef struct { diff --git a/platform/linux-dpdk/include/odp_queue_basic_internal.h b/platform/linux-dpdk/include/odp_queue_basic_internal.h index 72c77d985..36ef7c6b5 100644 --- a/platform/linux-dpdk/include/odp_queue_basic_internal.h +++ b/platform/linux-dpdk/include/odp_queue_basic_internal.h @@ -20,10 +20,10 @@ extern "C" { #include <odp/api/shared_memory.h> #include <odp/api/ticketlock.h> -#include <odp_align_internal.h> #include <odp_buffer_internal.h> #include <odp_config_internal.h> #include <odp_forward_typedefs_internal.h> +#include <odp_macros_internal.h> #include <odp_ptr_ring_mpmc_internal.h> #include <odp_ptr_ring_st_internal.h> #include <odp_ptr_ring_spsc_internal.h> @@ -70,7 +70,7 @@ struct queue_entry_s { union queue_entry_u { struct queue_entry_s s; - uint8_t pad[ROUNDUP_CACHE_LINE(sizeof(struct queue_entry_s))]; + uint8_t pad[_ODP_ROUNDUP_CACHE_LINE(sizeof(struct queue_entry_s))]; }; typedef struct queue_global_t { diff --git a/platform/linux-dpdk/odp_packet.c b/platform/linux-dpdk/odp_packet.c index 1af9bf0c5..daef605d4 100644 --- a/platform/linux-dpdk/odp_packet.c +++ b/platform/linux-dpdk/odp_packet.c @@ -5,6 +5,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include <odp/api/align.h> #include <odp/api/buffer.h> #include <odp/api/byteorder.h> #include <odp/api/hash.h> @@ -20,7 +21,6 @@ #include <odp/api/plat/packet_inlines.h> #include <odp/api/plat/packet_io_inlines.h> -#include <odp_align_internal.h> #include <odp_chksum_internal.h> #include <odp_debug_internal.h> #include <odp_errno_define.h> @@ -788,7 +788,7 @@ int odp_packet_align(odp_packet_t *pkt, uint32_t offset, uint32_t len, if (seglen >= len) { misalign = align <= 1 ? 0 : - ROUNDUP_ALIGN(uaddr, align) - uaddr; + _ODP_ROUNDUP_ALIGN(uaddr, align) - uaddr; if (misalign == 0) return 0; shift = align - misalign; @@ -798,7 +798,7 @@ int odp_packet_align(odp_packet_t *pkt, uint32_t offset, uint32_t len, shift = len - seglen; uaddr -= shift; misalign = align <= 1 ? 0 : - ROUNDUP_ALIGN(uaddr, align) - uaddr; + _ODP_ROUNDUP_ALIGN(uaddr, align) - uaddr; if (misalign) shift += align - misalign; } diff --git a/platform/linux-dpdk/odp_pool.c b/platform/linux-dpdk/odp_pool.c index 3dd79f17b..3f8aea9bb 100644 --- a/platform/linux-dpdk/odp_pool.c +++ b/platform/linux-dpdk/odp_pool.c @@ -11,7 +11,7 @@ #include <odp_buffer_internal.h> #include <odp_packet_internal.h> #include <odp_timer_internal.h> -#include <odp_align_internal.h> + #include <odp/api/shared_memory.h> #include <odp/api/align.h> #include <odp_init_internal.h> @@ -19,6 +19,7 @@ #include <odp/api/hints.h> #include <odp/api/debug.h> #include <odp_debug_internal.h> +#include <odp_macros_internal.h> #include <odp/api/cpumask.h> #include <odp_libconfig_internal.h> #include <odp_event_vector_internal.h> @@ -420,7 +421,7 @@ static int check_params(const odp_pool_param_t *params) return -1; } - if (!CHECK_IS_POWER2(params->buf.align)) { + if (!_ODP_CHECK_IS_POWER2(params->buf.align)) { ODP_ERR("buf.align not power of two %u\n", params->buf.align); return -1; } @@ -444,7 +445,7 @@ static int check_params(const odp_pool_param_t *params) return -1; } - if (!CHECK_IS_POWER2(params->pkt.align)) { + if (!_ODP_CHECK_IS_POWER2(params->pkt.align)) { ODP_ERR("pkt.align not power of two %u\n", params->pkt.align); return -1; } @@ -631,7 +632,7 @@ static int reserve_uarea(pool_t *pool, uint32_t uarea_size, uint32_t num_pkt) pool->pool_idx, pool->name); uarea_name[ODP_SHM_NAME_LEN - 1] = 0; - pool->uarea_size = ROUNDUP_CACHE_LINE(uarea_size); + pool->uarea_size = _ODP_ROUNDUP_CACHE_LINE(uarea_size); pool->uarea_shm_size = num_pkt * (uint64_t)pool->uarea_size; shm = odp_shm_reserve(uarea_name, pool->uarea_shm_size, ODP_PAGE_SIZE, 0); @@ -699,8 +700,7 @@ odp_pool_t _odp_pool_create(const char *name, const odp_pool_param_t *params, buf_align = ODP_CONFIG_BUFFER_ALIGN_MIN; if (params->buf.align != 0) - blk_size = ROUNDUP_ALIGN(blk_size, - buf_align); + blk_size = _ODP_ROUNDUP_ALIGN(blk_size, buf_align); hdr_size = sizeof(odp_buffer_hdr_t); CHECK_U16_OVERFLOW(blk_size); @@ -732,13 +732,12 @@ odp_pool_t _odp_pool_create(const char *name, const odp_pool_param_t *params, if ((max_len + blk_size) / blk_size > params->pkt.num) blk_size = (max_len + params->pkt.num) / params->pkt.num; - blk_size = ROUNDUP_ALIGN(headroom + blk_size + - tailroom, min_align); + blk_size = _ODP_ROUNDUP_ALIGN(headroom + blk_size + tailroom, min_align); /* Segment size minus headroom might be rounded down by the driver (e.g. * ixgbe) to the nearest multiple of 1024. Round it up here to make sure the * requested size is still going to fit without segmentation. */ - blk_size = ROUNDUP_ALIGN(blk_size - headroom, min_seg_len) + headroom; + blk_size = _ODP_ROUNDUP_ALIGN(blk_size - headroom, min_seg_len) + headroom; /* Round down the block size to 16 bits */ if (blk_size > UINT16_MAX) { @@ -783,8 +782,7 @@ odp_pool_t _odp_pool_create(const char *name, const odp_pool_param_t *params, return ODP_POOL_INVALID; } - mb_ctor_arg.seg_buf_offset = - (uint16_t)ROUNDUP_CACHE_LINE(hdr_size); + mb_ctor_arg.seg_buf_offset = (uint16_t)_ODP_ROUNDUP_CACHE_LINE(hdr_size); mb_ctor_arg.seg_buf_size = mbp_ctor_arg.mbuf_data_room_size; mb_ctor_arg.type = type; mb_ctor_arg.event_type = event_type; @@ -1140,7 +1138,7 @@ int odp_pool_stats_reset(odp_pool_t pool_hdl ODP_UNUSED) * Round up the space we reserve for objhdr up to cache line size. The rte_mbuf * that comes after this must be cache line aligned. */ -#define SIZEOF_OBJHDR ROUNDUP_CACHE_LINE(sizeof(struct rte_mempool_objhdr)) +#define SIZEOF_OBJHDR _ODP_ROUNDUP_CACHE_LINE(sizeof(struct rte_mempool_objhdr)) int odp_pool_ext_capability(odp_pool_type_t type, odp_pool_ext_capability_t *capa) diff --git a/platform/linux-dpdk/odp_queue_basic.c b/platform/linux-dpdk/odp_queue_basic.c index 5f07bb620..c6970930d 100644 --- a/platform/linux-dpdk/odp_queue_basic.c +++ b/platform/linux-dpdk/odp_queue_basic.c @@ -18,6 +18,7 @@ #include <odp_config_internal.h> #include <odp_packet_io_internal.h> #include <odp_debug_internal.h> +#include <odp_macros_internal.h> #include <odp/api/hints.h> #include <odp/api/sync.h> #include <odp/api/plat/sync_inlines.h> @@ -995,11 +996,11 @@ static int queue_init(queue_entry_t *queue, const char *name, } /* Ring size must larger than queue_size */ - if (CHECK_IS_POWER2(queue_size)) + if (_ODP_CHECK_IS_POWER2(queue_size)) queue_size++; /* Round up if not already a power of two */ - queue_size = ROUNDUP_POWER2_U32(queue_size); + queue_size = _ODP_ROUNDUP_POWER2_U32(queue_size); /* Single-producer / single-consumer plain queue has simple and * lock-free implementation */ diff --git a/platform/linux-dpdk/odp_queue_eventdev.c b/platform/linux-dpdk/odp_queue_eventdev.c index 5e28112ab..e60b4e006 100644 --- a/platform/linux-dpdk/odp_queue_eventdev.c +++ b/platform/linux-dpdk/odp_queue_eventdev.c @@ -15,6 +15,7 @@ #include <odp_config_internal.h> #include <odp_event_internal.h> #include <odp_debug_internal.h> +#include <odp_macros_internal.h> #include <odp_libconfig_internal.h> #include <odp_queue_if.h> #include <odp_schedule_if.h> @@ -1165,11 +1166,11 @@ static int queue_init(queue_entry_t *queue, const char *name, } /* Ring size must larger than queue_size */ - if (CHECK_IS_POWER2(queue_size)) + if (_ODP_CHECK_IS_POWER2(queue_size)) queue_size++; /* Round up if not already a power of two */ - queue_size = ROUNDUP_POWER2_U32(queue_size); + queue_size = _ODP_ROUNDUP_POWER2_U32(queue_size); /* Default to error functions */ queue->s.enqueue = error_enqueue; diff --git a/platform/linux-dpdk/odp_shared_memory.c b/platform/linux-dpdk/odp_shared_memory.c index 645ee49ef..9e2151a0d 100644 --- a/platform/linux-dpdk/odp_shared_memory.c +++ b/platform/linux-dpdk/odp_shared_memory.c @@ -13,9 +13,9 @@ #include <odp/api/shared_memory.h> #include <odp/api/spinlock.h> -#include <odp_align_internal.h> #include <odp_config_internal.h> #include <odp_debug_internal.h> +#include <odp_macros_internal.h> #include <odp_shm_internal.h> #include <string.h> @@ -266,8 +266,8 @@ odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, } /* DPDK requires alignment to be power of two */ - if (!rte_is_power_of_2(align)) - align = ROUNDUP_POWER2_U32(align); + if (!_ODP_CHECK_IS_POWER2(align)) + align = _ODP_ROUNDUP_POWER2_U32(align); odp_spinlock_lock(&shm_tbl->lock); diff --git a/platform/linux-dpdk/odp_timer.c b/platform/linux-dpdk/odp_timer.c index 01f23ee31..c10b246b7 100644 --- a/platform/linux-dpdk/odp_timer.c +++ b/platform/linux-dpdk/odp_timer.c @@ -23,6 +23,7 @@ #include <odp_debug_internal.h> #include <odp_init_internal.h> #include <odp_libconfig_internal.h> +#include <odp_macros_internal.h> #include <odp_pool_internal.h> #include <odp_queue_if.h> #include <odp_ring_u32_internal.h> @@ -650,9 +651,9 @@ odp_timer_pool_t odp_timer_pool_create(const char *name, nsec_per_scan = res_ns; /* Ring size must larger than param->num_timers */ - if (CHECK_IS_POWER2(num_timers)) + if (_ODP_CHECK_IS_POWER2(num_timers)) num_timers++; - num_timers = ROUNDUP_POWER2_U32(num_timers); + num_timers = _ODP_ROUNDUP_POWER2_U32(num_timers); odp_ticketlock_lock(&timer_global->lock); |