mbuf: fix mbuf free performance with non atomic refcnt
authorOlivier Matz <olivier.matz@6wind.com>
Fri, 1 Dec 2017 15:08:57 +0000 (16:08 +0100)
committerOlivier Matz <olivier.matz@6wind.com>
Fri, 8 Dec 2017 09:51:36 +0000 (10:51 +0100)
commitb91c0f786e2562ab744822bb9ab8ec30e8fcbce5
tree96715af922a5672782966be02c205e8ea2a83ce1
parented67971cf450b37ef70f2d02de291e0b73113050
mbuf: fix mbuf free performance 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")
Suggested-by: Hanoch Haim <hhaim@cisco.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_mbuf/rte_mbuf.h