MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_mbuf_refcnt_update

Function rte_mbuf_refcnt_update

dpdk/lib/mbuf/rte_mbuf.h:397–414  ·  view source on GitHub ↗

* Adds given value to an mbuf's refcnt and returns its new value. * @param m * Mbuf to update * @param value * Value to add/subtract * @return * Updated value */

Source from the content-addressed store, hash-verified

395 * Updated value
396 */
397static inline uint16_t
398rte_mbuf_refcnt_update(struct rte_mbuf *m, int16_t value)
399{
400 /*
401 * The atomic_add is an expensive operation, so we don't want to
402 * call it in the case where we know we are the unique holder of
403 * this mbuf (i.e. ref_cnt == 1). Otherwise, an atomic
404 * operation has to be used because concurrent accesses on the
405 * reference counter can occur.
406 */
407 if (likely(rte_mbuf_refcnt_read(m) == 1)) {
408 ++value;
409 rte_mbuf_refcnt_set(m, (uint16_t)value);
410 return (uint16_t)value;
411 }
412
413 return __rte_mbuf_refcnt_update(m, value);
414}
415
416#else /* ! RTE_MBUF_REFCNT_ATOMIC */
417

Callers 12

rte_pktmbuf_attachFunction · 0.85
octeontx_pktmbuf_detachFunction · 0.85
octeontx_prefree_segFunction · 0.85
eth_mbuf_to_sg_fdFunction · 0.85
eth_mbuf_to_fdFunction · 0.85
cnxk_pktmbuf_detachFunction · 0.85
cnxk_nix_prefree_segFunction · 0.85
dpaa_eth_mbuf_to_sg_fdFunction · 0.85
pkt_burst_flow_genFunction · 0.85

Calls 3

rte_mbuf_refcnt_readFunction · 0.85
rte_mbuf_refcnt_setFunction · 0.85
__rte_mbuf_refcnt_updateFunction · 0.85

Tested by

no test coverage detected