* Add given value to refcnt of an external buffer and return its new * value. * * @param shinfo * Shared data of the external buffer. * @param value * Value to add/subtract * @return * Updated value */
| 493 | * Updated value |
| 494 | */ |
| 495 | static inline uint16_t |
| 496 | rte_mbuf_ext_refcnt_update(struct rte_mbuf_ext_shared_info *shinfo, |
| 497 | int16_t value) |
| 498 | { |
| 499 | if (likely(rte_mbuf_ext_refcnt_read(shinfo) == 1)) { |
| 500 | ++value; |
| 501 | rte_mbuf_ext_refcnt_set(shinfo, (uint16_t)value); |
| 502 | return (uint16_t)value; |
| 503 | } |
| 504 | |
| 505 | return rte_atomic_fetch_add_explicit(&shinfo->refcnt, value, |
| 506 | rte_memory_order_acq_rel) + value; |
| 507 | } |
| 508 | |
| 509 | /** Mbuf prefetch */ |
| 510 | #define RTE_MBUF_PREFETCH_TO_FREE(m) do { \ |