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)
188 #define PKT_TX_MACSEC (1ULL << 44)
195 #define PKT_TX_TUNNEL_VXLAN (0x1ULL << 45)
196 #define PKT_TX_TUNNEL_GRE (0x2ULL << 45)
197 #define PKT_TX_TUNNEL_IPIP (0x3ULL << 45)
198 #define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45)
200 #define PKT_TX_TUNNEL_MASK (0xFULL << 45)
205 #define PKT_TX_QINQ_PKT (1ULL << 49)
220 #define PKT_TX_TCP_SEG (1ULL << 50)
222 #define PKT_TX_IEEE1588_TMST (1ULL << 51)
235 #define PKT_TX_L4_NO_CKSUM (0ULL << 52)
236 #define PKT_TX_TCP_CKSUM (1ULL << 52)
237 #define PKT_TX_SCTP_CKSUM (2ULL << 52)
238 #define PKT_TX_UDP_CKSUM (3ULL << 52)
239 #define PKT_TX_L4_MASK (3ULL << 52)
248 #define PKT_TX_IP_CKSUM (1ULL << 54)
256 #define PKT_TX_IPV4 (1ULL << 55)
264 #define PKT_TX_IPV6 (1ULL << 56)
266 #define PKT_TX_VLAN_PKT (1ULL << 57)
276 #define PKT_TX_OUTER_IP_CKSUM (1ULL << 58)
283 #define PKT_TX_OUTER_IPV4 (1ULL << 59)
290 #define PKT_TX_OUTER_IPV6 (1ULL << 60)
296 #define PKT_TX_OFFLOAD_MASK ( \
299 PKT_TX_OUTER_IP_CKSUM | \
301 PKT_TX_IEEE1588_TMST | \
304 PKT_TX_TUNNEL_MASK | \
307 #define __RESERVED (1ULL << 61)
309 #define IND_ATTACHED_MBUF (1ULL << 62)
312 #define CTRL_MBUF_FLAG (1ULL << 63)
315 #define RTE_MBUF_PRIV_ALIGN 8
373 #define RTE_MBUF_DEFAULT_DATAROOM 2048
374 #define RTE_MBUF_DEFAULT_BUF_SIZE \
375 (RTE_MBUF_DEFAULT_DATAROOM + RTE_PKTMBUF_HEADROOM)
421 MARKER rx_descriptor_fields1;
478 MARKER cacheline1 __rte_cache_min_aligned;
549 #if RTE_CACHE_LINE_SIZE == 64
624 #define RTE_MBUF_INDIRECT(mb) ((mb)->ol_flags & IND_ATTACHED_MBUF)
629 #define RTE_MBUF_DIRECT(mb) (!RTE_MBUF_INDIRECT(mb))
642 #ifdef RTE_LIBRTE_MBUF_DEBUG
645 #define __rte_mbuf_sanity_check(m, is_h) rte_mbuf_sanity_check(m, is_h)
650 #define __rte_mbuf_sanity_check(m, is_h) do { } while (0)
654 #ifdef RTE_MBUF_REFCNT_ATOMIC
663 static inline uint16_t
691 static inline uint16_t
714 static inline uint16_t
724 static inline uint16_t
742 #define RTE_MBUF_PREFETCH_TO_FREE(m) do { \
800 static inline void __attribute__((always_inline))
801 __rte_mbuf_raw_free(struct
rte_mbuf *m)
829 void *m,
unsigned i);
843 #define rte_ctrlmbuf_alloc(mp) rte_pktmbuf_alloc(mp)
851 #define rte_ctrlmbuf_free(m) rte_pktmbuf_free(m)
861 #define rte_ctrlmbuf_data(m) ((char *)((m)->buf_addr) + (m)->data_off)
871 #define rte_ctrlmbuf_len(m) rte_pktmbuf_data_len(m)
910 void *m,
unsigned i);
968 unsigned cache_size, uint16_t priv_size, uint16_t data_room_size,
982 static inline uint16_t
1003 static inline uint16_t
1022 m->data_off =
RTE_MIN(RTE_PKTMBUF_HEADROOM, (uint16_t)m->
buf_len);
1086 struct rte_mbuf **mbufs,
unsigned count)
1100 switch (count % 4) {
1102 while (idx != count) {
1163 mi->data_off = m->data_off;
1198 uint32_t mbuf_size, buf_len, priv_size;
1201 mbuf_size =
sizeof(
struct rte_mbuf) + priv_size;
1205 m->
buf_addr = (
char *)m + mbuf_size;
1207 m->
buf_len = (uint16_t)buf_len;
1213 __rte_mbuf_raw_free(md);
1216 static inline struct rte_mbuf* __attribute__((always_inline))
1217 __rte_pktmbuf_prefree_seg(struct
rte_mbuf *m)
1239 static inline void __attribute__((always_inline))
1242 if (
likely(NULL != (m = __rte_pktmbuf_prefree_seg(m)))) {
1244 __rte_mbuf_raw_free(m);
1307 }
while ((md = md->
next) != NULL &&
1341 }
while ((m = m->
next) != NULL);
1386 while (m2->
next != NULL)
1405 #define rte_pktmbuf_mtod_offset(m, t, o) \
1406 ((t)((char *)(m)->buf_addr + (m)->data_off + (o)))
1420 #define rte_pktmbuf_mtod(m, t) rte_pktmbuf_mtod_offset(m, t, 0)
1431 #define rte_pktmbuf_mtophys_offset(m, o) \
1432 (phys_addr_t)((m)->buf_physaddr + (m)->data_off + (o))
1441 #define rte_pktmbuf_mtophys(m) rte_pktmbuf_mtophys_offset(m, 0)
1451 #define rte_pktmbuf_pkt_len(m) ((m)->pkt_len)
1461 #define rte_pktmbuf_data_len(m) ((m)->data_len)
1490 return (
char *)m->
buf_addr + m->data_off;
1522 return (
char*) tail;
1549 return (
char *)m->
buf_addr + m->data_off;
1599 const void *__rte_pktmbuf_read(
const struct rte_mbuf *m, uint32_t off,
1600 uint32_t len,
void *buf);
1623 uint32_t off, uint32_t len,
void *buf)
1628 return __rte_pktmbuf_read(m, off, len, buf);
1657 cur_tail->
next = tail;
1683 uint64_t inner_l3_offset = m->
l2_len;
1709 !(ol_flags & PKT_TX_IP_CKSUM)))
1713 if ((ol_flags & PKT_TX_OUTER_IP_CKSUM) &&
1735 int seg_len, copy_len;