DPDK  24.11.0-rc3
Data Structures | Macros | Typedefs | Enumerations
rte_mbuf_core.h File Reference
#include <stdalign.h>
#include <stdint.h>
#include <rte_byteorder.h>
#include <rte_stdatomic.h>

Go to the source code of this file.

Data Structures

struct  rte_mbuf_sched
 
struct  rte_mbuf
 
struct  rte_mbuf_ext_shared_info
 

Macros

#define RTE_MBUF_F_RX_VLAN   (1ULL << 0)
 
#define RTE_MBUF_F_RX_RSS_HASH   (1ULL << 1)
 
#define RTE_MBUF_F_RX_FDIR   (1ULL << 2)
 
#define RTE_MBUF_F_RX_OUTER_IP_CKSUM_BAD   (1ULL << 5)
 
#define RTE_MBUF_F_RX_VLAN_STRIPPED   (1ULL << 6)
 
#define RTE_MBUF_F_RX_IP_CKSUM_MASK   ((1ULL << 4) | (1ULL << 7))
 
#define RTE_MBUF_F_RX_L4_CKSUM_MASK   ((1ULL << 3) | (1ULL << 8))
 
#define RTE_MBUF_F_RX_IEEE1588_PTP   (1ULL << 9)
 
#define RTE_MBUF_F_RX_IEEE1588_TMST   (1ULL << 10)
 
#define RTE_MBUF_F_RX_FDIR_ID   (1ULL << 13)
 
#define RTE_MBUF_F_RX_FDIR_FLX   (1ULL << 14)
 
#define RTE_MBUF_F_RX_QINQ_STRIPPED   (1ULL << 15)
 
#define RTE_MBUF_F_RX_LRO   (1ULL << 16)
 
#define RTE_MBUF_F_RX_SEC_OFFLOAD   (1ULL << 18)
 
#define RTE_MBUF_F_RX_SEC_OFFLOAD_FAILED   (1ULL << 19)
 
#define RTE_MBUF_F_RX_QINQ   (1ULL << 20)
 
#define RTE_MBUF_F_RX_OUTER_L4_CKSUM_MASK   ((1ULL << 21) | (1ULL << 22))
 
#define RTE_MBUF_F_TX_OUTER_UDP_CKSUM   (1ULL << 41)
 
#define RTE_MBUF_F_TX_UDP_SEG   (1ULL << 42)
 
#define RTE_MBUF_F_TX_SEC_OFFLOAD   (1ULL << 43)
 
#define RTE_MBUF_F_TX_MACSEC   (1ULL << 44)
 
#define RTE_MBUF_F_TX_TUNNEL_VXLAN   (0x1ULL << 45)
 
#define RTE_MBUF_F_TX_TUNNEL_MPLSINUDP   (0x5ULL << 45)
 
#define RTE_MBUF_F_TX_TUNNEL_IP   (0xDULL << 45)
 
#define RTE_MBUF_F_TX_TUNNEL_UDP   (0xEULL << 45)
 
#define RTE_MBUF_F_TX_QINQ   (1ULL << 49)
 
#define RTE_MBUF_F_TX_TCP_SEG   (1ULL << 50)
 
#define RTE_MBUF_F_TX_IEEE1588_TMST   (1ULL << 51)
 
#define RTE_MBUF_F_TX_L4_NO_CKSUM   (0ULL << 52)
 
#define RTE_MBUF_F_TX_TCP_CKSUM   (1ULL << 52)
 
#define RTE_MBUF_F_TX_SCTP_CKSUM   (2ULL << 52)
 
#define RTE_MBUF_F_TX_UDP_CKSUM   (3ULL << 52)
 
#define RTE_MBUF_F_TX_L4_MASK   (3ULL << 52)
 
#define RTE_MBUF_F_TX_IP_CKSUM   (1ULL << 54)
 
#define RTE_MBUF_F_TX_IPV4   (1ULL << 55)
 
#define RTE_MBUF_F_TX_IPV6   (1ULL << 56)
 
#define RTE_MBUF_F_TX_VLAN   (1ULL << 57)
 
#define RTE_MBUF_F_TX_OUTER_IP_CKSUM   (1ULL << 58)
 
#define RTE_MBUF_F_TX_OUTER_IPV4   (1ULL << 59)
 
#define RTE_MBUF_F_TX_OUTER_IPV6   (1ULL << 60)
 
#define RTE_MBUF_F_TX_OFFLOAD_MASK
 
#define RTE_MBUF_F_EXTERNAL   (1ULL << 61)
 
#define RTE_MBUF_F_INDIRECT   (1ULL << 62)
 
#define RTE_MBUF_PRIV_ALIGN   8
 
#define RTE_MBUF_DEFAULT_DATAROOM   2048
 
#define RTE_MBUF_MAX_NB_SEGS   UINT16_MAX
 
#define RTE_MBUF_CLONED(mb)   ((mb)->ol_flags & RTE_MBUF_F_INDIRECT)
 
#define RTE_MBUF_HAS_EXTBUF(mb)   ((mb)->ol_flags & RTE_MBUF_F_EXTERNAL)
 
#define RTE_MBUF_DIRECT(mb)   (!((mb)->ol_flags & (RTE_MBUF_F_INDIRECT | RTE_MBUF_F_EXTERNAL)))
 
#define RTE_MBUF_PORT_INVALID   UINT16_MAX
 
#define MBUF_INVALID_PORT   RTE_MBUF_PORT_INVALID
 
#define rte_pktmbuf_mtod_offset(m, t, o)   ((t)(void *)((char *)(m)->buf_addr + (m)->data_off + (o)))
 
#define rte_pktmbuf_mtod(m, t)   rte_pktmbuf_mtod_offset(m, t, 0)
 
#define rte_pktmbuf_iova_offset(m, o)   (rte_iova_t)(rte_mbuf_iova_get(m) + (m)->data_off + (o))
 
#define rte_pktmbuf_iova(m)   rte_pktmbuf_iova_offset(m, 0)
 

Typedefs

typedef void(* rte_mbuf_extbuf_free_callback_t) (void *addr, void *opaque)
 

Enumerations

enum  
 

Detailed Description

This file contains definition of RTE mbuf structure itself, packet offload flags and some related macros. For majority of DPDK entities, it is not recommended to include this file directly, use include <rte_mbuf.h> instead.

New fields and flags should fit in the "dynamic space".

Definition in file rte_mbuf_core.h.

Macro Definition Documentation

◆ RTE_MBUF_F_RX_VLAN

#define RTE_MBUF_F_RX_VLAN   (1ULL << 0)

The RX packet is a 802.1q VLAN packet, and the tci has been saved in mbuf->vlan_tci. If the flag RTE_MBUF_F_RX_VLAN_STRIPPED is also present, the VLAN header has been stripped from mbuf data, else it is still present.

Examples:
examples/bpf/t2.c.

Definition at line 51 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_RX_RSS_HASH

#define RTE_MBUF_F_RX_RSS_HASH   (1ULL << 1)

RX packet with RSS hash result.

Definition at line 54 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_RX_FDIR

#define RTE_MBUF_F_RX_FDIR   (1ULL << 2)

RX packet with FDIR match indicate.

Definition at line 57 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_RX_OUTER_IP_CKSUM_BAD

#define RTE_MBUF_F_RX_OUTER_IP_CKSUM_BAD   (1ULL << 5)

This flag is set when the outermost IP header checksum is detected as wrong by the hardware.

Definition at line 63 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_RX_VLAN_STRIPPED

#define RTE_MBUF_F_RX_VLAN_STRIPPED   (1ULL << 6)

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 RTE_MBUF_F_RX_VLAN_STRIPPED is set, RTE_MBUF_F_RX_VLAN must also be set.

Examples:
examples/bpf/t2.c.

Definition at line 71 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_RX_IP_CKSUM_MASK

#define RTE_MBUF_F_RX_IP_CKSUM_MASK   ((1ULL << 4) | (1ULL << 7))

Mask of bits used to determine the status of RX IP checksum.

  • RTE_MBUF_F_RX_IP_CKSUM_UNKNOWN: no information about the RX IP checksum
  • RTE_MBUF_F_RX_IP_CKSUM_BAD: the IP checksum in the packet is wrong
  • RTE_MBUF_F_RX_IP_CKSUM_GOOD: the IP checksum in the packet is valid
  • RTE_MBUF_F_RX_IP_CKSUM_NONE: the IP checksum is not correct in the packet data, but the integrity of the IP header is verified.

Definition at line 81 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_RX_L4_CKSUM_MASK

#define RTE_MBUF_F_RX_L4_CKSUM_MASK   ((1ULL << 3) | (1ULL << 8))

Mask of bits used to determine the status of RX L4 checksum.

  • RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN: no information about the RX L4 checksum
  • RTE_MBUF_F_RX_L4_CKSUM_BAD: the L4 checksum in the packet is wrong
  • RTE_MBUF_F_RX_L4_CKSUM_GOOD: the L4 checksum in the packet is valid
  • RTE_MBUF_F_RX_L4_CKSUM_NONE: the L4 checksum is not correct in the packet data, but the integrity of the L4 data is verified.

Definition at line 96 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_RX_IEEE1588_PTP

#define RTE_MBUF_F_RX_IEEE1588_PTP   (1ULL << 9)

RX IEEE1588 L2 Ethernet PT Packet.

Examples:
examples/ptpclient/ptpclient.c.

Definition at line 104 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_RX_IEEE1588_TMST

#define RTE_MBUF_F_RX_IEEE1588_TMST   (1ULL << 10)

RX IEEE1588 L2/L4 timestamped packet.

Definition at line 107 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_RX_FDIR_ID

#define RTE_MBUF_F_RX_FDIR_ID   (1ULL << 13)

FD id reported if FDIR match.

Definition at line 110 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_RX_FDIR_FLX

#define RTE_MBUF_F_RX_FDIR_FLX   (1ULL << 14)

Flexible bytes reported if FDIR match.

Definition at line 113 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_RX_QINQ_STRIPPED

#define RTE_MBUF_F_RX_QINQ_STRIPPED   (1ULL << 15)

The outer VLAN has been stripped by the hardware and its TCI is saved in mbuf->vlan_tci_outer. This can only happen if VLAN stripping is enabled in the Rx configuration of the PMD. When RTE_MBUF_F_RX_QINQ_STRIPPED is set, the flags RTE_MBUF_F_RX_VLAN and RTE_MBUF_F_RX_QINQ must also be set.

  • If both RTE_MBUF_F_RX_QINQ_STRIPPED and RTE_MBUF_F_RX_VLAN_STRIPPED are set, the 2 VLANs have been stripped by the hardware and their TCIs are saved in mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer).
  • If RTE_MBUF_F_RX_QINQ_STRIPPED is set and RTE_MBUF_F_RX_VLAN_STRIPPED is unset, only the outer VLAN is removed from packet data, but both tci are saved in mbuf->vlan_tci (inner) and mbuf->vlan_tci_outer (outer).

Definition at line 130 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_RX_LRO

#define RTE_MBUF_F_RX_LRO   (1ULL << 16)

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.

Examples:
examples/vhost/main.c.

Definition at line 137 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_RX_SEC_OFFLOAD

#define RTE_MBUF_F_RX_SEC_OFFLOAD   (1ULL << 18)

Indicate that security offload processing was applied on the RX packet.

Examples:
examples/ipsec-secgw/esp.c, and examples/ipsec-secgw/ipsec_worker.c.

Definition at line 144 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_RX_SEC_OFFLOAD_FAILED

#define RTE_MBUF_F_RX_SEC_OFFLOAD_FAILED   (1ULL << 19)

Indicate that security offload processing failed on the RX packet.

Examples:
examples/ipsec-secgw/esp.c, and examples/ipsec-secgw/ipsec_worker.c.

Definition at line 149 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_RX_QINQ

#define RTE_MBUF_F_RX_QINQ   (1ULL << 20)

The RX packet is a double VLAN, and the outer tci has been saved in mbuf->vlan_tci_outer. If this flag is set, RTE_MBUF_F_RX_VLAN must also be set and the inner tci is saved in mbuf->vlan_tci. If the flag RTE_MBUF_F_RX_QINQ_STRIPPED is also present, both VLANs headers have been stripped from mbuf data, else they are still present.

Definition at line 159 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_RX_OUTER_L4_CKSUM_MASK

#define RTE_MBUF_F_RX_OUTER_L4_CKSUM_MASK   ((1ULL << 21) | (1ULL << 22))

Mask of bits used to determine the status of outer RX L4 checksum.

  • RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN: no info about the outer RX L4 checksum
  • RTE_MBUF_F_RX_OUTER_L4_CKSUM_BAD: the outer L4 checksum in the packet is wrong
  • RTE_MBUF_F_RX_OUTER_L4_CKSUM_GOOD: the outer L4 checksum in the packet is valid
  • RTE_MBUF_F_RX_OUTER_L4_CKSUM_INVALID: invalid outer L4 checksum state.

The detection of RTE_MBUF_F_RX_OUTER_L4_CKSUM_GOOD shall be based on the given HW capability, At minimum, the PMD should support RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN and RTE_MBUF_F_RX_OUTER_L4_CKSUM_BAD states if the RTE_ETH_RX_OFFLOAD_OUTER_UDP_CKSUM offload is available.

Definition at line 176 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_OUTER_UDP_CKSUM

#define RTE_MBUF_F_TX_OUTER_UDP_CKSUM   (1ULL << 41)

Outer UDP checksum offload flag. This flag is used for enabling outer UDP checksum in PMD. To use outer UDP checksum, the user needs to 1) Enable the following in mbuf, a) Fill outer_l2_len and outer_l3_len in mbuf. b) Set the RTE_MBUF_F_TX_OUTER_UDP_CKSUM flag. c) Set the RTE_MBUF_F_TX_OUTER_IPV4 or RTE_MBUF_F_TX_OUTER_IPV6 flag. 2) Configure RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM offload flag.

Definition at line 199 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_UDP_SEG

#define RTE_MBUF_F_TX_UDP_SEG   (1ULL << 42)

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.

Definition at line 206 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_SEC_OFFLOAD

#define RTE_MBUF_F_TX_SEC_OFFLOAD   (1ULL << 43)

Request security offload processing on the TX packet. To use Tx security offload, the user needs to fill l2_len in mbuf indicating L2 header size and where L3 header starts. Similarly, l3_len should also be filled along with ol_flags reflecting current L3 type.

Examples:
examples/ipsec-secgw/esp.c, and examples/ipsec-secgw/ipsec_worker.c.

Definition at line 214 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_MACSEC

#define RTE_MBUF_F_TX_MACSEC   (1ULL << 44)

Offload the MACsec. This flag must be set by the application to enable this offload feature for a packet to be transmitted.

Definition at line 220 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_TUNNEL_VXLAN

#define RTE_MBUF_F_TX_TUNNEL_VXLAN   (0x1ULL << 45)

Bits 45:48 used for the tunnel type. The tunnel type must be specified for TSO or checksum on the inner part of tunnel packets. These flags can be used with RTE_MBUF_F_TX_TCP_SEG for TSO, or RTE_MBUF_F_TX_xxx_CKSUM. The mbuf fields for inner and outer header lengths are required: outer_l2_len, outer_l3_len, l2_len, l3_len, l4_len and tso_segsz for TSO.

Definition at line 231 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_TUNNEL_MPLSINUDP

#define RTE_MBUF_F_TX_TUNNEL_MPLSINUDP   (0x5ULL << 45)

TX packet with MPLS-in-UDP RFC 7510 header.

Definition at line 236 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_TUNNEL_IP

#define RTE_MBUF_F_TX_TUNNEL_IP   (0xDULL << 45)

Generic IP encapsulated tunnel type, used for TSO and checksum offload. It can be used for tunnels which are not standards or listed above. It is preferred to use specific tunnel flags like RTE_MBUF_F_TX_TUNNEL_GRE or RTE_MBUF_F_TX_TUNNEL_IPIP if possible. The ethdev must be configured with RTE_ETH_TX_OFFLOAD_IP_TNL_TSO. Outer and inner checksums are done according to the existing flags like RTE_MBUF_F_TX_xxx_CKSUM. Specific tunnel headers that contain payload length, sequence id or checksum are not expected to be updated.

Definition at line 251 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_TUNNEL_UDP

#define RTE_MBUF_F_TX_TUNNEL_UDP   (0xEULL << 45)

Generic UDP encapsulated tunnel type, used for TSO and checksum offload. UDP tunnel type implies outer IP layer. It can be used for tunnels which are not standards or listed above. It is preferred to use specific tunnel flags like RTE_MBUF_F_TX_TUNNEL_VXLAN if possible. The ethdev must be configured with RTE_ETH_TX_OFFLOAD_UDP_TNL_TSO. Outer and inner checksums are done according to the existing flags like RTE_MBUF_F_TX_xxx_CKSUM. Specific tunnel headers that contain payload length, sequence id or checksum are not expected to be updated.

Definition at line 264 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_QINQ

#define RTE_MBUF_F_TX_QINQ   (1ULL << 49)

Double VLAN insertion (QinQ) request to driver, driver may offload the insertion based on device capability. mbuf 'vlan_tci' & 'vlan_tci_outer' must be valid when this flag is set.

Definition at line 273 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_TCP_SEG

#define RTE_MBUF_F_TX_TCP_SEG   (1ULL << 50)

TCP segmentation offload. To enable this offload feature for a packet to be transmitted on hardware supporting TSO:

  • set the RTE_MBUF_F_TX_TCP_SEG flag in mbuf->ol_flags (this flag implies RTE_MBUF_F_TX_TCP_CKSUM)
  • set the flag RTE_MBUF_F_TX_IPV4 or RTE_MBUF_F_TX_IPV6
  • if it's IPv4, set the RTE_MBUF_F_TX_IP_CKSUM flag
  • fill the mbuf offload information: l2_len, l3_len, l4_len, tso_segsz
Examples:
examples/vhost/main.c.

Definition at line 284 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_IEEE1588_TMST

#define RTE_MBUF_F_TX_IEEE1588_TMST   (1ULL << 51)

TX IEEE1588 packet to timestamp.

Examples:
examples/ptpclient/ptpclient.c.

Definition at line 287 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_L4_NO_CKSUM

#define RTE_MBUF_F_TX_L4_NO_CKSUM   (0ULL << 52)

Disable L4 cksum of TX pkt.

Definition at line 300 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_TCP_CKSUM

#define RTE_MBUF_F_TX_TCP_CKSUM   (1ULL << 52)

TCP cksum of TX pkt. computed by NIC.

Definition at line 303 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_SCTP_CKSUM

#define RTE_MBUF_F_TX_SCTP_CKSUM   (2ULL << 52)

SCTP cksum of TX pkt. computed by NIC.

Definition at line 306 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_UDP_CKSUM

#define RTE_MBUF_F_TX_UDP_CKSUM   (3ULL << 52)

UDP cksum of TX pkt. computed by NIC.

Definition at line 309 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_L4_MASK

#define RTE_MBUF_F_TX_L4_MASK   (3ULL << 52)

Mask for L4 cksum offload request.

Definition at line 312 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_IP_CKSUM

#define RTE_MBUF_F_TX_IP_CKSUM   (1ULL << 54)

Offload the IP checksum in the hardware. The flag RTE_MBUF_F_TX_IPV4 should also be set by the application, although a PMD will only check RTE_MBUF_F_TX_IP_CKSUM.

  • fill the mbuf offload information: l2_len, l3_len
Examples:
examples/ip_fragmentation/main.c, examples/ip_reassembly/main.c, examples/ipsec-secgw/ipsec-secgw.c, and examples/vhost/main.c.

Definition at line 320 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_IPV4

#define RTE_MBUF_F_TX_IPV4   (1ULL << 55)

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.

Examples:
examples/ip_fragmentation/main.c, examples/ip_reassembly/main.c, examples/ipsec-secgw/ipsec-secgw.c, and examples/vhost/main.c.

Definition at line 328 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_IPV6

#define RTE_MBUF_F_TX_IPV6   (1ULL << 56)

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.

Examples:
examples/ipsec-secgw/ipsec-secgw.c, and examples/vhost/main.c.

Definition at line 336 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_VLAN

#define RTE_MBUF_F_TX_VLAN   (1ULL << 57)

VLAN tag insertion request to driver, driver may offload the insertion based on the device capability. mbuf 'vlan_tci' field must be valid when this flag is set.

Examples:
examples/vhost/main.c.

Definition at line 343 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_OUTER_IP_CKSUM

#define RTE_MBUF_F_TX_OUTER_IP_CKSUM   (1ULL << 58)

Offload the IP checksum of an external header in the hardware. The flag RTE_MBUF_F_TX_OUTER_IPV4 should also be set by the application, although a PMD will only check RTE_MBUF_F_TX_OUTER_IP_CKSUM.

  • fill the mbuf offload information: outer_l2_len, outer_l3_len

Definition at line 351 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_OUTER_IPV4

#define RTE_MBUF_F_TX_OUTER_IPV4   (1ULL << 59)

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.

Definition at line 358 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_OUTER_IPV6

#define RTE_MBUF_F_TX_OUTER_IPV6   (1ULL << 60)

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.

Definition at line 365 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_TX_OFFLOAD_MASK

#define RTE_MBUF_F_TX_OFFLOAD_MASK
Value:
( \
RTE_MBUF_F_TX_OUTER_IPV6 | \
RTE_MBUF_F_TX_OUTER_IPV4 | \
RTE_MBUF_F_TX_OUTER_IP_CKSUM | \
RTE_MBUF_F_TX_VLAN | \
RTE_MBUF_F_TX_IPV6 | \
RTE_MBUF_F_TX_IPV4 | \
RTE_MBUF_F_TX_IP_CKSUM | \
RTE_MBUF_F_TX_L4_MASK | \
RTE_MBUF_F_TX_IEEE1588_TMST | \
RTE_MBUF_F_TX_TCP_SEG | \
RTE_MBUF_F_TX_QINQ | \
RTE_MBUF_F_TX_TUNNEL_MASK | \
RTE_MBUF_F_TX_MACSEC | \
RTE_MBUF_F_TX_SEC_OFFLOAD | \
RTE_MBUF_F_TX_UDP_SEG | \
RTE_MBUF_F_TX_OUTER_UDP_CKSUM)

Bitmask of all supported packet Tx offload features flags, which can be set for packet.

Definition at line 371 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_EXTERNAL

#define RTE_MBUF_F_EXTERNAL   (1ULL << 61)

Mbuf having an external buffer attached. shinfo in mbuf must be filled.

Definition at line 392 of file rte_mbuf_core.h.

◆ RTE_MBUF_F_INDIRECT

#define RTE_MBUF_F_INDIRECT   (1ULL << 62)

Indirect attached mbuf

Definition at line 394 of file rte_mbuf_core.h.

◆ RTE_MBUF_PRIV_ALIGN

#define RTE_MBUF_PRIV_ALIGN   8

Alignment constraint of mbuf private area.

Definition at line 397 of file rte_mbuf_core.h.

◆ RTE_MBUF_DEFAULT_DATAROOM

#define RTE_MBUF_DEFAULT_DATAROOM   2048

Some NICs need at least 2KB buffer to RX standard Ethernet frame without splitting it into multiple segments. So, for mbufs that planned to be involved into RX/TX, the recommended minimal buffer length is 2KB + RTE_PKTMBUF_HEADROOM.

Definition at line 405 of file rte_mbuf_core.h.

◆ RTE_MBUF_MAX_NB_SEGS

#define RTE_MBUF_MAX_NB_SEGS   UINT16_MAX

Maximum number of nb_segs allowed.

Examples:
examples/fips_validation/fips_dev_self_test.c, and examples/fips_validation/main.c.

Definition at line 691 of file rte_mbuf_core.h.

◆ RTE_MBUF_CLONED

#define RTE_MBUF_CLONED (   mb)    ((mb)->ol_flags & RTE_MBUF_F_INDIRECT)

Returns TRUE if given mbuf is cloned by mbuf indirection, or FALSE otherwise.

If a mbuf has its data in another mbuf and references it by mbuf indirection, this mbuf can be defined as a cloned mbuf.

Definition at line 700 of file rte_mbuf_core.h.

◆ RTE_MBUF_HAS_EXTBUF

#define RTE_MBUF_HAS_EXTBUF (   mb)    ((mb)->ol_flags & RTE_MBUF_F_EXTERNAL)

Returns TRUE if given mbuf has an external buffer, or FALSE otherwise.

External buffer is a user-provided anonymous buffer.

Definition at line 707 of file rte_mbuf_core.h.

◆ RTE_MBUF_DIRECT

#define RTE_MBUF_DIRECT (   mb)    (!((mb)->ol_flags & (RTE_MBUF_F_INDIRECT | RTE_MBUF_F_EXTERNAL)))

Returns TRUE if given mbuf is direct, or FALSE otherwise.

If a mbuf embeds its own data after the rte_mbuf structure, this mbuf can be defined as a direct mbuf.

Definition at line 715 of file rte_mbuf_core.h.

◆ RTE_MBUF_PORT_INVALID

#define RTE_MBUF_PORT_INVALID   UINT16_MAX

Uninitialized or unspecified port.

Definition at line 719 of file rte_mbuf_core.h.

◆ MBUF_INVALID_PORT

#define MBUF_INVALID_PORT   RTE_MBUF_PORT_INVALID

For backwards compatibility.

Definition at line 721 of file rte_mbuf_core.h.

◆ rte_pktmbuf_mtod_offset

#define rte_pktmbuf_mtod_offset (   m,
  t,
 
)    ((t)(void *)((char *)(m)->buf_addr + (m)->data_off + (o)))

A macro that points to an offset into the data in the mbuf.

The returned pointer is cast to type t. Before using this function, the user must ensure that the first segment is large enough to accommodate its data.

Parameters
mThe packet mbuf.
oThe offset into the mbuf data.
tThe type to cast the result into.
Examples:
examples/bbdev_app/main.c, examples/ipsec-secgw/esp.c, examples/ipsec-secgw/ipsec-secgw.c, examples/ipsec-secgw/ipsec_process.c, examples/ipsec-secgw/ipsec_worker.c, examples/l2fwd-crypto/main.c, examples/l3fwd-power/main.c, examples/l3fwd/l3fwd_acl.c, examples/l3fwd/l3fwd_lpm.c, examples/ptpclient/ptpclient.c, examples/server_node_efd/efd_node/node.c, examples/server_node_efd/efd_server/main.c, examples/vhost/main.c, and examples/vhost/virtio_net.c.

Definition at line 737 of file rte_mbuf_core.h.

◆ rte_pktmbuf_mtod

#define rte_pktmbuf_mtod (   m,
 
)    rte_pktmbuf_mtod_offset(m, t, 0)

◆ rte_pktmbuf_iova_offset

#define rte_pktmbuf_iova_offset (   m,
 
)    (rte_iova_t)(rte_mbuf_iova_get(m) + (m)->data_off + (o))

A macro that returns the IO address that points to an offset of the start of the data in the mbuf

Parameters
mThe packet mbuf.
oThe offset into the data to calculate address from.
Examples:
examples/fips_validation/fips_dev_self_test.c, examples/ipsec-secgw/esp.c, and examples/l2fwd-crypto/main.c.

Definition at line 763 of file rte_mbuf_core.h.

◆ rte_pktmbuf_iova

#define rte_pktmbuf_iova (   m)    rte_pktmbuf_iova_offset(m, 0)

A macro that returns the IO address that points to the start of the data in the mbuf

Parameters
mThe packet mbuf.
Examples:
examples/dma/dmafwd.c.

Definition at line 773 of file rte_mbuf_core.h.

Typedef Documentation

◆ rte_mbuf_extbuf_free_callback_t

typedef void(* rte_mbuf_extbuf_free_callback_t) (void *addr, void *opaque)

Function typedef of callback to free externally attached buffer.

Definition at line 679 of file rte_mbuf_core.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

enum for the tx_offload bit-fields lengths and offsets. defines the layout of rte_mbuf tx_offload field.

Definition at line 424 of file rte_mbuf_core.h.