90 #define PKT_RX_VLAN_PKT (1ULL << 0)
92 #define PKT_RX_RSS_HASH (1ULL << 1)
93 #define PKT_RX_FDIR (1ULL << 2)
102 #define PKT_RX_L4_CKSUM_BAD (1ULL << 3)
111 #define PKT_RX_IP_CKSUM_BAD (1ULL << 4)
113 #define PKT_RX_EIP_CKSUM_BAD (1ULL << 5)
120 #define PKT_RX_VLAN_STRIPPED (1ULL << 6)
130 #define PKT_RX_IP_CKSUM_MASK ((1ULL << 4) | (1ULL << 7))
132 #define PKT_RX_IP_CKSUM_UNKNOWN 0
133 #define PKT_RX_IP_CKSUM_BAD (1ULL << 4)
134 #define PKT_RX_IP_CKSUM_GOOD (1ULL << 7)
135 #define PKT_RX_IP_CKSUM_NONE ((1ULL << 4) | (1ULL << 7))
145 #define PKT_RX_L4_CKSUM_MASK ((1ULL << 3) | (1ULL << 8))
147 #define PKT_RX_L4_CKSUM_UNKNOWN 0
148 #define PKT_RX_L4_CKSUM_BAD (1ULL << 3)
149 #define PKT_RX_L4_CKSUM_GOOD (1ULL << 8)
150 #define PKT_RX_L4_CKSUM_NONE ((1ULL << 3) | (1ULL << 8))
152 #define PKT_RX_IEEE1588_PTP (1ULL << 9)
153 #define PKT_RX_IEEE1588_TMST (1ULL << 10)
154 #define PKT_RX_FDIR_ID (1ULL << 13)
155 #define PKT_RX_FDIR_FLX (1ULL << 14)
164 #define PKT_RX_QINQ_STRIPPED (1ULL << 15)
171 #define PKT_RX_QINQ_PKT PKT_RX_QINQ_STRIPPED
178 #define PKT_RX_LRO (1ULL << 16)
189 #define PKT_TX_TUNNEL_VXLAN (0x1ULL << 45)
190 #define PKT_TX_TUNNEL_GRE (0x2ULL << 45)
191 #define PKT_TX_TUNNEL_IPIP (0x3ULL << 45)
192 #define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45)
194 #define PKT_TX_TUNNEL_MASK (0xFULL << 45)
199 #define PKT_TX_QINQ_PKT (1ULL << 49)
210 #define PKT_TX_TCP_SEG (1ULL << 50)
212 #define PKT_TX_IEEE1588_TMST (1ULL << 51)
222 #define PKT_TX_L4_NO_CKSUM (0ULL << 52)
223 #define PKT_TX_TCP_CKSUM (1ULL << 52)
224 #define PKT_TX_SCTP_CKSUM (2ULL << 52)
225 #define PKT_TX_UDP_CKSUM (3ULL << 52)
226 #define PKT_TX_L4_MASK (3ULL << 52)
234 #define PKT_TX_IP_CKSUM (1ULL << 54)
242 #define PKT_TX_IPV4 (1ULL << 55)
250 #define PKT_TX_IPV6 (1ULL << 56)
252 #define PKT_TX_VLAN_PKT (1ULL << 57)
260 #define PKT_TX_OUTER_IP_CKSUM (1ULL << 58)
267 #define PKT_TX_OUTER_IPV4 (1ULL << 59)
274 #define PKT_TX_OUTER_IPV6 (1ULL << 60)
276 #define __RESERVED (1ULL << 61)
278 #define IND_ATTACHED_MBUF (1ULL << 62)
281 #define CTRL_MBUF_FLAG (1ULL << 63)
284 #define RTE_MBUF_PRIV_ALIGN 8
342 #define RTE_MBUF_DEFAULT_DATAROOM 2048
343 #define RTE_MBUF_DEFAULT_BUF_SIZE \
344 (RTE_MBUF_DEFAULT_DATAROOM + RTE_PKTMBUF_HEADROOM)
390 MARKER rx_descriptor_fields1;
447 MARKER cacheline1 __rte_cache_min_aligned;
518 #if RTE_CACHE_LINE_SIZE == 64
593 #define RTE_MBUF_INDIRECT(mb) ((mb)->ol_flags & IND_ATTACHED_MBUF)
598 #define RTE_MBUF_DIRECT(mb) (!RTE_MBUF_INDIRECT(mb))
611 #ifdef RTE_LIBRTE_MBUF_DEBUG
614 #define __rte_mbuf_sanity_check(m, is_h) rte_mbuf_sanity_check(m, is_h)
619 #define __rte_mbuf_sanity_check(m, is_h) do { } while (0)
623 #ifdef RTE_MBUF_REFCNT_ATOMIC
632 static inline uint16_t
660 static inline uint16_t
673 return (uint16_t)value;
684 static inline uint16_t
694 static inline uint16_t
712 #define RTE_MBUF_PREFETCH_TO_FREE(m) do { \
770 static inline void __attribute__((always_inline))
771 __rte_mbuf_raw_free(struct
rte_mbuf *m)
799 void *m,
unsigned i);
813 #define rte_ctrlmbuf_alloc(mp) rte_pktmbuf_alloc(mp)
821 #define rte_ctrlmbuf_free(m) rte_pktmbuf_free(m)
831 #define rte_ctrlmbuf_data(m) ((char *)((m)->buf_addr) + (m)->data_off)
841 #define rte_ctrlmbuf_len(m) rte_pktmbuf_data_len(m)
880 void *m,
unsigned i);
938 unsigned cache_size, uint16_t priv_size, uint16_t data_room_size,
952 static inline uint16_t
973 static inline uint16_t
992 m->data_off = (uint16_t)
RTE_MIN((uint16_t)RTE_PKTMBUF_HEADROOM,
1058 struct rte_mbuf **mbufs,
unsigned count)
1072 switch (count % 4) {
1074 while (idx != count) {
1136 mi->data_off = m->data_off;
1171 uint32_t mbuf_size, buf_len;
1175 mbuf_size = (uint32_t)(
sizeof(
struct rte_mbuf) + priv_size);
1179 m->
buf_addr = (
char *)m + mbuf_size;
1181 m->
buf_len = (uint16_t)buf_len;
1187 __rte_mbuf_raw_free(md);
1190 static inline struct rte_mbuf* __attribute__((always_inline))
1191 __rte_pktmbuf_prefree_seg(struct
rte_mbuf *m)
1213 static inline void __attribute__((always_inline))
1216 if (
likely(NULL != (m = __rte_pktmbuf_prefree_seg(m)))) {
1218 __rte_mbuf_raw_free(m);
1282 }
while ((md = md->
next) != NULL &&
1316 }
while ((m = m->
next) != NULL);
1359 while (m->
next != NULL)
1378 #define rte_pktmbuf_mtod_offset(m, t, o) \
1379 ((t)((char *)(m)->buf_addr + (m)->data_off + (o)))
1393 #define rte_pktmbuf_mtod(m, t) rte_pktmbuf_mtod_offset(m, t, 0)
1404 #define rte_pktmbuf_mtophys_offset(m, o) \
1405 (phys_addr_t)((m)->buf_physaddr + (m)->data_off + (o))
1414 #define rte_pktmbuf_mtophys(m) rte_pktmbuf_mtophys_offset(m, 0)
1424 #define rte_pktmbuf_pkt_len(m) ((m)->pkt_len)
1434 #define rte_pktmbuf_data_len(m) ((m)->data_len)
1462 m->data_off = (uint16_t)(m->data_off - len);
1466 return (
char *)m->
buf_addr + m->data_off;
1498 return (
char*) tail;
1526 m->data_off = (uint16_t)(m->data_off + len);
1528 return (
char *)m->
buf_addr + m->data_off;
1578 const void *__rte_pktmbuf_read(
const struct rte_mbuf *m, uint32_t off,
1579 uint32_t len,
void *buf);
1602 uint32_t off, uint32_t len,
void *buf)
1607 return __rte_pktmbuf_read(m, off, len, buf);
1636 cur_tail->
next = tail;
static void rte_pktmbuf_reset(struct rte_mbuf *m)
uint16_t mbuf_data_room_size
static int rte_mempool_get(struct rte_mempool *mp, void **obj_p)
static int16_t rte_atomic16_read(const rte_atomic16_t *v)
static struct rte_mbuf * rte_pktmbuf_alloc(struct rte_mempool *mp)
static void rte_pktmbuf_free_seg(struct rte_mbuf *m)
__extension__ typedef void * MARKER[0]
#define RTE_MBUF_DIRECT(mb)
#define IND_ATTACHED_MBUF
static uint16_t rte_pktmbuf_priv_size(struct rte_mempool *mp)
static void rte_pktmbuf_free(struct rte_mbuf *m)
static phys_addr_t rte_mempool_virt2phy(__rte_unused const struct rte_mempool *mp, const void *elt)
void rte_pktmbuf_pool_init(struct rte_mempool *mp, void *opaque_arg)
struct rte_mbuf::@74::@82 sched
static struct rte_mbuf * rte_pktmbuf_clone(struct rte_mbuf *md, struct rte_mempool *mp)
static struct rte_mbuf * rte_mbuf_from_indirect(struct rte_mbuf *mi)
static int rte_pktmbuf_chain(struct rte_mbuf *head, struct rte_mbuf *tail)
__extension__ typedef uint8_t MARKER8[0]
void rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)
static uint16_t rte_pktmbuf_headroom(const struct rte_mbuf *m)
static int rte_pktmbuf_alloc_bulk(struct rte_mempool *pool, struct rte_mbuf **mbufs, unsigned count)
static void rte_pktmbuf_reset_headroom(struct rte_mbuf *m)
static void rte_mbuf_prefetch_part2(struct rte_mbuf *m)
static int rte_mempool_get_bulk(struct rte_mempool *mp, void **obj_table, unsigned n)
static int rte_pktmbuf_is_contiguous(const struct rte_mbuf *m)
int rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
static uint16_t rte_pktmbuf_tailroom(const struct rte_mbuf *m)
__extension__ typedef uint64_t MARKER64[0]
void rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header)
#define __rte_mbuf_sanity_check(m, is_h)
const char * rte_get_tx_ol_flag_name(uint64_t mask)
static uint16_t rte_mbuf_refcnt_read(const struct rte_mbuf *m)
static void rte_atomic16_set(rte_atomic16_t *v, int16_t new_value)
static char * rte_pktmbuf_adj(struct rte_mbuf *m, uint16_t len)
static void rte_pktmbuf_attach(struct rte_mbuf *mi, struct rte_mbuf *m)
static int16_t rte_atomic16_add_return(rte_atomic16_t *v, int16_t inc)
static int rte_is_ctrlmbuf(struct rte_mbuf *m)
static void rte_pktmbuf_detach(struct rte_mbuf *m)
#define rte_pktmbuf_data_len(m)
static uint16_t rte_mbuf_refcnt_update(struct rte_mbuf *m, int16_t value)
static uint16_t rte_pktmbuf_data_room_size(struct rte_mempool *mp)
const char * rte_get_rx_ol_flag_name(uint64_t mask)
static phys_addr_t rte_mbuf_data_dma_addr(const struct rte_mbuf *mb)
struct rte_mbuf::@74::@81 fdir
void rte_pktmbuf_init(struct rte_mempool *mp, void *opaque_arg, void *m, unsigned i)
struct rte_mempool * pool
static char * rte_pktmbuf_append(struct rte_mbuf *m, uint16_t len)
static void rte_mbuf_refcnt_set(struct rte_mbuf *m, uint16_t new_value)
static int rte_pktmbuf_trim(struct rte_mbuf *m, uint16_t len)
static char * rte_mbuf_to_baddr(struct rte_mbuf *md)
static const void * rte_pktmbuf_read(const struct rte_mbuf *m, uint32_t off, uint32_t len, void *buf)
static char * rte_pktmbuf_prepend(struct rte_mbuf *m, uint16_t len)
static struct rte_mbuf * rte_mbuf_raw_alloc(struct rte_mempool *mp)
static void rte_pktmbuf_refcnt_update(struct rte_mbuf *m, int16_t v)
#define RTE_PTR_SUB(ptr, x)
#define __rte_cache_aligned
static struct rte_mbuf * rte_pktmbuf_lastseg(struct rte_mbuf *m)
static void rte_mbuf_prefetch_part1(struct rte_mbuf *m)
rte_atomic16_t refcnt_atomic
static void * rte_mempool_get_priv(struct rte_mempool *mp)
char name[RTE_MEMZONE_NAMESIZE]
void rte_ctrlmbuf_init(struct rte_mempool *mp, void *opaque_arg, void *m, unsigned i)
static void rte_mempool_put(struct rte_mempool *mp, void *obj)
#define RTE_MBUF_INDIRECT(mb)
#define rte_pktmbuf_mtod_offset(m, t, o)
int rte_get_rx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
static phys_addr_t rte_mbuf_data_dma_addr_default(const struct rte_mbuf *mb)
static void rte_prefetch0(const volatile void *p)
struct rte_mempool * rte_pktmbuf_pool_create(const char *name, unsigned n, unsigned cache_size, uint16_t priv_size, uint16_t data_room_size, int socket_id)