git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/mlx5: make tunnel hub list thread safe
[dpdk.git]
/
lib
/
librte_mbuf
/
rte_mbuf.h
diff --git
a/lib/librte_mbuf/rte_mbuf.h
b/lib/librte_mbuf/rte_mbuf.h
index
34679e0
..
17e0b20
100644
(file)
--- a/
lib/librte_mbuf/rte_mbuf.h
+++ b/
lib/librte_mbuf/rte_mbuf.h
@@
-37,7
+37,6
@@
#include <rte_config.h>
#include <rte_mempool.h>
#include <rte_memory.h>
#include <rte_config.h>
#include <rte_mempool.h>
#include <rte_memory.h>
-#include <rte_atomic.h>
#include <rte_prefetch.h>
#include <rte_branch_prediction.h>
#include <rte_byteorder.h>
#include <rte_prefetch.h>
#include <rte_branch_prediction.h>
#include <rte_byteorder.h>
@@
-152,13
+151,6
@@
rte_mbuf_data_iova(const struct rte_mbuf *mb)
return mb->buf_iova + mb->data_off;
}
return mb->buf_iova + mb->data_off;
}
-__rte_deprecated
-static inline phys_addr_t
-rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
-{
- return rte_mbuf_data_iova(mb);
-}
-
/**
* Return the default IO address of the beginning of the mbuf data
*
/**
* Return the default IO address of the beginning of the mbuf data
*
@@
-177,13
+169,6
@@
rte_mbuf_data_iova_default(const struct rte_mbuf *mb)
return mb->buf_iova + RTE_PKTMBUF_HEADROOM;
}
return mb->buf_iova + RTE_PKTMBUF_HEADROOM;
}
-__rte_deprecated
-static inline phys_addr_t
-rte_mbuf_data_dma_addr_default(const struct rte_mbuf *mb)
-{
- return rte_mbuf_data_iova_default(mb);
-}
-
/**
* Return the mbuf owning the data buffer address of an indirect mbuf.
*
/**
* Return the mbuf owning the data buffer address of an indirect mbuf.
*
@@
-365,7
+350,7
@@
rte_pktmbuf_priv_flags(struct rte_mempool *mp)
static inline uint16_t
rte_mbuf_refcnt_read(const struct rte_mbuf *m)
{
static inline uint16_t
rte_mbuf_refcnt_read(const struct rte_mbuf *m)
{
- return
(uint16_t)(rte_atomic16_read(&m->refcnt_atomic)
);
+ return
__atomic_load_n(&m->refcnt, __ATOMIC_RELAXED
);
}
/**
}
/**
@@
-378,14
+363,15
@@
rte_mbuf_refcnt_read(const struct rte_mbuf *m)
static inline void
rte_mbuf_refcnt_set(struct rte_mbuf *m, uint16_t new_value)
{
static inline void
rte_mbuf_refcnt_set(struct rte_mbuf *m, uint16_t new_value)
{
-
rte_atomic16_set(&m->refcnt_atomic, (int16_t)new_value
);
+
__atomic_store_n(&m->refcnt, new_value, __ATOMIC_RELAXED
);
}
/* internal */
static inline uint16_t
__rte_mbuf_refcnt_update(struct rte_mbuf *m, int16_t value)
{
}
/* internal */
static inline uint16_t
__rte_mbuf_refcnt_update(struct rte_mbuf *m, int16_t value)
{
- return (uint16_t)(rte_atomic16_add_return(&m->refcnt_atomic, value));
+ return __atomic_add_fetch(&m->refcnt, (uint16_t)value,
+ __ATOMIC_ACQ_REL);
}
/**
}
/**
@@
-466,7
+452,7
@@
rte_mbuf_refcnt_set(struct rte_mbuf *m, uint16_t new_value)
static inline uint16_t
rte_mbuf_ext_refcnt_read(const struct rte_mbuf_ext_shared_info *shinfo)
{
static inline uint16_t
rte_mbuf_ext_refcnt_read(const struct rte_mbuf_ext_shared_info *shinfo)
{
- return
(uint16_t)(rte_atomic16_read(&shinfo->refcnt_atomic)
);
+ return
__atomic_load_n(&shinfo->refcnt, __ATOMIC_RELAXED
);
}
/**
}
/**
@@
-481,7
+467,7
@@
static inline void
rte_mbuf_ext_refcnt_set(struct rte_mbuf_ext_shared_info *shinfo,
uint16_t new_value)
{
rte_mbuf_ext_refcnt_set(struct rte_mbuf_ext_shared_info *shinfo,
uint16_t new_value)
{
-
rte_atomic16_set(&shinfo->refcnt_atomic, (int16_t)new_value
);
+
__atomic_store_n(&shinfo->refcnt, new_value, __ATOMIC_RELAXED
);
}
/**
}
/**
@@
-505,7
+491,8
@@
rte_mbuf_ext_refcnt_update(struct rte_mbuf_ext_shared_info *shinfo,
return (uint16_t)value;
}
return (uint16_t)value;
}
- return (uint16_t)rte_atomic16_add_return(&shinfo->refcnt_atomic, value);
+ return __atomic_add_fetch(&shinfo->refcnt, (uint16_t)value,
+ __ATOMIC_ACQ_REL);
}
/** Mbuf prefetch */
}
/** Mbuf prefetch */
@@
-1108,6
+1095,7
@@
rte_pktmbuf_attach_extbuf(struct rte_mbuf *m, void *buf_addr,
static inline void
rte_mbuf_dynfield_copy(struct rte_mbuf *mdst, const struct rte_mbuf *msrc)
{
static inline void
rte_mbuf_dynfield_copy(struct rte_mbuf *mdst, const struct rte_mbuf *msrc)
{
+ memcpy(&mdst->dynfield0, msrc->dynfield0, sizeof(mdst->dynfield0));
memcpy(&mdst->dynfield1, msrc->dynfield1, sizeof(mdst->dynfield1));
}
memcpy(&mdst->dynfield1, msrc->dynfield1, sizeof(mdst->dynfield1));
}
@@
-1121,7
+1109,6
@@
__rte_pktmbuf_copy_hdr(struct rte_mbuf *mdst, const struct rte_mbuf *msrc)
mdst->tx_offload = msrc->tx_offload;
mdst->hash = msrc->hash;
mdst->packet_type = msrc->packet_type;
mdst->tx_offload = msrc->tx_offload;
mdst->hash = msrc->hash;
mdst->packet_type = msrc->packet_type;
- mdst->timestamp = msrc->timestamp;
rte_mbuf_dynfield_copy(mdst, msrc);
}
rte_mbuf_dynfield_copy(mdst, msrc);
}
@@
-1304,8
+1291,8
@@
static inline int __rte_pktmbuf_pinned_extbuf_decref(struct rte_mbuf *m)
* Direct usage of add primitive to avoid
* duplication of comparing with one.
*/
* Direct usage of add primitive to avoid
* duplication of comparing with one.
*/
- if (likely(
rte_atomic16_add_return
-
(&shinfo->refcnt_atomic, -1
)))
+ if (likely(
__atomic_add_fetch(&shinfo->refcnt, (uint16_t)-1,
+
__ATOMIC_ACQ_REL
)))
return 1;
/* Reinitialize counter before mbuf freeing. */
return 1;
/* Reinitialize counter before mbuf freeing. */
@@
-1335,10
+1322,10
@@
rte_pktmbuf_prefree_seg(struct rte_mbuf *m)
if (likely(rte_mbuf_refcnt_read(m) == 1)) {
if (!RTE_MBUF_DIRECT(m)) {
if (likely(rte_mbuf_refcnt_read(m) == 1)) {
if (!RTE_MBUF_DIRECT(m)) {
- if (!RTE_MBUF_HAS_EXTBUF(m) ||
- !RTE_MBUF_HAS_PINNED_EXTBUF(m))
- rte_pktmbuf_detach(m);
-
else if (
__rte_pktmbuf_pinned_extbuf_decref(m))
+ rte_pktmbuf_detach(m);
+ if (RTE_MBUF_HAS_EXTBUF(m) &&
+ RTE_MBUF_HAS_PINNED_EXTBUF(m) &&
+
__rte_pktmbuf_pinned_extbuf_decref(m))
return NULL;
}
return NULL;
}
@@
-1352,10
+1339,10
@@
rte_pktmbuf_prefree_seg(struct rte_mbuf *m)
} else if (__rte_mbuf_refcnt_update(m, -1) == 0) {
if (!RTE_MBUF_DIRECT(m)) {
} else if (__rte_mbuf_refcnt_update(m, -1) == 0) {
if (!RTE_MBUF_DIRECT(m)) {
- if (!RTE_MBUF_HAS_EXTBUF(m) ||
- !RTE_MBUF_HAS_PINNED_EXTBUF(m))
- rte_pktmbuf_detach(m);
-
else if (
__rte_pktmbuf_pinned_extbuf_decref(m))
+ rte_pktmbuf_detach(m);
+ if (RTE_MBUF_HAS_EXTBUF(m) &&
+ RTE_MBUF_HAS_PINNED_EXTBUF(m) &&
+
__rte_pktmbuf_pinned_extbuf_decref(m))
return NULL;
}
return NULL;
}
@@
-1536,13
+1523,6
@@
static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m)
return m;
}
return m;
}
-/* deprecated */
-#define rte_pktmbuf_mtophys_offset(m, o) \
- rte_pktmbuf_iova_offset(m, o)
-
-/* deprecated */
-#define rte_pktmbuf_mtophys(m) rte_pktmbuf_iova(m)
-
/**
* A macro that returns the length of the packet.
*
/**
* A macro that returns the length of the packet.
*