X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flibrte_stack%2Frte_stack_lf_c11.h;h=999359f0810e1644426501b10481ce72f31a7c06;hb=9c4971e5231d1fb169ca6f74c9af795953500e88;hp=a316e9af50c19f8c742e0d0a00d83a6ae2bd6726;hpb=7e6e609939a8d76bc5c0804d7cab91512dd607e4;p=dpdk.git diff --git a/lib/librte_stack/rte_stack_lf_c11.h b/lib/librte_stack/rte_stack_lf_c11.h index a316e9af50..999359f081 100644 --- a/lib/librte_stack/rte_stack_lf_c11.h +++ b/lib/librte_stack/rte_stack_lf_c11.h @@ -26,7 +26,7 @@ __rte_stack_lf_count(struct rte_stack *s) * elements. If the mempool is near-empty to the point that this is a * concern, the user should consider increasing the mempool size. */ - return (unsigned int)__atomic_load_n(&s->stack_lf.used.len.cnt, + return (unsigned int)__atomic_load_n(&s->stack_lf.used.len, __ATOMIC_RELAXED); } @@ -36,12 +36,6 @@ __rte_stack_lf_push_elems(struct rte_stack_lf_list *list, struct rte_stack_lf_elem *last, unsigned int num) { -#ifndef RTE_ARCH_X86_64 - RTE_SET_USED(first); - RTE_SET_USED(last); - RTE_SET_USED(list); - RTE_SET_USED(num); -#else struct rte_stack_lf_head old_head; int success; @@ -78,8 +72,7 @@ __rte_stack_lf_push_elems(struct rte_stack_lf_list *list, /* Ensure the stack modifications are not reordered with respect * to the LIFO len update. */ - __atomic_add_fetch(&list->len.cnt, num, __ATOMIC_RELEASE); -#endif + __atomic_add_fetch(&list->len, num, __ATOMIC_RELEASE); } static __rte_always_inline struct rte_stack_lf_elem * @@ -88,20 +81,12 @@ __rte_stack_lf_pop_elems(struct rte_stack_lf_list *list, void **obj_table, struct rte_stack_lf_elem **last) { -#ifndef RTE_ARCH_X86_64 - RTE_SET_USED(obj_table); - RTE_SET_USED(last); - RTE_SET_USED(list); - RTE_SET_USED(num); - - return NULL; -#else struct rte_stack_lf_head old_head; uint64_t len; int success; /* Reserve num elements, if available */ - len = __atomic_load_n(&list->len.cnt, __ATOMIC_ACQUIRE); + len = __atomic_load_n(&list->len, __ATOMIC_ACQUIRE); while (1) { /* Does the list contain enough elements? */ @@ -109,7 +94,7 @@ __rte_stack_lf_pop_elems(struct rte_stack_lf_list *list, return NULL; /* len is updated on failure */ - if (__atomic_compare_exchange_n(&list->len.cnt, + if (__atomic_compare_exchange_n(&list->len, &len, len - num, 0, __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE)) @@ -169,7 +154,6 @@ __rte_stack_lf_pop_elems(struct rte_stack_lf_list *list, } while (success == 0); return old_head.top; -#endif } #endif /* _RTE_STACK_LF_C11_H_ */