X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flibrte_stack%2Frte_stack_lf_generic.h;h=3abbb53428b244014ac38fd9adc8efb5f4a46be9;hb=74f4d6424da1297bd6e83dcb7bd84444ca8c59dd;hp=1191406d37b047d8f36463bfb1af6b058906b715;hpb=3340202f5954a4fbba62332c4aad29af67701188;p=dpdk.git diff --git a/lib/librte_stack/rte_stack_lf_generic.h b/lib/librte_stack/rte_stack_lf_generic.h index 1191406d37..3abbb53428 100644 --- a/lib/librte_stack/rte_stack_lf_generic.h +++ b/lib/librte_stack/rte_stack_lf_generic.h @@ -26,7 +26,8 @@ __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)rte_atomic64_read(&s->stack_lf.used.len); + return (unsigned int)rte_atomic64_read((rte_atomic64_t *) + &s->stack_lf.used.len); } static __rte_always_inline void @@ -35,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; @@ -73,8 +68,7 @@ __rte_stack_lf_push_elems(struct rte_stack_lf_list *list, __ATOMIC_RELAXED); } while (success == 0); - rte_atomic64_add(&list->len, num); -#endif + rte_atomic64_add((rte_atomic64_t *)&list->len, num); } static __rte_always_inline struct rte_stack_lf_elem * @@ -83,20 +77,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; int success; /* Reserve num elements, if available */ while (1) { - uint64_t len = rte_atomic64_read(&list->len); + uint64_t len = rte_atomic64_read((rte_atomic64_t *)&list->len); /* Does the list contain enough elements? */ if (unlikely(len < num)) @@ -158,7 +144,6 @@ __rte_stack_lf_pop_elems(struct rte_stack_lf_list *list, } while (success == 0); return old_head.top; -#endif } #endif /* _RTE_STACK_LF_GENERIC_H_ */