src/dpdk/lib/librte_mbuf/rte_mbuf.h
static inline uint16_t
rte_mbuf_refcnt_update(struct rte_mbuf *m, int16_t value)
{
#ifndef TREX_PATCH

	/*
	 * The atomic_add is an expensive operation, so we don't want to
	 * call it in the case where we know we are the unique holder of
	 * this mbuf (i.e. ref_cnt == 1). Otherwise, an atomic
	 * operation has to be used because concurrent accesses on the
	 * reference counter can occur.
	 */
	if (likely(rte_mbuf_refcnt_read(m) == 1)) {
		++value;
		rte_mbuf_refcnt_set(m, (uint16_t)value);
		return (uint16_t)value;
	}

	return __rte_mbuf_refcnt_update(m, value);
#else
    if (likely(m->m_core_locality == RTE_MBUF_CORE_LOCALITY_LOCAL)) {
        m->refcnt = (uint16_t)(m->refcnt + value);
        return m->refcnt;
    } else {
        if ( m->m_core_locality == RTE_MBUF_CORE_LOCALITY_CONST ){
            /* no ref count */
            return m->refcnt;
        }else{
			return __rte_mbuf_refcnt_update(m, value);
        }
    }
#endif
}
/**
 * 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
 */
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
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
static inline uint16_t
rte_mbuf_refcnt_update(struct rte_mbuf *m, int16_t value)
{
#ifndef TREX_PATCH
	if (likely(rte_mbuf_refcnt_read(m) == 1)) {
		++value;
		rte_mbuf_refcnt_set(m, (uint16_t)value);
		return (uint16_t)value;
	}
	return __rte_mbuf_refcnt_update(m, value);
#else
    if (likely(m->m_core_locality == RTE_MBUF_CORE_LOCALITY_LOCAL)) {
        m->refcnt = (uint16_t)(m->refcnt + value);
        return m->refcnt;
    } else {
        if ( m->m_core_locality == RTE_MBUF_CORE_LOCALITY_CONST ){
            return m->refcnt;
        }else{
			return __rte_mbuf_refcnt_update(m, value);
        }
    }
#endif
}
static inline uint16_t rte_mbuf_refcnt_update ( struct rte_mbuf * m , int16_t value ) { #ifndef TREX_PATCH if ( likely ( rte_mbuf_refcnt_read ( m ) == 1 ) ) { ++ value ; rte_mbuf_refcnt_set ( m , ( uint16_t ) value ) ; return ( uint16_t ) value ; } return __rte_mbuf_refcnt_update ( m , value ) ; #else if ( likely ( m -> m_core_locality == RTE_MBUF_CORE_LOCALITY_LOCAL ) ) { m -> refcnt = ( uint16_t ) ( m -> refcnt + value ) ; return m -> refcnt ; } else { if ( m -> m_core_locality == RTE_MBUF_CORE_LOCALITY_CONST ) { return m -> refcnt ; } else { return __rte_mbuf_refcnt_update ( m , value ) ; } } #endif }
Adds given value to an mbuf's refcnt and returns its new value.
Adds given value to an mbuf ' s refcnt and returns its new value .
/*
	 * The atomic_add is an expensive operation, so we don't want to
	 * call it in the case where we know we are the unique holder of
	 * this mbuf (i.e. ref_cnt == 1). Otherwise, an atomic
	 * operation has to be used because concurrent accesses on the
	 * reference counter can occur.
	 */ /* no ref count */