> -----Original Message-----
> From: dev <[email protected]> On Behalf Of Phil Yang
> Sent: Tuesday, July 7, 2020 6:11 PM
> To: [email protected]; [email protected]
> Cc: [email protected]; Honnappa Nagarahalli
> <[email protected]>; [email protected]; Ruifeng Wang
> <[email protected]>; nd <[email protected]>
> Subject: [dpdk-dev] [PATCH v2] mbuf: use C11 atomics for refcnt operations
>
> Use C11 atomics with explicit ordering instead of rte_atomic ops which
> enforce unnecessary barriers on aarch64.
>
> Signed-off-by: Phil Yang <[email protected]>
> Reviewed-by: Ruifeng Wang <[email protected]>
> ---
> v2:
> Fix ABI issue: revert the rte_mbuf_ext_shared_info struct refcnt field
> to refcnt_atomic.
>
<snip>
> diff --git a/lib/librte_mbuf/rte_mbuf_core.h
> b/lib/librte_mbuf/rte_mbuf_core.h
> index 16600f1..806313a 100644
> --- a/lib/librte_mbuf/rte_mbuf_core.h
> +++ b/lib/librte_mbuf/rte_mbuf_core.h
> @@ -18,7 +18,6 @@
>
> #include <stdint.h>
> #include <rte_compat.h>
> -#include <generic/rte_atomic.h>
>
> #ifdef __cplusplus
> extern "C" {
> @@ -495,12 +494,8 @@ struct rte_mbuf {
> * or non-atomic) is controlled by the
> CONFIG_RTE_MBUF_REFCNT_ATOMIC
> * config option.
> */
> - RTE_STD_C11
> - union {
> - rte_atomic16_t refcnt_atomic; /**< Atomically accessed
> refcnt */
> - /** Non-atomically accessed refcnt */
> - uint16_t refcnt;
> - };
> + uint16_t refcnt;
> +
> uint16_t nb_segs; /**< Number of segments. */
>
> /** Input port (16 bits to support more than 256 virtual ports).
> @@ -679,7 +674,7 @@ typedef void
> (*rte_mbuf_extbuf_free_callback_t)(void *addr, void *opaque);
> struct rte_mbuf_ext_shared_info {
> rte_mbuf_extbuf_free_callback_t free_cb; /**< Free callback
> function */
> void *fcb_opaque; /**< Free callback argument */
> - rte_atomic16_t refcnt_atomic; /**< Atomically accessed refcnt */
> + uint16_t refcnt_atomic; /**< Atomically accessed refcnt */
It still causes an ABI check failure in Travis CI on this type change.
I think we need an exception in libabigail.abignore for this.
Thanks,
Phil
> };
>
> /**< Maximum number of nb_segs allowed. */
> --
> 2.7.4