X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Fcommon%2Fmalloc_elem.h;h=a1e5f7f02cc59fc83a04bd71f9d851a76b40d804;hb=84fb33fec179ea96f814aed9f658d5a2df20745d;hp=620dd44c87f3a4376c19dc1a7146cdd41877ebf9;hpb=66cc45e293ed67d4e83fb8a1174089c58610a8e1;p=dpdk.git diff --git a/lib/librte_eal/common/malloc_elem.h b/lib/librte_eal/common/malloc_elem.h index 620dd44c87..a1e5f7f02c 100644 --- a/lib/librte_eal/common/malloc_elem.h +++ b/lib/librte_eal/common/malloc_elem.h @@ -7,7 +7,7 @@ #include -#include +#define MIN_DATA_SIZE (RTE_CACHE_LINE_SIZE) /* dummy definition of struct so we can use pointers to it in malloc_elem struct */ struct malloc_heap; @@ -30,6 +30,8 @@ struct malloc_elem { volatile enum elem_state state; uint32_t pad; size_t size; + struct malloc_elem *orig_elem; + size_t orig_size; #ifdef RTE_MALLOC_DEBUG uint64_t header_cookie; /* Cookie marking start of data */ /* trailer cookie at start + size */ @@ -114,7 +116,9 @@ void malloc_elem_init(struct malloc_elem *elem, struct malloc_heap *heap, struct rte_memseg_list *msl, - size_t size); + size_t size, + struct malloc_elem *orig_elem, + size_t orig_size); void malloc_elem_insert(struct malloc_elem *elem); @@ -153,6 +157,9 @@ malloc_elem_join_adjacent_free(struct malloc_elem *elem); int malloc_elem_resize(struct malloc_elem *elem, size_t size); +void +malloc_elem_hide_region(struct malloc_elem *elem, void *start, size_t len); + void malloc_elem_free_list_remove(struct malloc_elem *elem); @@ -174,4 +181,10 @@ malloc_elem_free_list_index(size_t size); void malloc_elem_free_list_insert(struct malloc_elem *elem); +/* + * Find biggest IOVA-contiguous zone within an element with specified alignment. + */ +size_t +malloc_elem_find_max_iova_contig(struct malloc_elem *elem, size_t align); + #endif /* MALLOC_ELEM_H_ */