[PATCH v4 21/22] pdcp: add thread safe processing

Stephen Hemminger stephen at networkplumber.org
Sat May 27 00:11:30 CEST 2023


On Sat, 27 May 2023 02:32:13 +0530
Anoob Joseph <anoobj at marvell.com> wrote:

> +static inline uint32_t
> +pdcp_atomic_inc(uint32_t *val, const bool mt_safe)
> +{
> +	if (mt_safe)
> +		return __atomic_fetch_add(val, 1, __ATOMIC_RELAXED);
> +	else
> +		return (*val)++;
> +}

This is a bad pattern. None of the rest of DPDK does this.
Either be thread safe or not.


More information about the dev mailing list