mbuf: fix performance of freeing with non atomic refcnt
authorOlivier Matz <olivier.matz@6wind.com>
Fri, 8 Dec 2017 15:46:51 +0000 (16:46 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 18 Jan 2018 23:43:56 +0000 (00:43 +0100)
commit6d714a237d8a306837a5f87711f9af9063376fed
tree509a4bb77b99575c7178e6bd85e0d92f2444bb19
parent89769e5de7d54e0e837c50bd963c90f0468d9102
mbuf: fix performance of freeing with non atomic refcnt

When RTE_MBUF_REFCNT_ATOMIC=n, the decrement of the mbuf reference
counter uses an atomic operation. This is not necessary and impacts
the performance (seen with TRex traffic generator).

We cannot replace rte_atomic16_add_return() by rte_mbuf_refcnt_update()
because it would add an additional check.

Solves this by introducing __rte_mbuf_refcnt_update(), which
updates the reference counter without doing anything else.

Fixes: 8f094a9ac5d7 ("mbuf: set mbuf fields while in pool")
Cc: stable@dpdk.org
Suggested-by: Hanoch Haim <hhaim@cisco.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_mbuf/rte_mbuf.h