6 #ifndef _RTE_MBUF_CORE_H_ 7 #define _RTE_MBUF_CORE_H_ 21 #include <rte_compat.h> 50 #define PKT_RX_VLAN (1ULL << 0) 53 #define PKT_RX_RSS_HASH (1ULL << 1) 56 #define PKT_RX_FDIR (1ULL << 2) 65 #define PKT_RX_L4_CKSUM_BAD (1ULL << 3) 74 #define PKT_RX_IP_CKSUM_BAD (1ULL << 4) 80 #define PKT_RX_OUTER_IP_CKSUM_BAD (1ULL << 5) 86 #define PKT_RX_EIP_CKSUM_BAD \ 87 RTE_DEPRECATED(PKT_RX_EIP_CKSUM_BAD) PKT_RX_OUTER_IP_CKSUM_BAD 95 #define PKT_RX_VLAN_STRIPPED (1ULL << 6) 105 #define PKT_RX_IP_CKSUM_MASK ((1ULL << 4) | (1ULL << 7)) 107 #define PKT_RX_IP_CKSUM_UNKNOWN 0 108 #define PKT_RX_IP_CKSUM_BAD (1ULL << 4) 109 #define PKT_RX_IP_CKSUM_GOOD (1ULL << 7) 110 #define PKT_RX_IP_CKSUM_NONE ((1ULL << 4) | (1ULL << 7)) 120 #define PKT_RX_L4_CKSUM_MASK ((1ULL << 3) | (1ULL << 8)) 122 #define PKT_RX_L4_CKSUM_UNKNOWN 0 123 #define PKT_RX_L4_CKSUM_BAD (1ULL << 3) 124 #define PKT_RX_L4_CKSUM_GOOD (1ULL << 8) 125 #define PKT_RX_L4_CKSUM_NONE ((1ULL << 3) | (1ULL << 8)) 128 #define PKT_RX_IEEE1588_PTP (1ULL << 9) 131 #define PKT_RX_IEEE1588_TMST (1ULL << 10) 134 #define PKT_RX_FDIR_ID (1ULL << 13) 137 #define PKT_RX_FDIR_FLX (1ULL << 14) 154 #define PKT_RX_QINQ_STRIPPED (1ULL << 15) 161 #define PKT_RX_LRO (1ULL << 16) 168 #define PKT_RX_SEC_OFFLOAD (1ULL << 18) 173 #define PKT_RX_SEC_OFFLOAD_FAILED (1ULL << 19) 183 #define PKT_RX_QINQ (1ULL << 20) 197 #define PKT_RX_OUTER_L4_CKSUM_MASK ((1ULL << 21) | (1ULL << 22)) 199 #define PKT_RX_OUTER_L4_CKSUM_UNKNOWN 0 200 #define PKT_RX_OUTER_L4_CKSUM_BAD (1ULL << 21) 201 #define PKT_RX_OUTER_L4_CKSUM_GOOD (1ULL << 22) 202 #define PKT_RX_OUTER_L4_CKSUM_INVALID ((1ULL << 21) | (1ULL << 22)) 206 #define PKT_FIRST_FREE (1ULL << 23) 207 #define PKT_LAST_FREE (1ULL << 40) 220 #define PKT_TX_OUTER_UDP_CKSUM (1ULL << 41) 227 #define PKT_TX_UDP_SEG (1ULL << 42) 232 #define PKT_TX_SEC_OFFLOAD (1ULL << 43) 238 #define PKT_TX_MACSEC (1ULL << 44) 248 #define PKT_TX_TUNNEL_VXLAN (0x1ULL << 45) 249 #define PKT_TX_TUNNEL_GRE (0x2ULL << 45) 250 #define PKT_TX_TUNNEL_IPIP (0x3ULL << 45) 251 #define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45) 253 #define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45) 254 #define PKT_TX_TUNNEL_VXLAN_GPE (0x6ULL << 45) 255 #define PKT_TX_TUNNEL_GTP (0x7ULL << 45) 267 #define PKT_TX_TUNNEL_IP (0xDULL << 45) 280 #define PKT_TX_TUNNEL_UDP (0xEULL << 45) 282 #define PKT_TX_TUNNEL_MASK (0xFULL << 45) 289 #define PKT_TX_QINQ (1ULL << 49) 291 #define PKT_TX_QINQ_PKT PKT_TX_QINQ 302 #define PKT_TX_TCP_SEG (1ULL << 50) 305 #define PKT_TX_IEEE1588_TMST (1ULL << 51) 315 #define PKT_TX_L4_NO_CKSUM (0ULL << 52) 318 #define PKT_TX_TCP_CKSUM (1ULL << 52) 321 #define PKT_TX_SCTP_CKSUM (2ULL << 52) 324 #define PKT_TX_UDP_CKSUM (3ULL << 52) 327 #define PKT_TX_L4_MASK (3ULL << 52) 335 #define PKT_TX_IP_CKSUM (1ULL << 54) 343 #define PKT_TX_IPV4 (1ULL << 55) 351 #define PKT_TX_IPV6 (1ULL << 56) 358 #define PKT_TX_VLAN (1ULL << 57) 360 #define PKT_TX_VLAN_PKT PKT_TX_VLAN 368 #define PKT_TX_OUTER_IP_CKSUM (1ULL << 58) 375 #define PKT_TX_OUTER_IPV4 (1ULL << 59) 382 #define PKT_TX_OUTER_IPV6 (1ULL << 60) 388 #define PKT_TX_OFFLOAD_MASK ( \ 389 PKT_TX_OUTER_IPV6 | \ 390 PKT_TX_OUTER_IPV4 | \ 391 PKT_TX_OUTER_IP_CKSUM | \ 397 PKT_TX_IEEE1588_TMST | \ 400 PKT_TX_TUNNEL_MASK | \ 402 PKT_TX_SEC_OFFLOAD | \ 404 PKT_TX_OUTER_UDP_CKSUM) 409 #define EXT_ATTACHED_MBUF (1ULL << 61) 411 #define IND_ATTACHED_MBUF (1ULL << 62) 414 #define RTE_MBUF_PRIV_ALIGN 8 422 #define RTE_MBUF_DEFAULT_DATAROOM 2048 423 #define RTE_MBUF_DEFAULT_BUF_SIZE \ 424 (RTE_MBUF_DEFAULT_DATAROOM + RTE_PKTMBUF_HEADROOM) 442 RTE_MBUF_L2_LEN_BITS = 7,
443 RTE_MBUF_L3_LEN_BITS = 9,
444 RTE_MBUF_L4_LEN_BITS = 8,
445 RTE_MBUF_TSO_SEGSZ_BITS = 16,
446 RTE_MBUF_OUTL3_LEN_BITS = 9,
447 RTE_MBUF_OUTL2_LEN_BITS = 7,
448 RTE_MBUF_TXOFLD_UNUSED_BITS =
sizeof(uint64_t) * CHAR_BIT -
449 RTE_MBUF_L2_LEN_BITS -
450 RTE_MBUF_L3_LEN_BITS -
451 RTE_MBUF_L4_LEN_BITS -
452 RTE_MBUF_TSO_SEGSZ_BITS -
453 RTE_MBUF_OUTL3_LEN_BITS -
454 RTE_MBUF_OUTL2_LEN_BITS,
455 #
if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
456 RTE_MBUF_L2_LEN_OFS =
457 sizeof(uint64_t) * CHAR_BIT - RTE_MBUF_L2_LEN_BITS,
458 RTE_MBUF_L3_LEN_OFS = RTE_MBUF_L2_LEN_OFS - RTE_MBUF_L3_LEN_BITS,
459 RTE_MBUF_L4_LEN_OFS = RTE_MBUF_L3_LEN_OFS - RTE_MBUF_L4_LEN_BITS,
460 RTE_MBUF_TSO_SEGSZ_OFS = RTE_MBUF_L4_LEN_OFS - RTE_MBUF_TSO_SEGSZ_BITS,
461 RTE_MBUF_OUTL3_LEN_OFS =
462 RTE_MBUF_TSO_SEGSZ_OFS - RTE_MBUF_OUTL3_LEN_BITS,
463 RTE_MBUF_OUTL2_LEN_OFS =
464 RTE_MBUF_OUTL3_LEN_OFS - RTE_MBUF_OUTL2_LEN_BITS,
465 RTE_MBUF_TXOFLD_UNUSED_OFS =
466 RTE_MBUF_OUTL2_LEN_OFS - RTE_MBUF_TXOFLD_UNUSED_BITS,
468 RTE_MBUF_L2_LEN_OFS = 0,
469 RTE_MBUF_L3_LEN_OFS = RTE_MBUF_L2_LEN_OFS + RTE_MBUF_L2_LEN_BITS,
470 RTE_MBUF_L4_LEN_OFS = RTE_MBUF_L3_LEN_OFS + RTE_MBUF_L3_LEN_BITS,
471 RTE_MBUF_TSO_SEGSZ_OFS = RTE_MBUF_L4_LEN_OFS + RTE_MBUF_L4_LEN_BITS,
472 RTE_MBUF_OUTL3_LEN_OFS =
473 RTE_MBUF_TSO_SEGSZ_OFS + RTE_MBUF_TSO_SEGSZ_BITS,
474 RTE_MBUF_OUTL2_LEN_OFS =
475 RTE_MBUF_OUTL3_LEN_OFS + RTE_MBUF_OUTL3_LEN_BITS,
476 RTE_MBUF_TXOFLD_UNUSED_OFS =
477 RTE_MBUF_OUTL2_LEN_OFS + RTE_MBUF_OUTL2_LEN_BITS,
658 uint32_t dynfield1[9];
676 #define RTE_MBUF_MAX_NB_SEGS UINT16_MAX 685 #define RTE_MBUF_CLONED(mb) ((mb)->ol_flags & IND_ATTACHED_MBUF) 692 #define RTE_MBUF_HAS_EXTBUF(mb) ((mb)->ol_flags & EXT_ATTACHED_MBUF) 700 #define RTE_MBUF_DIRECT(mb) \ 701 (!((mb)->ol_flags & (IND_ATTACHED_MBUF | EXT_ATTACHED_MBUF))) 704 #define RTE_MBUF_PORT_INVALID UINT16_MAX 706 #define MBUF_INVALID_PORT RTE_MBUF_PORT_INVALID 722 #define rte_pktmbuf_mtod_offset(m, t, o) \ 723 ((t)((char *)(m)->buf_addr + (m)->data_off + (o))) 737 #define rte_pktmbuf_mtod(m, t) rte_pktmbuf_mtod_offset(m, t, 0) 748 #define rte_pktmbuf_iova_offset(m, o) \ 749 (rte_iova_t)((m)->buf_iova + (m)->data_off + (o)) 758 #define rte_pktmbuf_iova(m) rte_pktmbuf_iova_offset(m, 0) struct rte_mbuf_ext_shared_info * shinfo
uint8_t inner_esp_next_proto
#define __rte_cache_min_aligned
rte_mbuf_extbuf_free_callback_t free_cb
__extension__ typedef void * RTE_MARKER[0]
void(* rte_mbuf_extbuf_free_callback_t)(void *addr, void *opaque)
__extension__ typedef uint64_t RTE_MARKER64[0]
#define __rte_cache_aligned
struct rte_mempool * pool
__extension__ struct rte_eth_link __rte_aligned(8)