6 #ifndef _RTE_MBUF_CORE_H_ 7 #define _RTE_MBUF_CORE_H_ 23 #include <rte_stdatomic.h> 51 #define RTE_MBUF_F_RX_VLAN (1ULL << 0) 54 #define RTE_MBUF_F_RX_RSS_HASH (1ULL << 1) 57 #define RTE_MBUF_F_RX_FDIR (1ULL << 2) 63 #define RTE_MBUF_F_RX_OUTER_IP_CKSUM_BAD (1ULL << 5) 71 #define RTE_MBUF_F_RX_VLAN_STRIPPED (1ULL << 6) 81 #define RTE_MBUF_F_RX_IP_CKSUM_MASK ((1ULL << 4) | (1ULL << 7)) 83 #define RTE_MBUF_F_RX_IP_CKSUM_UNKNOWN 0 84 #define RTE_MBUF_F_RX_IP_CKSUM_BAD (1ULL << 4) 85 #define RTE_MBUF_F_RX_IP_CKSUM_GOOD (1ULL << 7) 86 #define RTE_MBUF_F_RX_IP_CKSUM_NONE ((1ULL << 4) | (1ULL << 7)) 96 #define RTE_MBUF_F_RX_L4_CKSUM_MASK ((1ULL << 3) | (1ULL << 8)) 98 #define RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN 0 99 #define RTE_MBUF_F_RX_L4_CKSUM_BAD (1ULL << 3) 100 #define RTE_MBUF_F_RX_L4_CKSUM_GOOD (1ULL << 8) 101 #define RTE_MBUF_F_RX_L4_CKSUM_NONE ((1ULL << 3) | (1ULL << 8)) 104 #define RTE_MBUF_F_RX_IEEE1588_PTP (1ULL << 9) 107 #define RTE_MBUF_F_RX_IEEE1588_TMST (1ULL << 10) 110 #define RTE_MBUF_F_RX_FDIR_ID (1ULL << 13) 113 #define RTE_MBUF_F_RX_FDIR_FLX (1ULL << 14) 130 #define RTE_MBUF_F_RX_QINQ_STRIPPED (1ULL << 15) 137 #define RTE_MBUF_F_RX_LRO (1ULL << 16) 144 #define RTE_MBUF_F_RX_SEC_OFFLOAD (1ULL << 18) 149 #define RTE_MBUF_F_RX_SEC_OFFLOAD_FAILED (1ULL << 19) 159 #define RTE_MBUF_F_RX_QINQ (1ULL << 20) 176 #define RTE_MBUF_F_RX_OUTER_L4_CKSUM_MASK ((1ULL << 21) | (1ULL << 22)) 178 #define RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN 0 179 #define RTE_MBUF_F_RX_OUTER_L4_CKSUM_BAD (1ULL << 21) 180 #define RTE_MBUF_F_RX_OUTER_L4_CKSUM_GOOD (1ULL << 22) 181 #define RTE_MBUF_F_RX_OUTER_L4_CKSUM_INVALID ((1ULL << 21) | (1ULL << 22)) 185 #define RTE_MBUF_F_FIRST_FREE (1ULL << 23) 186 #define RTE_MBUF_F_LAST_FREE (1ULL << 40) 199 #define RTE_MBUF_F_TX_OUTER_UDP_CKSUM (1ULL << 41) 206 #define RTE_MBUF_F_TX_UDP_SEG (1ULL << 42) 214 #define RTE_MBUF_F_TX_SEC_OFFLOAD (1ULL << 43) 220 #define RTE_MBUF_F_TX_MACSEC (1ULL << 44) 231 #define RTE_MBUF_F_TX_TUNNEL_VXLAN (0x1ULL << 45) 232 #define RTE_MBUF_F_TX_TUNNEL_GRE (0x2ULL << 45) 233 #define RTE_MBUF_F_TX_TUNNEL_IPIP (0x3ULL << 45) 234 #define RTE_MBUF_F_TX_TUNNEL_GENEVE (0x4ULL << 45) 236 #define RTE_MBUF_F_TX_TUNNEL_MPLSINUDP (0x5ULL << 45) 237 #define RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE (0x6ULL << 45) 238 #define RTE_MBUF_F_TX_TUNNEL_GTP (0x7ULL << 45) 239 #define RTE_MBUF_F_TX_TUNNEL_ESP (0x8ULL << 45) 251 #define RTE_MBUF_F_TX_TUNNEL_IP (0xDULL << 45) 264 #define RTE_MBUF_F_TX_TUNNEL_UDP (0xEULL << 45) 266 #define RTE_MBUF_F_TX_TUNNEL_MASK (0xFULL << 45) 273 #define RTE_MBUF_F_TX_QINQ (1ULL << 49) 284 #define RTE_MBUF_F_TX_TCP_SEG (1ULL << 50) 287 #define RTE_MBUF_F_TX_IEEE1588_TMST (1ULL << 51) 300 #define RTE_MBUF_F_TX_L4_NO_CKSUM (0ULL << 52) 303 #define RTE_MBUF_F_TX_TCP_CKSUM (1ULL << 52) 306 #define RTE_MBUF_F_TX_SCTP_CKSUM (2ULL << 52) 309 #define RTE_MBUF_F_TX_UDP_CKSUM (3ULL << 52) 312 #define RTE_MBUF_F_TX_L4_MASK (3ULL << 52) 320 #define RTE_MBUF_F_TX_IP_CKSUM (1ULL << 54) 328 #define RTE_MBUF_F_TX_IPV4 (1ULL << 55) 336 #define RTE_MBUF_F_TX_IPV6 (1ULL << 56) 343 #define RTE_MBUF_F_TX_VLAN (1ULL << 57) 351 #define RTE_MBUF_F_TX_OUTER_IP_CKSUM (1ULL << 58) 358 #define RTE_MBUF_F_TX_OUTER_IPV4 (1ULL << 59) 365 #define RTE_MBUF_F_TX_OUTER_IPV6 (1ULL << 60) 371 #define RTE_MBUF_F_TX_OFFLOAD_MASK ( \ 372 RTE_MBUF_F_TX_OUTER_IPV6 | \ 373 RTE_MBUF_F_TX_OUTER_IPV4 | \ 374 RTE_MBUF_F_TX_OUTER_IP_CKSUM | \ 375 RTE_MBUF_F_TX_VLAN | \ 376 RTE_MBUF_F_TX_IPV6 | \ 377 RTE_MBUF_F_TX_IPV4 | \ 378 RTE_MBUF_F_TX_IP_CKSUM | \ 379 RTE_MBUF_F_TX_L4_MASK | \ 380 RTE_MBUF_F_TX_IEEE1588_TMST | \ 381 RTE_MBUF_F_TX_TCP_SEG | \ 382 RTE_MBUF_F_TX_QINQ | \ 383 RTE_MBUF_F_TX_TUNNEL_MASK | \ 384 RTE_MBUF_F_TX_MACSEC | \ 385 RTE_MBUF_F_TX_SEC_OFFLOAD | \ 386 RTE_MBUF_F_TX_UDP_SEG | \ 387 RTE_MBUF_F_TX_OUTER_UDP_CKSUM) 392 #define RTE_MBUF_F_EXTERNAL (1ULL << 61) 394 #define RTE_MBUF_F_INDIRECT (1ULL << 62) 397 #define RTE_MBUF_PRIV_ALIGN 8 405 #define RTE_MBUF_DEFAULT_DATAROOM 2048 406 #define RTE_MBUF_DEFAULT_BUF_SIZE \ 407 (RTE_MBUF_DEFAULT_DATAROOM + RTE_PKTMBUF_HEADROOM) 425 RTE_MBUF_L2_LEN_BITS = 7,
426 RTE_MBUF_L3_LEN_BITS = 9,
427 RTE_MBUF_L4_LEN_BITS = 8,
428 RTE_MBUF_TSO_SEGSZ_BITS = 16,
429 RTE_MBUF_OUTL3_LEN_BITS = 9,
430 RTE_MBUF_OUTL2_LEN_BITS = 7,
431 RTE_MBUF_TXOFLD_UNUSED_BITS =
sizeof(uint64_t) * CHAR_BIT -
432 RTE_MBUF_L2_LEN_BITS -
433 RTE_MBUF_L3_LEN_BITS -
434 RTE_MBUF_L4_LEN_BITS -
435 RTE_MBUF_TSO_SEGSZ_BITS -
436 RTE_MBUF_OUTL3_LEN_BITS -
437 RTE_MBUF_OUTL2_LEN_BITS,
438 #
if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
439 RTE_MBUF_L2_LEN_OFS =
440 sizeof(uint64_t) * CHAR_BIT - RTE_MBUF_L2_LEN_BITS,
441 RTE_MBUF_L3_LEN_OFS = RTE_MBUF_L2_LEN_OFS - RTE_MBUF_L3_LEN_BITS,
442 RTE_MBUF_L4_LEN_OFS = RTE_MBUF_L3_LEN_OFS - RTE_MBUF_L4_LEN_BITS,
443 RTE_MBUF_TSO_SEGSZ_OFS = RTE_MBUF_L4_LEN_OFS - RTE_MBUF_TSO_SEGSZ_BITS,
444 RTE_MBUF_OUTL3_LEN_OFS =
445 RTE_MBUF_TSO_SEGSZ_OFS - RTE_MBUF_OUTL3_LEN_BITS,
446 RTE_MBUF_OUTL2_LEN_OFS =
447 RTE_MBUF_OUTL3_LEN_OFS - RTE_MBUF_OUTL2_LEN_BITS,
448 RTE_MBUF_TXOFLD_UNUSED_OFS =
449 RTE_MBUF_OUTL2_LEN_OFS - RTE_MBUF_TXOFLD_UNUSED_BITS,
451 RTE_MBUF_L2_LEN_OFS = 0,
452 RTE_MBUF_L3_LEN_OFS = RTE_MBUF_L2_LEN_OFS + RTE_MBUF_L2_LEN_BITS,
453 RTE_MBUF_L4_LEN_OFS = RTE_MBUF_L3_LEN_OFS + RTE_MBUF_L3_LEN_BITS,
454 RTE_MBUF_TSO_SEGSZ_OFS = RTE_MBUF_L4_LEN_OFS + RTE_MBUF_L4_LEN_BITS,
455 RTE_MBUF_OUTL3_LEN_OFS =
456 RTE_MBUF_TSO_SEGSZ_OFS + RTE_MBUF_TSO_SEGSZ_BITS,
457 RTE_MBUF_OUTL2_LEN_OFS =
458 RTE_MBUF_OUTL3_LEN_OFS + RTE_MBUF_OUTL3_LEN_BITS,
459 RTE_MBUF_TXOFLD_UNUSED_OFS =
460 RTE_MBUF_OUTL2_LEN_OFS + RTE_MBUF_OUTL2_LEN_BITS,
490 uint64_t rearm_data[1];
523 void *rx_descriptor_fields1[24 /
sizeof(
void *)];
673 uint32_t dynfield1[9];
687 RTE_ATOMIC(uint16_t) refcnt;
691 #define RTE_MBUF_MAX_NB_SEGS UINT16_MAX 700 #define RTE_MBUF_CLONED(mb) ((mb)->ol_flags & RTE_MBUF_F_INDIRECT) 707 #define RTE_MBUF_HAS_EXTBUF(mb) ((mb)->ol_flags & RTE_MBUF_F_EXTERNAL) 715 #define RTE_MBUF_DIRECT(mb) \ 716 (!((mb)->ol_flags & (RTE_MBUF_F_INDIRECT | RTE_MBUF_F_EXTERNAL))) 719 #define RTE_MBUF_PORT_INVALID UINT16_MAX 721 #define MBUF_INVALID_PORT RTE_MBUF_PORT_INVALID 737 #define rte_pktmbuf_mtod_offset(m, t, o) \ 738 ((t)(void *)((char *)(m)->buf_addr + (m)->data_off + (o))) 752 #define rte_pktmbuf_mtod(m, t) rte_pktmbuf_mtod_offset(m, t, 0) 763 #define rte_pktmbuf_iova_offset(m, o) \ 764 (rte_iova_t)(rte_mbuf_iova_get(m) + (m)->data_off + (o)) 773 #define rte_pktmbuf_iova(m) rte_pktmbuf_iova_offset(m, 0) struct rte_mbuf_ext_shared_info * shinfo
uint8_t inner_esp_next_proto
rte_mbuf_extbuf_free_callback_t free_cb
#define __rte_cache_aligned
void(* rte_mbuf_extbuf_free_callback_t)(void *addr, void *opaque)
#define RTE_CACHE_LINE_MIN_SIZE
struct rte_mempool * pool