6 #ifndef _PKTMBUF_OFFLOAD_H_
7 #define _PKTMBUF_OFFLOAD_H_
50 #define CNE_MBUF_F_RX_VLAN (1ULL << 0)
53 #define CNE_MBUF_F_RX_RSS_HASH (1ULL << 1)
56 #define CNE_MBUF_F_RX_FDIR (1ULL << 2)
62 #define CNE_MBUF_F_RX_OUTER_IP_CKSUM_BAD (1ULL << 5)
70 #define CNE_MBUF_F_RX_VLAN_STRIPPED (1ULL << 6)
80 #define CNE_MBUF_F_RX_IP_CKSUM_MASK ((1ULL << 4) | (1ULL << 7))
82 #define CNE_MBUF_F_RX_IP_CKSUM_UNKNOWN 0
83 #define CNE_MBUF_F_RX_IP_CKSUM_BAD (1ULL << 4)
84 #define CNE_MBUF_F_RX_IP_CKSUM_GOOD (1ULL << 7)
85 #define CNE_MBUF_F_RX_IP_CKSUM_NONE ((1ULL << 4) | (1ULL << 7))
95 #define CNE_MBUF_F_RX_L4_CKSUM_MASK ((1ULL << 3) | (1ULL << 8))
97 #define CNE_MBUF_F_RX_L4_CKSUM_UNKNOWN 0
98 #define CNE_MBUF_F_RX_L4_CKSUM_BAD (1ULL << 3)
99 #define CNE_MBUF_F_RX_L4_CKSUM_GOOD (1ULL << 8)
100 #define CNE_MBUF_F_RX_L4_CKSUM_NONE ((1ULL << 3) | (1ULL << 8))
103 #define CNE_MBUF_F_RX_IEEE1588_PTP (1ULL << 9)
106 #define CNE_MBUF_F_RX_IEEE1588_TMST (1ULL << 10)
109 #define CNE_MBUF_F_RX_FDIR_ID (1ULL << 13)
112 #define CNE_MBUF_F_RX_FDIR_FLX (1ULL << 14)
129 #define CNE_MBUF_F_RX_QINQ_STRIPPED (1ULL << 15)
136 #define CNE_MBUF_F_RX_LRO (1ULL << 16)
143 #define CNE_MBUF_F_RX_SEC_OFFLOAD (1ULL << 18)
148 #define CNE_MBUF_F_RX_SEC_OFFLOAD_FAILED (1ULL << 19)
158 #define CNE_MBUF_F_RX_QINQ (1ULL << 20)
175 #define CNE_MBUF_F_RX_OUTER_L4_CKSUM_MASK ((1ULL << 21) | (1ULL << 22))
177 #define CNE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN 0
178 #define CNE_MBUF_F_RX_OUTER_L4_CKSUM_BAD (1ULL << 21)
179 #define CNE_MBUF_F_RX_OUTER_L4_CKSUM_GOOD (1ULL << 22)
180 #define CNE_MBUF_F_RX_OUTER_L4_CKSUM_INVALID ((1ULL << 21) | (1ULL << 22))
184 #define CNE_MBUF_F_FIRST_FREE (1ULL << 23)
185 #define CNE_MBUF_F_LAST_FREE (1ULL << 40)
198 #define CNE_MBUF_F_TX_OUTER_UDP_CKSUM (1ULL << 41)
205 #define CNE_MBUF_F_TX_UDP_SEG (1ULL << 42)
212 #define CNE_MBUF_F_TX_SEC_OFFLOAD (1ULL << 43)
218 #define CNE_MBUF_F_TX_MACSEC (1ULL << 44)
229 #define CNE_MBUF_F_TX_TUNNEL_VXLAN (0x1ULL << 45)
230 #define CNE_MBUF_F_TX_TUNNEL_GRE (0x2ULL << 45)
231 #define CNE_MBUF_F_TX_TUNNEL_IPIP (0x3ULL << 45)
232 #define CNE_MBUF_F_TX_TUNNEL_GENEVE (0x4ULL << 45)
234 #define CNE_MBUF_F_TX_TUNNEL_MPLSINUDP (0x5ULL << 45)
235 #define CNE_MBUF_F_TX_TUNNEL_VXLAN_GPE (0x6ULL << 45)
236 #define CNE_MBUF_F_TX_TUNNEL_GTP (0x7ULL << 45)
237 #define CNE_MBUF_F_TX_TUNNEL_ESP (0x8ULL << 45)
249 #define CNE_MBUF_F_TX_TUNNEL_IP (0xDULL << 45)
262 #define CNE_MBUF_F_TX_TUNNEL_UDP (0xEULL << 45)
264 #define CNE_MBUF_F_TX_TUNNEL_MASK (0xFULL << 45)
271 #define CNE_MBUF_F_TX_QINQ (1ULL << 49)
282 #define CNE_MBUF_F_TX_TCP_SEG (1ULL << 50)
285 #define CNE_MBUF_F_TX_IEEE1588_TMST (1ULL << 51)
298 #define CNE_MBUF_F_TX_L4_NO_CKSUM (0ULL << 52)
301 #define CNE_MBUF_F_TX_TCP_CKSUM (1ULL << 52)
304 #define CNE_MBUF_F_TX_SCTP_CKSUM (2ULL << 52)
307 #define CNE_MBUF_F_TX_UDP_CKSUM (3ULL << 52)
310 #define CNE_MBUF_F_TX_L4_MASK (3ULL << 52)
318 #define CNE_MBUF_F_TX_IP_CKSUM (1ULL << 54)
326 #define CNE_MBUF_F_TX_IPV4 (1ULL << 55)
334 #define CNE_MBUF_F_TX_IPV6 (1ULL << 56)
341 #define CNE_MBUF_F_TX_VLAN (1ULL << 57)
349 #define CNE_MBUF_F_TX_OUTER_IP_CKSUM (1ULL << 58)
356 #define CNE_MBUF_F_TX_OUTER_IPV4 (1ULL << 59)
363 #define CNE_MBUF_F_TX_OUTER_IPV6 (1ULL << 60)
365 #define CNE_MBUF_TYPE_MCAST (1ULL << 61)
366 #define CNE_MBUF_TYPE_BCAST (1ULL << 62)
367 #define CNE_MBUF_TYPE_IPv6 (1ULL << 63)
368 #define CNE_MBUF_TYPE_MASK \
369 (CNE_MBUF_TYPE_MCAST | CNE_MBUF_TYPE_BCAST | \
371 #define CNE_MBUF_IS_MCAST \
372 (CNE_MBUF_TYPE_MCAST | CNE_MBUF_TYPE_BCAST)
378 #define CNE_MBUF_F_TX_OFFLOAD_MASK \
379 (CNE_MBUF_F_TX_OUTER_IPV6 | CNE_MBUF_F_TX_OUTER_IPV4 | CNE_MBUF_F_TX_OUTER_IP_CKSUM | \
380 CNE_MBUF_F_TX_VLAN | CNE_MBUF_F_TX_IPV6 | CNE_MBUF_F_TX_IPV4 | CNE_MBUF_F_TX_IP_CKSUM | \
381 CNE_MBUF_F_TX_L4_MASK | CNE_MBUF_F_TX_IEEE1588_TMST | CNE_MBUF_F_TX_TCP_SEG | \
382 CNE_MBUF_F_TX_QINQ | CNE_MBUF_F_TX_TUNNEL_MASK | CNE_MBUF_F_TX_MACSEC | \
383 CNE_MBUF_F_TX_SEC_OFFLOAD | CNE_MBUF_F_TX_UDP_SEG | CNE_MBUF_F_TX_OUTER_UDP_CKSUM)
388 #define CNE_MBUF_F_EXTERNAL (1ULL << 61)
390 #define CNE_MBUF_F_INDIRECT (1ULL << 62)
397 CNE_MBUF_L2_LEN_BITS = 7,
398 CNE_MBUF_L3_LEN_BITS = 9,
399 CNE_MBUF_L4_LEN_BITS = 8,
400 CNE_MBUF_TSO_SEGSZ_BITS = 16,
401 CNE_MBUF_OUTL3_LEN_BITS = 9,
402 CNE_MBUF_OUTL2_LEN_BITS = 7,
403 CNE_MBUF_TXOFLD_UNUSED_BITS =
sizeof(uint64_t) * CHAR_BIT - CNE_MBUF_L2_LEN_BITS -
404 CNE_MBUF_L3_LEN_BITS - CNE_MBUF_L4_LEN_BITS -
405 CNE_MBUF_TSO_SEGSZ_BITS - CNE_MBUF_OUTL3_LEN_BITS -
406 CNE_MBUF_OUTL2_LEN_BITS,
407 CNE_MBUF_L2_LEN_OFS = 0,
408 CNE_MBUF_L3_LEN_OFS = CNE_MBUF_L2_LEN_OFS + CNE_MBUF_L2_LEN_BITS,
409 CNE_MBUF_L4_LEN_OFS = CNE_MBUF_L3_LEN_OFS + CNE_MBUF_L3_LEN_BITS,
410 CNE_MBUF_TSO_SEGSZ_OFS = CNE_MBUF_L4_LEN_OFS + CNE_MBUF_L4_LEN_BITS,
411 CNE_MBUF_OUTL3_LEN_OFS = CNE_MBUF_TSO_SEGSZ_OFS + CNE_MBUF_TSO_SEGSZ_BITS,
412 CNE_MBUF_OUTL2_LEN_OFS = CNE_MBUF_OUTL3_LEN_OFS + CNE_MBUF_OUTL3_LEN_BITS,
413 CNE_MBUF_TXOFLD_UNUSED_OFS = CNE_MBUF_OUTL2_LEN_OFS + CNE_MBUF_OUTL2_LEN_BITS,