DPDK  20.08.0
Data Structures | Macros | Typedefs | Enumerations | Variables
rte_mbuf_core.h File Reference
#include <stdint.h>
#include <rte_compat.h>
#include <generic/rte_atomic.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 PKT_RX_VLAN   (1ULL << 0)
 
#define PKT_RX_RSS_HASH   (1ULL << 1)
 
#define PKT_RX_FDIR   (1ULL << 2)
 
#define PKT_RX_L4_CKSUM_BAD   (1ULL << 3)
 
#define PKT_RX_IP_CKSUM_BAD   (1ULL << 4)
 
#define PKT_RX_EIP_CKSUM_BAD   (1ULL << 5)
 
#define PKT_RX_VLAN_STRIPPED   (1ULL << 6)
 
#define PKT_RX_IP_CKSUM_MASK   ((1ULL << 4) | (1ULL << 7))
 
#define PKT_RX_IP_CKSUM_BAD   (1ULL << 4)
 
#define PKT_RX_L4_CKSUM_MASK   ((1ULL << 3) | (1ULL << 8))
 
#define PKT_RX_L4_CKSUM_BAD   (1ULL << 3)
 
#define PKT_RX_IEEE1588_PTP   (1ULL << 9)
 
#define PKT_RX_IEEE1588_TMST   (1ULL << 10)
 
#define PKT_RX_FDIR_ID   (1ULL << 13)
 
#define PKT_RX_FDIR_FLX   (1ULL << 14)
 
#define PKT_RX_QINQ_STRIPPED   (1ULL << 15)
 
#define PKT_RX_LRO   (1ULL << 16)
 
#define PKT_RX_TIMESTAMP   (1ULL << 17)
 
#define PKT_RX_SEC_OFFLOAD   (1ULL << 18)
 
#define PKT_RX_SEC_OFFLOAD_FAILED   (1ULL << 19)
 
#define PKT_RX_QINQ   (1ULL << 20)
 
#define PKT_RX_OUTER_L4_CKSUM_MASK   ((1ULL << 21) | (1ULL << 22))
 
#define PKT_TX_OUTER_UDP_CKSUM   (1ULL << 41)
 
#define PKT_TX_UDP_SEG   (1ULL << 42)
 
#define PKT_TX_SEC_OFFLOAD   (1ULL << 43)
 
#define PKT_TX_MACSEC   (1ULL << 44)
 
#define PKT_TX_TUNNEL_VXLAN   (0x1ULL << 45)
 
#define PKT_TX_TUNNEL_MPLSINUDP   (0x5ULL << 45)
 
#define PKT_TX_TUNNEL_IP   (0xDULL << 45)
 
#define PKT_TX_TUNNEL_UDP   (0xEULL << 45)
 
#define PKT_TX_QINQ   (1ULL << 49)
 
#define PKT_TX_TCP_SEG   (1ULL << 50)
 
#define PKT_TX_IEEE1588_TMST   (1ULL << 51)
 
#define PKT_TX_L4_NO_CKSUM   (0ULL << 52)
 
#define PKT_TX_TCP_CKSUM   (1ULL << 52)
 
#define PKT_TX_SCTP_CKSUM   (2ULL << 52)
 
#define PKT_TX_UDP_CKSUM   (3ULL << 52)
 
#define PKT_TX_L4_MASK   (3ULL << 52)
 
#define PKT_TX_IP_CKSUM   (1ULL << 54)
 
#define PKT_TX_IPV4   (1ULL << 55)
 
#define PKT_TX_IPV6   (1ULL << 56)
 
#define PKT_TX_VLAN   (1ULL << 57)
 
#define PKT_TX_OUTER_IP_CKSUM   (1ULL << 58)
 
#define PKT_TX_OUTER_IPV4   (1ULL << 59)
 
#define PKT_TX_OUTER_IPV6   (1ULL << 60)
 
#define PKT_TX_OFFLOAD_MASK
 
#define EXT_ATTACHED_MBUF   (1ULL << 61)
 
#define IND_ATTACHED_MBUF   (1ULL << 62)
 
#define RTE_MBUF_PRIV_ALIGN   8
 
#define RTE_MBUF_DEFAULT_DATAROOM   2048
 
#define RTE_MBUF_CLONED(mb)   ((mb)->ol_flags & IND_ATTACHED_MBUF)
 
#define RTE_MBUF_HAS_EXTBUF(mb)   ((mb)->ol_flags & EXT_ATTACHED_MBUF)
 
#define RTE_MBUF_DIRECT(mb)   (!((mb)->ol_flags & (IND_ATTACHED_MBUF | EXT_ATTACHED_MBUF)))
 
#define rte_pktmbuf_mtod_offset(m, t, o)   ((t)((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)((m)->buf_iova + (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  
 

Variables

rte_iova_t buf_physaddr
 

Detailed Description

This file contains definion 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

#define PKT_RX_VLAN   (1ULL << 0)

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.

Examples:
examples/bpf/t2.c.

Definition at line 49 of file rte_mbuf_core.h.

#define PKT_RX_RSS_HASH   (1ULL << 1)

RX packet with RSS hash result.

Definition at line 52 of file rte_mbuf_core.h.

#define PKT_RX_FDIR   (1ULL << 2)

RX packet with FDIR match indicate.

Definition at line 55 of file rte_mbuf_core.h.

#define PKT_RX_L4_CKSUM_BAD   (1ULL << 3)

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.

Examples:
examples/tep_termination/vxlan_setup.c.

Definition at line 112 of file rte_mbuf_core.h.

#define PKT_RX_IP_CKSUM_BAD   (1ULL << 4)

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.

Examples:
examples/tep_termination/vxlan_setup.c.

Definition at line 97 of file rte_mbuf_core.h.

#define PKT_RX_EIP_CKSUM_BAD   (1ULL << 5)

External IP header checksum error.

Definition at line 76 of file rte_mbuf_core.h.

#define PKT_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 PKT_RX_VLAN_STRIPPED is set, PKT_RX_VLAN must also be set.

Examples:
examples/bpf/t2.c.

Definition at line 84 of file rte_mbuf_core.h.

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

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.

Definition at line 94 of file rte_mbuf_core.h.

#define PKT_RX_IP_CKSUM_BAD   (1ULL << 4)

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.

Definition at line 97 of file rte_mbuf_core.h.

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

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.

Definition at line 109 of file rte_mbuf_core.h.

#define PKT_RX_L4_CKSUM_BAD   (1ULL << 3)

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.

Definition at line 112 of file rte_mbuf_core.h.

#define PKT_RX_IEEE1588_PTP   (1ULL << 9)

RX IEEE1588 L2 Ethernet PT Packet.

Examples:
examples/ptpclient/ptpclient.c.

Definition at line 117 of file rte_mbuf_core.h.

#define PKT_RX_IEEE1588_TMST   (1ULL << 10)

RX IEEE1588 L2/L4 timestamped packet.

Definition at line 120 of file rte_mbuf_core.h.

#define PKT_RX_FDIR_ID   (1ULL << 13)

FD id reported if FDIR match.

Definition at line 123 of file rte_mbuf_core.h.

#define PKT_RX_FDIR_FLX   (1ULL << 14)

Flexible bytes reported if FDIR match.

Definition at line 126 of file rte_mbuf_core.h.

#define PKT_RX_QINQ_STRIPPED   (1ULL << 15)

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. When PKT_RX_QINQ_STRIPPED is set, the flags (PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED | PKT_RX_QINQ) must also be set.

Definition at line 136 of file rte_mbuf_core.h.

#define PKT_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.

Definition at line 143 of file rte_mbuf_core.h.

#define PKT_RX_TIMESTAMP   (1ULL << 17)

Indicate that the timestamp field in the mbuf is valid.

Definition at line 148 of file rte_mbuf_core.h.

#define PKT_RX_SEC_OFFLOAD   (1ULL << 18)

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

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

Definition at line 153 of file rte_mbuf_core.h.

#define PKT_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 158 of file rte_mbuf_core.h.

#define PKT_RX_QINQ   (1ULL << 20)

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

Definition at line 168 of file rte_mbuf_core.h.

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

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

  • PKT_RX_OUTER_L4_CKSUM_UNKNOWN: no info about the outer RX L4 checksum
  • PKT_RX_OUTER_L4_CKSUM_BAD: the outer L4 checksum in the packet is wrong
  • PKT_RX_OUTER_L4_CKSUM_GOOD: the outer L4 checksum in the packet is valid
  • PKT_RX_OUTER_L4_CKSUM_INVALID: invalid outer L4 checksum state.

The detection of PKT_RX_OUTER_L4_CKSUM_GOOD shall be based on the given HW capability, At minimum, the PMD should support PKT_RX_OUTER_L4_CKSUM_UNKNOWN and PKT_RX_OUTER_L4_CKSUM_BAD states if the DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload is available.

Definition at line 182 of file rte_mbuf_core.h.

#define PKT_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 PKT_TX_OUTER_UDP_CKSUM flag. c) Set the PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6 flag. 2) Configure DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flag.

Definition at line 205 of file rte_mbuf_core.h.

#define PKT_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 212 of file rte_mbuf_core.h.

#define PKT_TX_SEC_OFFLOAD   (1ULL << 43)

Request security offload processing on the TX packet.

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

Definition at line 217 of file rte_mbuf_core.h.

#define PKT_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 223 of file rte_mbuf_core.h.

#define PKT_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 PKT_TX_TCP_SEG for TSO, or PKT_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.

Examples:
examples/tep_termination/vxlan.c.

Definition at line 233 of file rte_mbuf_core.h.

#define PKT_TX_TUNNEL_MPLSINUDP   (0x5ULL << 45)

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

Definition at line 238 of file rte_mbuf_core.h.

#define PKT_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 PKT_TX_TUNNEL_GRE or PKT_TX_TUNNEL_IPIP if possible. The ethdev must be configured with DEV_TX_OFFLOAD_IP_TNL_TSO. Outer and inner checksums are done according to the existing flags like PKT_TX_xxx_CKSUM. Specific tunnel headers that contain payload length, sequence id or checksum are not expected to be updated.

Definition at line 252 of file rte_mbuf_core.h.

#define PKT_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 PKT_TX_TUNNEL_VXLAN if possible. The ethdev must be configured with DEV_TX_OFFLOAD_UDP_TNL_TSO. Outer and inner checksums are done according to the existing flags like PKT_TX_xxx_CKSUM. Specific tunnel headers that contain payload length, sequence id or checksum are not expected to be updated.

Definition at line 265 of file rte_mbuf_core.h.

#define PKT_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 274 of file rte_mbuf_core.h.

#define PKT_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 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
Examples:
examples/tep_termination/vxlan.c, and examples/vhost/main.c.

Definition at line 287 of file rte_mbuf_core.h.

#define PKT_TX_IEEE1588_TMST   (1ULL << 51)

TX IEEE1588 packet to timestamp.

Examples:
examples/ptpclient/ptpclient.c.

Definition at line 290 of file rte_mbuf_core.h.

#define PKT_TX_L4_NO_CKSUM   (0ULL << 52)

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_IPV6Disable L4 cksum of TX pkt.

Definition at line 300 of file rte_mbuf_core.h.

#define PKT_TX_TCP_CKSUM   (1ULL << 52)

TCP cksum of TX pkt. computed by NIC.

Examples:
examples/tep_termination/vxlan.c.

Definition at line 303 of file rte_mbuf_core.h.

#define PKT_TX_SCTP_CKSUM   (2ULL << 52)

SCTP cksum of TX pkt. computed by NIC.

Examples:
examples/tep_termination/vxlan.c.

Definition at line 306 of file rte_mbuf_core.h.

#define PKT_TX_UDP_CKSUM   (3ULL << 52)

UDP cksum of TX pkt. computed by NIC.

Examples:
examples/tep_termination/vxlan.c.

Definition at line 309 of file rte_mbuf_core.h.

#define PKT_TX_L4_MASK   (3ULL << 52)

Mask for L4 cksum offload request.

Definition at line 312 of file rte_mbuf_core.h.

#define PKT_TX_IP_CKSUM   (1ULL << 54)

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
Examples:
examples/ip_fragmentation/main.c, examples/ip_reassembly/main.c, examples/ipsec-secgw/ipsec-secgw.c, examples/tep_termination/vxlan.c, and examples/vhost/main.c.

Definition at line 320 of file rte_mbuf_core.h.

#define PKT_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, examples/tep_termination/vxlan.c, and examples/vhost/main.c.

Definition at line 328 of file rte_mbuf_core.h.

#define PKT_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/tep_termination/vxlan.c.

Definition at line 336 of file rte_mbuf_core.h.

#define PKT_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.

Definition at line 343 of file rte_mbuf_core.h.

#define PKT_TX_OUTER_IP_CKSUM   (1ULL << 58)

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
Examples:
examples/tep_termination/vxlan.c.

Definition at line 353 of file rte_mbuf_core.h.

#define PKT_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 360 of file rte_mbuf_core.h.

#define PKT_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 367 of file rte_mbuf_core.h.

#define PKT_TX_OFFLOAD_MASK
Value:
( \
PKT_TX_VLAN_PKT | \
PKT_TX_QINQ_PKT | \
PKT_TX_TUNNEL_MASK | \
#define PKT_TX_OUTER_IP_CKSUM
#define PKT_TX_IEEE1588_TMST
#define PKT_TX_IPV4
#define PKT_TX_OUTER_IPV4
#define PKT_TX_TCP_SEG
#define PKT_TX_SEC_OFFLOAD
#define PKT_TX_MACSEC
#define PKT_TX_IP_CKSUM
#define PKT_TX_IPV6
#define PKT_TX_L4_MASK
#define PKT_TX_UDP_SEG
#define PKT_TX_OUTER_IPV6
#define PKT_TX_OUTER_UDP_CKSUM

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

Definition at line 373 of file rte_mbuf_core.h.

#define EXT_ATTACHED_MBUF   (1ULL << 61)

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

Definition at line 394 of file rte_mbuf_core.h.

#define IND_ATTACHED_MBUF   (1ULL << 62)

Indirect attached mbuf

Definition at line 396 of file rte_mbuf_core.h.

#define RTE_MBUF_PRIV_ALIGN   8

Alignment constraint of mbuf private area.

Definition at line 399 of file rte_mbuf_core.h.

#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 407 of file rte_mbuf_core.h.

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

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 699 of file rte_mbuf_core.h.

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

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

External buffer is a user-provided anonymous buffer.

Definition at line 706 of file rte_mbuf_core.h.

#define RTE_MBUF_DIRECT (   mb)    (!((mb)->ol_flags & (IND_ATTACHED_MBUF | EXT_ATTACHED_MBUF)))

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 714 of file rte_mbuf_core.h.

#define rte_pktmbuf_mtod_offset (   m,
  t,
 
)    ((t)((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/l3fwd-acl/main.c, examples/l3fwd-power/main.c, examples/l3fwd/l3fwd_lpm.c, examples/performance-thread/l3fwd-thread/main.c, examples/server_node_efd/node/node.c, examples/server_node_efd/server/main.c, and examples/vhost/virtio_net.c.

Definition at line 733 of file rte_mbuf_core.h.

#define rte_pktmbuf_mtod (   m,
 
)    rte_pktmbuf_mtod_offset(m, t, 0)
#define rte_pktmbuf_iova_offset (   m,
 
)    (rte_iova_t)((m)->buf_iova + (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 759 of file rte_mbuf_core.h.

#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.

Definition at line 769 of file rte_mbuf_core.h.

Typedef Documentation

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

Function typedef of callback to free externally attached buffer.

Definition at line 674 of file rte_mbuf_core.h.

Enumeration Type Documentation

anonymous enum

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

Definition at line 426 of file rte_mbuf_core.h.

Variable Documentation

rte_iova_t buf_physaddr

deprecated

Definition at line 481 of file rte_mbuf_core.h.