[dpdk-dev] [PATCH v4] mbuf: fix mbuf free performance with non atomic refcnt

Stephen Hemminger stephen at networkplumber.org
Fri Dec 8 17:37:02 CET 2017


On Fri,  8 Dec 2017 16:46:51 +0100
Olivier Matz <olivier.matz at 6wind.com> wrote:

> +/* internal */
> +static inline uint16_t
> +__rte_mbuf_refcnt_update(struct rte_mbuf *m, int16_t value)
> +{
> +	return (uint16_t)(rte_atomic16_add_return(&m->refcnt_atomic, value));
> +}

You don't need the cast (or paren's around rte_atomic16_addr_return)
because C has implicit cast to return value.


More information about the dev mailing list