[dpdk-dev] [PATCH v2 1/6] lib/eal: implement the family of rte bit operation APIs
Jerin Jacob
jerinjacobk at gmail.com
Wed Oct 23 06:56:56 CEST 2019
On Wed, Oct 23, 2019 at 8:25 AM Joyce Kong <joyce.kong at arm.com> wrote:
>
> There are a lot functions of bit operations scattered and
> duplicated in PMDs, consolidating them into a common API
> family is necessary. Furthermore, the bit operation is
> mostly applied to the IO devices, so use __ATOMIC_ACQ_REL
> to ensure the ordering.
>
> Signed-off-by: Joyce Kong <joyce.kong at arm.com>
> Reviewed-by: Gavin Hu <gavin.hu at arm.com>
> ---
> lib/librte_eal/common/Makefile | 1 +
> lib/librte_eal/common/include/rte_io_bitops.h | 112 ++++++++++++++++++++++++++
> lib/librte_eal/common/meson.build | 1 +
Missing doc/api/doxy-api-index.md update
> 3 files changed, 114 insertions(+)
> create mode 100644 lib/librte_eal/common/include/rte_io_bitops.h
>
> +
> +/**
> + * Get a bit.
> + *
> + * @param nr
> + * The bit to get.
> + * @param addr
> + * The address to count from.
> + * @return
> + * The value of the bit.
> + */
> +static inline int32_t
Missing __rte_experimental
> +rte_io_get_bit(uint32_t nr, uint64_t *addr)
> +{
> + return __atomic_load_n(addr, __ATOMIC_ACQUIRE) & (1UL << nr);
> +}
> +
More information about the dev
mailing list