-/*
- * Packet Offload Features Flags. It also carry packet type information.
- * Critical resources. Both rx/tx shared these bits. Be cautious on any change
- *
- * - RX flags start at bit position zero, and get added to the left of previous
- * flags.
- * - The most-significant 3 bits are reserved for generic mbuf flags
- * - TX flags therefore start at bit position 60 (i.e. 63-3), and new flags get
- * added to the right of the previously defined flags i.e. they should count
- * downwards, not upwards.
- *
- * Keep these flags synchronized with rte_get_rx_ol_flag_name() and
- * rte_get_tx_ol_flag_name().
- */
-
-/**
- * The RX packet is a 802.1q VLAN packet, and the tci has been
- * saved in in mbuf->vlan_tci.
- * If the flag PKT_RX_VLAN_STRIPPED is also present, the VLAN
- * header has been stripped from mbuf data, else it is still
- * present.
- */
-#define PKT_RX_VLAN (1ULL << 0)
-
-#define PKT_RX_RSS_HASH (1ULL << 1) /**< RX packet with RSS hash result. */
-#define PKT_RX_FDIR (1ULL << 2) /**< RX packet with FDIR match indicate. */
-
-/**
- * Deprecated.
- * Checking this flag alone is deprecated: check the 2 bits of
- * PKT_RX_L4_CKSUM_MASK.
- * This flag was set when the L4 checksum of a packet was detected as
- * wrong by the hardware.
- */
-#define PKT_RX_L4_CKSUM_BAD (1ULL << 3)
-
-/**
- * Deprecated.
- * Checking this flag alone is deprecated: check the 2 bits of
- * PKT_RX_IP_CKSUM_MASK.
- * This flag was set when the IP checksum of a packet was detected as
- * wrong by the hardware.
- */
-#define PKT_RX_IP_CKSUM_BAD (1ULL << 4)
-
-#define PKT_RX_EIP_CKSUM_BAD (1ULL << 5) /**< External IP header checksum error. */
-
-/**
- * A vlan has been stripped by the hardware and its tci is saved in
- * mbuf->vlan_tci. This can only happen if vlan stripping is enabled
- * in the RX configuration of the PMD.
- * When PKT_RX_VLAN_STRIPPED is set, PKT_RX_VLAN must also be set.
- */
-#define PKT_RX_VLAN_STRIPPED (1ULL << 6)
-
-/**
- * Mask of bits used to determine the status of RX IP checksum.
- * - PKT_RX_IP_CKSUM_UNKNOWN: no information about the RX IP checksum
- * - PKT_RX_IP_CKSUM_BAD: the IP checksum in the packet is wrong
- * - PKT_RX_IP_CKSUM_GOOD: the IP checksum in the packet is valid
- * - PKT_RX_IP_CKSUM_NONE: the IP checksum is not correct in the packet
- * data, but the integrity of the IP header is verified.
- */
-#define PKT_RX_IP_CKSUM_MASK ((1ULL << 4) | (1ULL << 7))
-
-#define PKT_RX_IP_CKSUM_UNKNOWN 0
-#define PKT_RX_IP_CKSUM_BAD (1ULL << 4)
-#define PKT_RX_IP_CKSUM_GOOD (1ULL << 7)
-#define PKT_RX_IP_CKSUM_NONE ((1ULL << 4) | (1ULL << 7))
-
-/**
- * Mask of bits used to determine the status of RX L4 checksum.
- * - PKT_RX_L4_CKSUM_UNKNOWN: no information about the RX L4 checksum
- * - PKT_RX_L4_CKSUM_BAD: the L4 checksum in the packet is wrong
- * - PKT_RX_L4_CKSUM_GOOD: the L4 checksum in the packet is valid
- * - PKT_RX_L4_CKSUM_NONE: the L4 checksum is not correct in the packet
- * data, but the integrity of the L4 data is verified.
- */
-#define PKT_RX_L4_CKSUM_MASK ((1ULL << 3) | (1ULL << 8))
-
-#define PKT_RX_L4_CKSUM_UNKNOWN 0
-#define PKT_RX_L4_CKSUM_BAD (1ULL << 3)
-#define PKT_RX_L4_CKSUM_GOOD (1ULL << 8)
-#define PKT_RX_L4_CKSUM_NONE ((1ULL << 3) | (1ULL << 8))
-
-#define PKT_RX_IEEE1588_PTP (1ULL << 9) /**< RX IEEE1588 L2 Ethernet PT Packet. */
-#define PKT_RX_IEEE1588_TMST (1ULL << 10) /**< RX IEEE1588 L2/L4 timestamped packet.*/
-#define PKT_RX_FDIR_ID (1ULL << 13) /**< FD id reported if FDIR match. */
-#define PKT_RX_FDIR_FLX (1ULL << 14) /**< Flexible bytes reported if FDIR match. */
-
-/**
- * The 2 vlans have been stripped by the hardware and their tci are
- * saved in mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer).
- * This can only happen if vlan stripping is enabled in the RX
- * configuration of the PMD. If this flag is set,
- * When PKT_RX_QINQ_STRIPPED is set, the flags (PKT_RX_VLAN |
- * PKT_RX_VLAN_STRIPPED | PKT_RX_QINQ) must also be set.
- */
-#define PKT_RX_QINQ_STRIPPED (1ULL << 15)
-
-/**
- * When packets are coalesced by a hardware or virtual driver, this flag
- * can be set in the RX mbuf, meaning that the m->tso_segsz field is
- * valid and is set to the segment size of original packets.
- */
-#define PKT_RX_LRO (1ULL << 16)
-
-/**
- * Indicate that the timestamp field in the mbuf is valid.
- */
-#define PKT_RX_TIMESTAMP (1ULL << 17)
-
-/**
- * Indicate that security offload processing was applied on the RX packet.
- */
-#define PKT_RX_SEC_OFFLOAD (1ULL << 18)
-
-/**
- * Indicate that security offload processing failed on the RX packet.
- */
-#define PKT_RX_SEC_OFFLOAD_FAILED (1ULL << 19)
-
-/**
- * The RX packet is a double VLAN, and the outer tci has been
- * saved in in mbuf->vlan_tci_outer.
- * If the flag PKT_RX_QINQ_STRIPPED is also present, both VLANs
- * headers have been stripped from mbuf data, else they are still
- * present.
- */
-#define PKT_RX_QINQ (1ULL << 20)
-
-/* add new RX flags here */
-
-/* add new TX flags here */
-
-/**
- * UDP Fragmentation Offload flag. This flag is used for enabling UDP
- * fragmentation in SW or in HW. When use UFO, mbuf->tso_segsz is used
- * to store the MSS of UDP fragments.
- */
-#define PKT_TX_UDP_SEG (1ULL << 42)
-
-/**
- * Request security offload processing on the TX packet.
- */
-#define PKT_TX_SEC_OFFLOAD (1ULL << 43)
-
-/**
- * Offload the MACsec. This flag must be set by the application to enable
- * this offload feature for a packet to be transmitted.
- */
-#define PKT_TX_MACSEC (1ULL << 44)
-
-/**
- * Bits 45:48 used for the tunnel type.
- * When doing Tx offload like TSO or checksum, the HW needs to configure the
- * tunnel type into the HW descriptors.
- */
-#define PKT_TX_TUNNEL_VXLAN (0x1ULL << 45)
-#define PKT_TX_TUNNEL_GRE (0x2ULL << 45)
-#define PKT_TX_TUNNEL_IPIP (0x3ULL << 45)
-#define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45)
-/**< TX packet with MPLS-in-UDP RFC 7510 header. */
-#define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45)
-/* add new TX TUNNEL type here */
-#define PKT_TX_TUNNEL_MASK (0xFULL << 45)
-
-/**
- * Second VLAN insertion (QinQ) flag.
- */
-#define PKT_TX_QINQ (1ULL << 49) /**< TX packet with double VLAN inserted. */
-/* this old name is deprecated */
-#define PKT_TX_QINQ_PKT PKT_TX_QINQ
-
-/**
- * TCP segmentation offload. To enable this offload feature for a
- * packet to be transmitted on hardware supporting TSO:
- * - set the PKT_TX_TCP_SEG flag in mbuf->ol_flags (this flag implies
- * PKT_TX_TCP_CKSUM)
- * - set the flag PKT_TX_IPV4 or PKT_TX_IPV6
- * - if it's IPv4, set the PKT_TX_IP_CKSUM flag
- * - fill the mbuf offload information: l2_len, l3_len, l4_len, tso_segsz
- */
-#define PKT_TX_TCP_SEG (1ULL << 50)
-
-#define PKT_TX_IEEE1588_TMST (1ULL << 51) /**< TX IEEE1588 packet to timestamp. */
-
-/**
- * Bits 52+53 used for L4 packet type with checksum enabled: 00: Reserved,
- * 01: TCP checksum, 10: SCTP checksum, 11: UDP checksum. To use hardware
- * L4 checksum offload, the user needs to:
- * - fill l2_len and l3_len in mbuf
- * - set the flags PKT_TX_TCP_CKSUM, PKT_TX_SCTP_CKSUM or PKT_TX_UDP_CKSUM
- * - set the flag PKT_TX_IPV4 or PKT_TX_IPV6
- */
-#define PKT_TX_L4_NO_CKSUM (0ULL << 52) /**< Disable L4 cksum of TX pkt. */
-#define PKT_TX_TCP_CKSUM (1ULL << 52) /**< TCP cksum of TX pkt. computed by NIC. */
-#define PKT_TX_SCTP_CKSUM (2ULL << 52) /**< SCTP cksum of TX pkt. computed by NIC. */
-#define PKT_TX_UDP_CKSUM (3ULL << 52) /**< UDP cksum of TX pkt. computed by NIC. */
-#define PKT_TX_L4_MASK (3ULL << 52) /**< Mask for L4 cksum offload request. */
-
-/**
- * Offload the IP checksum in the hardware. The flag PKT_TX_IPV4 should
- * also be set by the application, although a PMD will only check
- * PKT_TX_IP_CKSUM.
- * - fill the mbuf offload information: l2_len, l3_len
- */
-#define PKT_TX_IP_CKSUM (1ULL << 54)
-
-/**
- * Packet is IPv4. This flag must be set when using any offload feature
- * (TSO, L3 or L4 checksum) to tell the NIC that the packet is an IPv4
- * packet. If the packet is a tunneled packet, this flag is related to
- * the inner headers.
- */
-#define PKT_TX_IPV4 (1ULL << 55)
-
-/**
- * Packet is IPv6. This flag must be set when using an offload feature
- * (TSO or L4 checksum) to tell the NIC that the packet is an IPv6
- * packet. If the packet is a tunneled packet, this flag is related to
- * the inner headers.
- */
-#define PKT_TX_IPV6 (1ULL << 56)
-
-/**
- * TX packet is a 802.1q VLAN packet.
- */
-#define PKT_TX_VLAN (1ULL << 57)
-/* this old name is deprecated */
-#define PKT_TX_VLAN_PKT PKT_TX_VLAN
-
-/**
- * Offload the IP checksum of an external header in the hardware. The
- * flag PKT_TX_OUTER_IPV4 should also be set by the application, although
- * a PMD will only check PKT_TX_OUTER_IP_CKSUM.
- * - fill the mbuf offload information: outer_l2_len, outer_l3_len
- */
-#define PKT_TX_OUTER_IP_CKSUM (1ULL << 58)
-
-/**
- * Packet outer header is IPv4. This flag must be set when using any
- * outer offload feature (L3 or L4 checksum) to tell the NIC that the
- * outer header of the tunneled packet is an IPv4 packet.
- */
-#define PKT_TX_OUTER_IPV4 (1ULL << 59)
-
-/**
- * Packet outer header is IPv6. This flag must be set when using any
- * outer offload feature (L4 checksum) to tell the NIC that the outer
- * header of the tunneled packet is an IPv6 packet.
- */
-#define PKT_TX_OUTER_IPV6 (1ULL << 60)
-
-/**
- * Bitmask of all supported packet Tx offload features flags,
- * which can be set for packet.
- */
-#define PKT_TX_OFFLOAD_MASK ( \
- PKT_TX_IP_CKSUM | \
- PKT_TX_L4_MASK | \
- PKT_TX_OUTER_IP_CKSUM | \
- PKT_TX_TCP_SEG | \
- PKT_TX_IEEE1588_TMST | \
- PKT_TX_QINQ_PKT | \
- PKT_TX_VLAN_PKT | \
- PKT_TX_TUNNEL_MASK | \
- PKT_TX_MACSEC | \
- PKT_TX_SEC_OFFLOAD)
-
-#define __RESERVED (1ULL << 61) /**< reserved for future mbuf use */
-
-#define IND_ATTACHED_MBUF (1ULL << 62) /**< Indirect attached mbuf */
-
-/** Alignment constraint of mbuf private area. */
-#define RTE_MBUF_PRIV_ALIGN 8
-