Home
last modified time | relevance | path

Searched refs:align (Results 1 – 25 of 79) sorted by relevance

1234

/dpdk/drivers/net/mlx4/
H A Dmlx4_utils.c66 size_t align = (uintptr_t)vec[i].align; in mlx4_mallocv_inline() local
68 if (!align) { in mlx4_mallocv_inline()
69 align = sizeof(double); in mlx4_mallocv_inline()
70 } else if (!rte_is_power_of_2(align)) { in mlx4_mallocv_inline()
74 if (least < align) in mlx4_mallocv_inline()
75 least = align; in mlx4_mallocv_inline()
76 align = RTE_ALIGN_CEIL(size, align); in mlx4_mallocv_inline()
77 size = align + vec[i].size; in mlx4_mallocv_inline()
79 *vec[i].addr = data + align; in mlx4_mallocv_inline()
/dpdk/lib/eal/common/
H A Drte_malloc.c54 malloc_socket(const char *type, size_t size, unsigned int align, in malloc_socket() argument
60 if (size == 0 || (align && !rte_is_power_of_2(align))) in malloc_socket()
73 align == 0 ? 1 : align, 0, false); in malloc_socket()
76 rte_eal_trace_mem_malloc(type, size, align, socket_arg, ptr); in malloc_socket()
84 rte_malloc_socket(const char *type, size_t size, unsigned int align, in rte_malloc_socket() argument
87 return malloc_socket(type, size, align, socket_arg, true); in rte_malloc_socket()
91 eal_malloc_no_trace(const char *type, size_t size, unsigned int align) in eal_malloc_no_trace() argument
93 return malloc_socket(type, size, align, SOCKET_ID_ANY, false); in eal_malloc_no_trace()
100 rte_malloc(const char *type, size_t size, unsigned align) in rte_malloc() argument
102 return rte_malloc_socket(type, size, align, SOCKET_ID_ANY); in rte_malloc()
[all …]
H A Dmalloc_heap.c151 unsigned int flags, size_t align, size_t bound, bool contig) in find_suitable_element() argument
160 if (malloc_elem_can_hold(elem, size, align, bound, in find_suitable_element()
185 unsigned int flags, size_t align, bool contig) in find_biggest_element() argument
201 align); in find_biggest_element()
208 align); in find_biggest_element()
233 size_t align, size_t bound, bool contig) in heap_alloc() argument
239 align = RTE_CACHE_LINE_ROUNDUP(align); in heap_alloc()
244 elem = find_suitable_element(heap, size, flags, align, bound, contig); in heap_alloc()
246 elem = malloc_elem_alloc(elem, size, align, bound, contig); in heap_alloc()
258 heap_alloc_biggest(struct malloc_heap *heap, unsigned int flags, size_t align, bool contig) in heap_alloc_biggest() argument
[all …]
H A Deal_common_memzone.c102 int socket_id, unsigned int flags, unsigned int align, in memzone_reserve_aligned_thread_unsafe() argument
143 if (align && !rte_is_power_of_2(align)) { in memzone_reserve_aligned_thread_unsafe()
145 align); in memzone_reserve_aligned_thread_unsafe()
151 if (align < RTE_CACHE_LINE_SIZE) in memzone_reserve_aligned_thread_unsafe()
152 align = RTE_CACHE_LINE_SIZE; in memzone_reserve_aligned_thread_unsafe()
154 /* align length on cache boundary. Check for overflow before doing so */ in memzone_reserve_aligned_thread_unsafe()
194 mz_addr = malloc_heap_alloc_biggest(socket_id, flags, align, contig); in memzone_reserve_aligned_thread_unsafe()
199 mz_addr = malloc_heap_alloc(requested_len, socket_id, flags, align, bound, contig); in memzone_reserve_aligned_thread_unsafe()
240 unsigned int flags, unsigned int align, unsigne in rte_memzone_reserve_thread_safe() argument
268 rte_memzone_reserve_bounded(const char * name,size_t len,int socket_id,unsigned flags,unsigned align,unsigned bound) rte_memzone_reserve_bounded() argument
280 rte_memzone_reserve_aligned(const char * name,size_t len,int socket_id,unsigned flags,unsigned align) rte_memzone_reserve_aligned() argument
[all...]
H A Dmalloc_elem.c33 malloc_elem_find_max_iova_contig(struct malloc_elem *elem, size_t align) in malloc_elem_find_max_iova_contig() argument
47 contig_seg_start = RTE_PTR_ALIGN_CEIL(data_start, align); in malloc_elem_find_max_iova_contig()
88 contig_seg_start = RTE_PTR_ALIGN(cur_page, align); in malloc_elem_find_max_iova_contig()
219 elem_start_pt(struct malloc_elem *elem, size_t size, unsigned align, in elem_start_pt() argument
233 align); in elem_start_pt()
240 align); in elem_start_pt()
266 elem_size -= align; in elem_start_pt()
280 malloc_elem_can_hold(struct malloc_elem *elem, size_t size, unsigned align, in malloc_elem_can_hold() argument
283 return elem_start_pt(elem, size, align, bound, contig) != NULL; in malloc_elem_can_hold()
428 malloc_elem_alloc(struct malloc_elem *elem, size_t size, unsigned align, in malloc_elem_alloc() argument
[all …]
H A Dmalloc_mp.h36 size_t align; member
78 int socket, unsigned int flags, size_t align, size_t bound,
H A Dmalloc_heap.h37 malloc_heap_alloc(size_t size, int socket, unsigned int flags, size_t align,
41 malloc_heap_alloc_biggest(int socket, unsigned int flags, size_t align, bool contig);
/dpdk/drivers/bus/dpaa/base/qbman/
H A Ddpaa_alloc.c13 int bman_alloc_bpid_range(u32 *result, u32 count, u32 align, int partial) in bman_alloc_bpid_range() argument
15 return process_alloc(dpaa_id_bpid, result, count, align, partial); in bman_alloc_bpid_range()
28 int qman_alloc_fqid_range(u32 *result, u32 count, u32 align, int partial) in qman_alloc_fqid_range() argument
30 return process_alloc(dpaa_id_fqid, result, count, align, partial); in qman_alloc_fqid_range()
43 int qman_alloc_pool_range(u32 *result, u32 count, u32 align, int partial) in qman_alloc_pool_range() argument
45 return process_alloc(dpaa_id_qpool, result, count, align, partial); in qman_alloc_pool_range()
58 int qman_alloc_cgrid_range(u32 *result, u32 count, u32 align, int partial) in qman_alloc_cgrid_range() argument
60 return process_alloc(dpaa_id_cgrid, result, count, align, partial); in qman_alloc_cgrid_range()
/dpdk/lib/eal/include/
H A Drte_malloc.h64 * @param align
67 * Otherwise, the return is a pointer that is a multiple of *align*. In
72 * align is not a power of two).
76 rte_malloc(const char *type, size_t size, unsigned align)
92 * @param align
95 * Otherwise, the return is a pointer that is a multiple of *align*. In
100 * align is not a power of two).
104 rte_zmalloc(const char *type, size_t size, unsigned align)
120 * @param align
123 * Otherwise, the return is a pointer that is a multiple of *align*
[all...]
H A Drte_common.h87 #define __rte_aligned(a) __declspec(align(a))
276 * Note: not enabled on Clang because it warns if align argument is zero.
569 * Macro to align a pointer to a given power-of-two. The resultant
574 #define RTE_PTR_ALIGN_FLOOR(ptr, align) \
575 ((typeof(ptr))RTE_ALIGN_FLOOR((uintptr_t)(ptr), align))
578 * Macro to align a value to a given power-of-two. The resultant value
583 #define RTE_ALIGN_FLOOR(val, align) \
584 (typeof(val))((val) & (~((typeof(val))((align) - 1))))
587 * Macro to align a pointer to a given power-of-two. The resultant
592 #define RTE_PTR_ALIGN_CEIL(ptr, align) \
439 RTE_PTR_ALIGN_FLOOR(ptr,align) global() argument
448 RTE_ALIGN_FLOOR(val,align) global() argument
457 RTE_PTR_ALIGN_CEIL(ptr,align) global() argument
466 RTE_ALIGN_CEIL(val,align) global() argument
476 RTE_PTR_ALIGN(ptr,align) global() argument
485 RTE_ALIGN(val,align) global() argument
527 rte_is_aligned(const void * const __rte_restrict ptr,const unsigned int align) rte_is_aligned() argument
[all...]
H A Deal_trace_internal.h95 RTE_TRACE_POINT_ARGS(const char *type, size_t size, unsigned int align,
99 rte_trace_point_emit_u32(align);
106 RTE_TRACE_POINT_ARGS(const char *type, size_t size, unsigned int align,
110 rte_trace_point_emit_u32(align);
117 RTE_TRACE_POINT_ARGS(size_t size, unsigned int align, int socket,
120 rte_trace_point_emit_u32(align);
135 unsigned int flags, unsigned int align, unsigned int bound,
141 rte_trace_point_emit_u32(align);
H A Drte_memzone.h199 * @param align
213 unsigned flags, unsigned align);
267 * @param align
284 unsigned flags, unsigned align, unsigned bound);
/dpdk/drivers/common/mlx5/
H A Dmlx5_malloc.c149 mlx5_alloc_align(size_t size, unsigned int align, unsigned int zero) in mlx5_alloc_align() argument
153 buf = mlx5_os_malloc(align, size); in mlx5_alloc_align()
156 size, align); in mlx5_alloc_align()
165 mlx5_malloc(uint32_t flags, size_t size, unsigned int align, int socket) in mlx5_malloc() argument
182 addr = rte_zmalloc_socket(NULL, size, align, socket); in mlx5_malloc()
184 addr = rte_malloc_socket(NULL, size, align, socket); in mlx5_malloc()
194 if (align > MLX5_MALLOC_ALIGNMENT) in mlx5_malloc()
195 addr = mlx5_alloc_align(size, align, !!(flags & MLX5_MEM_ZERO)); in mlx5_malloc()
209 mlx5_realloc(void *addr, uint32_t flags, size_t size, unsigned int align, in mlx5_realloc() argument
217 return mlx5_malloc(flags, size, align, socket); in mlx5_realloc()
[all …]
H A Dmlx5_malloc.h68 void *mlx5_malloc(uint32_t flags, size_t size, unsigned int align, int socket);
92 void *mlx5_realloc(void *addr, uint32_t flags, size_t size, unsigned int align,
/dpdk/drivers/net/virtio/
H A Dvirtio_ring.h134 vring_size(struct virtio_hw *hw, unsigned int num, unsigned long align) in vring_size() argument
141 size = RTE_ALIGN_CEIL(size, align); in vring_size()
148 size = RTE_ALIGN_CEIL(size, align); in vring_size()
155 unsigned long align, unsigned int num) in vring_init_split() argument
163 RTE_ALIGN_CEIL((uintptr_t)(&vr->avail->ring[num]), align); in vring_init_split()
168 unsigned long align, unsigned int num) in vring_init_packed() argument
177 sizeof(struct vring_packed_desc_event)), align); in vring_init_packed()
/dpdk/lib/mbuf/
H A Drte_mbuf_dyn.c66 size_t off, align, size, i; in process_score() local
88 for (align = 1; in process_score()
89 (off % (align << 1)) == 0 && (align << 1) <= size; in process_score()
90 align <<= 1) in process_score()
94 for (i = off; i < off + align; i++) in process_score()
95 shm->free_space[i] = RTE_MAX(align, shm->free_space[i]); in process_score()
97 off += align; in process_score()
150 check_offset(size_t offset, size_t size, size_t align) in check_offset() argument
154 if ((offset & (align - 1)) != 0) in check_offset()
220 if (params1->align != params2->align) in mbuf_dynfield_cmp()
[all …]
/dpdk/app/test/
H A Dtest_malloc.c62 is_aligned(void *p, int align) in is_aligned() argument
65 unsigned mask = align - 1; in is_aligned()
273 int align = 1024; in test_multi_alloc_statistics() local
296 void *p1 = rte_malloc_socket("stats", size , align, socket); in test_multi_alloc_statistics()
315 align = 0; in test_multi_alloc_statistics()
317 void *p2 = rte_malloc_socket("add", size ,align, socket); in test_multi_alloc_statistics()
322 void *p3 = rte_malloc_socket("add2", size,align, socket); in test_multi_alloc_statistics()
701 const unsigned align = 1 << (rte_rand() % 12); /* up to 4k alignment */ in test_random_alloc_free() local
703 mem_size, align); in test_random_alloc_free()
706 if (RTE_PTR_ALIGN(entry, align)!= entry) in test_random_alloc_free()
[all …]
H A Dtest_memzone.c494 find_max_block_free_size(unsigned int align, unsigned int socket_id) in find_max_block_free_size() argument
508 align = RTE_CACHE_LINE_ROUNDUP(align); in find_max_block_free_size()
509 overhead += align; in find_max_block_free_size()
576 const unsigned int align = 1 << ((rte_rand() % 8) + 5); /* from 128 up to 4k alignment */ in test_memzone_reserve_max_aligned() local
579 minlen = find_max_block_free_size(align, socket); in test_memzone_reserve_max_aligned()
584 align); in test_memzone_reserve_max_aligned()
590 0, socket, 0, align); in test_memzone_reserve_max_aligned()
598 if (mz->addr != RTE_PTR_ALIGN(mz->addr, align)) { in test_memzone_reserve_max_aligned()
600 align); in test_memzone_reserve_max_aligned()
608 " biggest block\n", align); in test_memzone_reserve_max_aligned()
[all …]
H A Dtest_ptr_compress.c27 unsigned int align = 1 << align_exp; in test_ptr_compress_params() local
37 ptrs[i] = (char *)base + mem_sz - i * align; in test_ptr_compress_params()
39 ptrs[i] = (char *)base + i * align; in test_ptr_compress_params()
/dpdk/drivers/net/mlx5/hws/
H A Dmlx5dr_internal.h97 static inline unsigned long align(unsigned long val, unsigned long align) in align() function
99 return (val + align - 1) & ~(align - 1); in align()
/dpdk/drivers/crypto/virtio/
H A Dvirtio_ring.h101 vring_size(unsigned int num, unsigned long align) in vring_size() argument
107 size = RTE_ALIGN_CEIL(size, align); in vring_size()
115 unsigned long align) in vring_init() argument
122 RTE_ALIGN_CEIL((uintptr_t)(&vr->avail->ring[num]), align); in vring_init()
/dpdk/drivers/common/mlx5/windows/
H A Dmlx5_common_os.h39 mlx5_os_malloc(size_t align, size_t size) in mlx5_os_malloc() argument
41 if (align < MLX5_MALLOC_ALIGNMENT) in mlx5_os_malloc()
42 align = MLX5_MALLOC_ALIGNMENT; in mlx5_os_malloc()
43 return _aligned_malloc(size, align); in mlx5_os_malloc()
/dpdk/lib/mempool/
H A Drte_mempool_ops_default.c13 size_t *min_chunk_size, size_t *align) in rte_mempool_op_calc_mem_size_helper() argument
63 *align = RTE_MEMPOOL_ALIGN; in rte_mempool_op_calc_mem_size_helper()
71 size_t *min_chunk_size, size_t *align) in rte_mempool_op_calc_mem_size_default() argument
74 0, min_chunk_size, align); in rte_mempool_op_calc_mem_size_default()
/dpdk/app/test-gpudev/
H A Dmain.c71 unsigned int align = 4096; in alloc_gpu_memory() local
86 ptr_2 = rte_gpu_mem_alloc(gpu_id, buf_bytes, align); in alloc_gpu_memory()
94 if (((uintptr_t)ptr_2) % align) { in alloc_gpu_memory()
95 fprintf(stderr, "Memory address 0x%p is not aligned to %u\n", ptr_2, align); in alloc_gpu_memory()
194 unsigned int align = 4096; in gpu_mem_cpu_map() local
200 ptr_gpu = rte_gpu_mem_alloc(gpu_id, buf_bytes, align); in gpu_mem_cpu_map()
/dpdk/drivers/mempool/bucket/
H A Drte_mempool_bucket.c376 uintptr_t align; in count_underfilled_buckets() local
379 align = (uintptr_t)RTE_PTR_ALIGN_CEIL(memhdr->addr, bucket_page_sz) - in count_underfilled_buckets()
382 for (iter = (uint8_t *)memhdr->addr + align; in count_underfilled_buckets()
567 size_t *align) in bucket_calc_mem_size() argument
576 *align = bucket_page_sz; in bucket_calc_mem_size()
597 uintptr_t align; in bucket_populate() local
605 align = RTE_PTR_ALIGN_CEIL((uintptr_t)vaddr, bucket_page_sz) - in bucket_populate()
610 iova += align + bucket_header_sz; in bucket_populate()
612 for (iter = (uint8_t *)vaddr + align, n_objs = 0; in bucket_populate()

1234