[dpdk-dev] [PATCH v9 1/6] lib/eal: implement the family of common bit operation APIs

Thomas Monjalon thomas at monjalon.net
Sat Apr 25 21:59:29 CEST 2020


24/04/2020 05:21, Joyce Kong:
> Bitwise operation APIs are defined and used in a lot of PMDs,
> which caused a huge code duplication. To reduce duplication,
> this patch consolidates them into a common API family.
[...]
> +rte_get_bit32_relaxed(unsigned int nr, volatile uint32_t *addr)
> +rte_set_bit32_relaxed(unsigned int nr, volatile uint32_t *addr)
> +rte_clear_bit32_relaxed(unsigned int nr, volatile uint32_t *addr)
> +rte_test_and_set_bit32_relaxed(unsigned int nr, volatile uint32_t *addr)
> +rte_test_and_clear_bit32_relaxed(unsigned int nr, volatile uint32_t *addr)
> +rte_get_bit64_relaxed(unsigned int nr, volatile uint64_t *addr)
> +rte_set_bit64_relaxed(unsigned int nr, volatile uint64_t *addr)
> +rte_clear_bit64_relaxed(unsigned int nr, volatile uint64_t *addr)
> +rte_test_and_set_bit64_relaxed(unsigned int nr, volatile uint64_t *addr)
> +rte_test_and_clear_bit64_relaxed(unsigned int nr, volatile uint64_t *addr)

Sorry, I have one more naming concern with this series.
I prefer a common namespace for bit operations.
Would you be OK to prefix all function names with rte_bit_relaxed_?




More information about the dev mailing list