[dpdk-dev] [PATCH v2] mbuf: optimize rte_mbuf_refcnt_update

Bruce Richardson bruce.richardson at intel.com
Tue Jun 9 14:57:34 CEST 2015


On Mon, Jun 08, 2015 at 04:57:22PM +0200, Olivier Matz wrote:
> In __rte_pktmbuf_prefree_seg(), there was an optimization to avoid using
> a costly atomic operation when updating the mbuf reference counter if
> its value is 1. Indeed, it means that we are the only owner of the mbuf,
> and therefore nobody can change it at the same time.
> 
> We can generalize this optimization directly in rte_mbuf_refcnt_update()
> so the other callers of this function, like rte_pktmbuf_attach(), can
> also take advantage of this optimization.
> 
> Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>

Acked-by: Bruce Richardson <bruce.richardson at intel.com>



More information about the dev mailing list