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 <zer0@droids-corp.org>
Mon, 4 Dec 2017 16:32:15 +0000 (17:32 +0100)
commit5e0db58d5d0f3be94bbc2db9b266c8a3d3c4107c
tree20e8bbe1b8284f06ff6bc5652e974be55de2b56b
parent224374cc0e3ca44af5141fb7035a97f338d00c18
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