types - Testpmd types
TestPmd types module.
Exposes types used in the TestPmd API.
- class TestPmdDevice
Bases:
objectThe data of a device that testpmd can recognize.
- pci_address
The PCI address of the device.
- Type:
str
- __init__(pci_address_line: str) None
Initialize the device from the testpmd output line string.
- Parameters:
pci_address_line (str) – A line of testpmd output that contains a device.
- class VLANOffloadFlag
Bases:
FlagFlag representing the VLAN offload settings of a NIC port.
- STRIP = 1
- FILTER = 2
- EXTEND = 4
- QINQ_STRIP = 8
- classmethod from_str_dict(d) typing_extensions.Self
Makes an instance from a dict containing the flag member names with an “on” value.
- Parameters:
d – A dictionary containing the flag members as keys and any string value.
- Returns:
A new instance of the flag.
- Return type:
typing_extensions.Self
- class ChecksumOffloadOptions
Bases:
FlagFlag representing checksum hardware offload layer options.
- ip = 1
- udp = 2
- tcp = 4
- sctp = 8
- outer_ip = 16
- outer_udp = 32
- class RSSOffloadTypesFlag
Bases:
FlagFlag representing the RSS offload flow types supported by the NIC port.
- ipv4 = 1
- ipv4_frag = 2
- ipv4_tcp = 4
- ipv4_udp = 8
- ipv4_sctp = 16
- ipv4_other = 32
- ipv6 = 64
- ipv6_frag = 128
- ipv6_tcp = 256
- ipv6_udp = 512
- ipv6_sctp = 1024
- ipv6_other = 2048
- l2_payload = 4096
- ipv6_ex = 8192
- ipv6_tcp_ex = 16384
- ipv6_udp_ex = 32768
- port = 65536
- vxlan = 131072
- geneve = 262144
- nvgre = 524288
- user_defined_22 = 1048576
- gtpu = 2097152
- eth = 4194304
- s_vlan = 8388608
- c_vlan = 16777216
- esp = 33554432
- ah = 67108864
- l2tpv3 = 134217728
- pfcp = 268435456
- pppoe = 536870912
- ecpri = 1073741824
- mpls = 2147483648
- ipv4_chksum = 4294967296
- l4_chksum = 8589934592
- l2tpv2 = 17179869184
- ipv6_flow_label = 34359738368
- user_defined_38 = 68719476736
- user_defined_39 = 137438953472
- user_defined_40 = 274877906944
- user_defined_41 = 549755813888
- user_defined_42 = 1099511627776
- user_defined_43 = 2199023255552
- user_defined_44 = 4398046511104
- user_defined_45 = 8796093022208
- user_defined_46 = 17592186044416
- user_defined_47 = 35184372088832
- user_defined_48 = 70368744177664
- user_defined_49 = 140737488355328
- user_defined_50 = 281474976710656
- user_defined_51 = 562949953421312
- l3_pre96 = 1125899906842624
- l3_pre64 = 2251799813685248
- l3_pre56 = 4503599627370496
- l3_pre48 = 9007199254740992
- l3_pre40 = 18014398509481984
- l3_pre32 = 36028797018963968
- l2_dst_only = 72057594037927936
- l2_src_only = 144115188075855872
- l4_dst_only = 288230376151711744
- l4_src_only = 576460752303423488
- l3_dst_only = 1152921504606846976
- l3_src_only = 2305843009213693952
- ip = 10467
- udp = 33288
- tcp = 16644
- sctp = 1040
- tunnel = 917504
- vlan = 25165824
- all = 20935933951
- classmethod from_list_string(names: str) typing_extensions.Self
Makes a flag from a whitespace-separated list of names.
- Parameters:
names (str) – a whitespace-separated list containing the members of this flag.
- Returns:
An instance of this flag.
- Return type:
typing_extensions.Self
- classmethod from_str(name: str) typing_extensions.Self
Makes a flag matching the supplied name.
- Parameters:
name (str) – a valid member of this flag in text
- Returns:
An instance of this flag.
- Return type:
typing_extensions.Self
- class DeviceCapabilitiesFlag
Bases:
FlagFlag representing the device capabilities.
- RUNTIME_RX_QUEUE_SETUP = 1
Device supports Rx queue setup after device started.
- RUNTIME_TX_QUEUE_SETUP = 2
Device supports Tx queue setup after device started.
- RXQ_SHARE = 4
Device supports shared Rx queue among ports within Rx domain and switch domain.
- FLOW_RULE_KEEP = 8
Device supports keeping flow rules across restart.
- FLOW_SHARED_OBJECT_KEEP = 16
Device supports keeping shared flow objects across restart.
- class DeviceErrorHandlingMode
Bases:
StrEnumEnum representing the device error handling mode.
- none = 'none'
- passive = 'passive'
- proactive = 'proactive'
- unknown = 'unknown'
- class RxQueueState
Bases:
StrEnumRX queue states.
References
DPDK lib:
lib/ethdev/rte_ethdev.htestpmd display function:app/test-pmd/config.c:get_queue_state_name()- stopped = 'stopped'
- started = 'started'
- hairpin = 'hairpin'
- unknown = 'unknown'
- class TestPmdQueueInfo
Bases:
TextParserDataclass representation of the common parts of the testpmd show rxq/txq info commands.
- prefetch_threshold: int
- host_threshold: int
- writeback_threshold: int
- free_threshold: int
- deferred_start: bool
- ring_size: int
The number of RXD/TXDs is just the ring size of the queue.
- is_queue_started: bool
- burst_mode: str | None = None
- __init__(prefetch_threshold: int, host_threshold: int, writeback_threshold: int, free_threshold: int, deferred_start: bool, ring_size: int, is_queue_started: bool, burst_mode: str | None = None) None
- class TestPmdTxqInfo
Bases:
TestPmdQueueInfoRepresentation of testpmd’s
show txq info <port_id> <queue_id>command.References
testpmd command function:
app/test-pmd/cmdline.c:cmd_showqueue()testpmd display function:app/test-pmd/config.c:rx_queue_infos_display()- rs_threshold: int | None = None
Ring size threshold
- __init__(prefetch_threshold: int, host_threshold: int, writeback_threshold: int, free_threshold: int, deferred_start: bool, ring_size: int, is_queue_started: bool, burst_mode: str | None = None, rs_threshold: int | None = None) None
- class TestPmdRxqInfo
Bases:
TestPmdQueueInfoRepresentation of testpmd’s
show rxq info <port_id> <queue_id>command.References
testpmd command function:
app/test-pmd/cmdline.c:cmd_showqueue()testpmd display function:app/test-pmd/config.c:rx_queue_infos_display()- mempool: str | None = None
Mempool used by that queue
- drop_packets: bool | None = None
Drop packets if no descriptors are available
- scattered_packets: bool | None = None
Scattered packets Rx enabled
- queue_state: str | None = None
The state of the queue
- __init__(prefetch_threshold: int, host_threshold: int, writeback_threshold: int, free_threshold: int, deferred_start: bool, ring_size: int, is_queue_started: bool, burst_mode: str | None = None, mempool: str | None = None, drop_packets: bool | None = None, scattered_packets: bool | None = None, queue_state: str | None = None) None
- class TestPmdPort
Bases:
TextParserDataclass representing the result of testpmd’s
show port infocommand.- id: int
- device_name: str
- driver_name: str
- socket_id: int
- is_link_up: bool
- link_speed: str
- is_link_full_duplex: bool
- is_link_autonegotiated: bool
- is_promiscuous_mode_enabled: bool
- is_allmulticast_mode_enabled: bool
- max_mac_addresses_num: int
Maximum number of MAC addresses
- max_hash_mac_addresses_num: int
Maximum configurable length of RX packet
- min_rx_bufsize: int
Minimum size of RX buffer
- max_rx_packet_length: int
Maximum configurable length of RX packet
- max_lro_packet_size: int
Maximum configurable size of LRO aggregated packet
- rx_queues_num: int
Current number of RX queues
- max_rx_queues_num: int
Max possible RX queues
- max_queue_rxd_num: int
Max possible number of RXDs per queue
- min_queue_rxd_num: int
Min possible number of RXDs per queue
- rxd_alignment_num: int
RXDs number alignment
- tx_queues_num: int
Current number of TX queues
- max_tx_queues_num: int
Max possible TX queues
- max_queue_txd_num: int
Max possible number of TXDs per queue
- min_queue_txd_num: int
Min possible number of TXDs per queue
- txd_alignment_num: int
TXDs number alignment
- max_packet_segment_num: int
Max segment number per packet
- max_mtu_segment_num: int
Max segment number per MTU/TSO
- device_capabilities: DeviceCapabilitiesFlag
- device_error_handling_mode: api.testpmd.types.DeviceErrorHandlingMode | None = None
- device_private_info: str | None = None
- hash_key_size: int | None = None
- redirection_table_size: int | None = None
- supported_rss_offload_flow_types: RSSOffloadTypesFlag = 0
- mac_address: str | None = None
- fw_version: str | None = None
- dev_args: str | None = None
- mem_alloc_socket_id: int | None = None
Socket id of the memory allocation
- mtu: int | None = None
- vlan_offload: api.testpmd.types.VLANOffloadFlag | None = None
- max_rx_bufsize: int | None = None
Maximum size of RX buffer
- max_vfs_num: int | None = None
Maximum number of VFs
- max_vmdq_pools_num: int | None = None
Maximum number of VMDq pools
- switch_name: str | None = None
- switch_domain_id: int | None = None
- switch_port_id: int | None = None
- switch_rx_domain: int | None = None
- __init__(id: int, device_name: str, driver_name: str, socket_id: int, is_link_up: bool, link_speed: str, is_link_full_duplex: bool, is_link_autonegotiated: bool, is_promiscuous_mode_enabled: bool, is_allmulticast_mode_enabled: bool, max_mac_addresses_num: int, max_hash_mac_addresses_num: int, min_rx_bufsize: int, max_rx_packet_length: int, max_lro_packet_size: int, rx_queues_num: int, max_rx_queues_num: int, max_queue_rxd_num: int, min_queue_rxd_num: int, rxd_alignment_num: int, tx_queues_num: int, max_tx_queues_num: int, max_queue_txd_num: int, min_queue_txd_num: int, txd_alignment_num: int, max_packet_segment_num: int, max_mtu_segment_num: int, device_capabilities: ~api.testpmd.types.DeviceCapabilitiesFlag, device_error_handling_mode: api.testpmd.types.DeviceErrorHandlingMode | None = None, device_private_info: str | None = None, hash_key_size: int | None = None, redirection_table_size: int | None = None, supported_rss_offload_flow_types: ~api.testpmd.types.RSSOffloadTypesFlag = RSSOffloadTypesFlag.None, mac_address: str | None = None, fw_version: str | None = None, dev_args: str | None = None, mem_alloc_socket_id: int | None = None, mtu: int | None = None, vlan_offload: api.testpmd.types.VLANOffloadFlag | None = None, max_rx_bufsize: int | None = None, max_vfs_num: int | None = None, max_vmdq_pools_num: int | None = None, switch_name: str | None = None, switch_domain_id: int | None = None, switch_port_id: int | None = None, switch_rx_domain: int | None = None) None
- class TestPmdPortStats
Bases:
TextParserPort statistics.
- port_id: int
- rx_packets: int
- rx_missed: int
- rx_bytes: int
- rx_errors: int
- rx_nombuf: int
- tx_packets: int
- tx_errors: int
- tx_bytes: int
- rx_pps: int
- rx_bps: int
- tx_pps: int
- tx_bps: int
- __init__(port_id: int, rx_packets: int, rx_missed: int, rx_bytes: int, rx_errors: int, rx_nombuf: int, tx_packets: int, tx_errors: int, tx_bytes: int, rx_pps: int, rx_bps: int, tx_pps: int, tx_bps: int) None
- class FlowRule
Bases:
objectClass representation of flow rule parameters.
This class represents the parameters of any flow rule as per the following pattern:
[group {group_id}] [priority {level}] [ingress] [egress] [user_id {user_id}] pattern {item} [/ {item} […]] / end actions {action} [/ {action} […]] / end
- group_id: int | None = None
- priority_level: int | None = None
- direction: Literal['ingress', 'egress']
- user_id: int | None = None
- pattern: list[str]
- actions: list[str]
- __init__(*, group_id: int | None = None, priority_level: int | None = None, direction: Literal['ingress', 'egress'], user_id: int | None = None, pattern: list[str], actions: list[str]) None
- class PacketOffloadFlag
Bases:
FlagFlag representing the Packet Offload Features Flags in DPDK.
Values in this class are taken from the definitions in the RTE MBUF core library in DPDK located in
lib/mbuf/rte_mbuf_core.h. It is expected that flag values in this class will match the values they are set to in said DPDK library with one exception; all values must be unique. For example, the definitions for unknown checksum flags inrte_mbuf_core.hare all set to0, but it is valuable to distinguish between them in this framework. For this reason flags that are not unique in the DPDK library are set either to values within the RTE_MBUF_F_FIRST_FREE-RTE_MBUF_F_LAST_FREE range for Rx or shifted 61+ bits for Tx.References
DPDK lib:
lib/mbuf/rte_mbuf_core.h- RTE_MBUF_F_RX_VLAN = 1
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.
- RTE_MBUF_F_RX_RSS_HASH = 2
RX packet with RSS hash result.
- RTE_MBUF_F_RX_FDIR = 4
RX packet with FDIR match indicate.
- RTE_MBUF_F_RX_OUTER_IP_CKSUM_BAD = 32
This flag is set when the outermost IP header checksum is detected as wrong by the hardware.
- RTE_MBUF_F_RX_VLAN_STRIPPED = 64
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.
- RTE_MBUF_F_RX_IP_CKSUM_UNKNOWN = 8388608
No information about the RX IP checksum. Value is 0 in the DPDK library.
- RTE_MBUF_F_RX_IP_CKSUM_BAD = 16
The IP checksum in the packet is wrong.
- RTE_MBUF_F_RX_IP_CKSUM_GOOD = 128
The IP checksum in the packet is valid.
- RTE_MBUF_F_RX_IP_CKSUM_NONE = 16777216
The IP checksum is not correct in the packet data, but the integrity of the IP header is verified. Value is RTE_MBUF_F_RX_IP_CKSUM_BAD | RTE_MBUF_F_RX_IP_CKSUM_GOOD in the DPDK library.
- RTE_MBUF_F_RX_L4_CKSUM_UNKNOWN = 33554432
No information about the RX L4 checksum. Value is 0 in the DPDK library.
- RTE_MBUF_F_RX_L4_CKSUM_BAD = 8
The L4 checksum in the packet is wrong.
- RTE_MBUF_F_RX_L4_CKSUM_GOOD = 256
The L4 checksum in the packet is valid.
- RTE_MBUF_F_RX_L4_CKSUM_NONE = 67108864
The L4 checksum is not correct in the packet data, but the integrity of the L4 data is verified. Value is RTE_MBUF_F_RX_L4_CKSUM_BAD | RTE_MBUF_F_RX_L4_CKSUM_GOOD in the DPDK library.
- RTE_MBUF_F_RX_IEEE1588_PTP = 512
RX IEEE1588 L2 Ethernet PT Packet.
- RTE_MBUF_F_RX_IEEE1588_TMST = 1024
RX IEEE1588 L2/L4 timestamped packet.
- RTE_MBUF_F_RX_FDIR_ID = 8192
FD id reported if FDIR match.
- RTE_MBUF_F_RX_FDIR_FLX = 16384
Flexible bytes reported if FDIR match.
- RTE_MBUF_F_RX_QINQ_STRIPPED = 134217728
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. 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.
- RTE_MBUF_F_RX_LRO = 268435456
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.
- RTE_MBUF_F_RX_SEC_OFFLOAD = 262144
Indicate that security offload processing was applied on the RX packet.
- RTE_MBUF_F_RX_SEC_OFFLOAD_FAILED = 536870912
Indicate that security offload processing failed on the RX packet.
- RTE_MBUF_F_RX_QINQ = 1073741824
The RX packet is a double VLAN. If this flag is set, RTE_MBUF_F_RX_VLAN must also be set. 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.
- RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN = 134217728
No info about the outer RX L4 checksum. Value is 0 in the DPDK library.
- RTE_MBUF_F_RX_OUTER_L4_CKSUM_BAD = 2097152
The outer L4 checksum in the packet is wrong
- RTE_MBUF_F_RX_OUTER_L4_CKSUM_GOOD = 4194304
The outer L4 checksum in the packet is valid
- RTE_MBUF_F_RX_OUTER_L4_CKSUM_INVALID = 268435456
Invalid outer L4 checksum state. Value is RTE_MBUF_F_RX_OUTER_L4_CKSUM_BAD | RTE_MBUF_F_RX_OUTER_L4_CKSUM_GOOD in the DPDK library.
- RTE_MBUF_F_TX_OUTER_UDP_CKSUM = 2199023255552
Outer UDP checksum offload flag. This flag is used for enabling outer UDP checksum in PMD. To use outer UDP checksum, the user either needs to enable the following in mbuf:
Fill outer_l2_len and outer_l3_len in mbuf.
Set the RTE_MBUF_F_TX_OUTER_UDP_CKSUM flag.
Set the RTE_MBUF_F_TX_OUTER_IPV4 or RTE_MBUF_F_TX_OUTER_IPV6 flag.
Or configure RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM offload flag.
- RTE_MBUF_F_TX_UDP_SEG = 4398046511104
UDP Fragmentation Offload flag. This flag is used for enabling UDP fragmentation in SW or in HW.
- RTE_MBUF_F_TX_SEC_OFFLOAD = 8796093022208
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.
- RTE_MBUF_F_TX_MACSEC = 17592186044416
Offload the MACsec. This flag must be set by the application to enable this offload feature for a packet to be transmitted.
- RTE_MBUF_F_TX_TUNNEL_VXLAN = 35184372088832
- RTE_MBUF_F_TX_TUNNEL_GRE = 70368744177664
- RTE_MBUF_F_TX_TUNNEL_IPIP = 2305843009213693952
Value is 3 << 45 in the DPDK library.
- RTE_MBUF_F_TX_TUNNEL_GENEVE = 140737488355328
- RTE_MBUF_F_TX_TUNNEL_MPLSINUDP = 4611686018427387904
TX packet with MPLS-in-UDP RFC 7510 header. Value is 5 << 45 in the DPDK library.
- RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE = 9223372036854775808
Value is 6 << 45 in the DPDK library.
- RTE_MBUF_F_TX_TUNNEL_GTP = 18446744073709551616
Value is 7 << 45 in the DPDK library.
- RTE_MBUF_F_TX_TUNNEL_ESP = 281474976710656
- RTE_MBUF_F_TX_TUNNEL_IP = 36893488147419103232
Generic IP encapsulated tunnel type, used for TSO and checksum offload. This 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. Value is 0xD << 45 in the DPDK library.
- RTE_MBUF_F_TX_TUNNEL_UDP = 73786976294838206464
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. value is 0xE << 45 in the DPDK library.
- RTE_MBUF_F_TX_QINQ = 562949953421312
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.
- RTE_MBUF_F_TX_TCP_SEG = 147573952589676412928
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
- RTE_MBUF_F_TX_IEEE1588_TMST = 295147905179352825856
TX IEEE1588 packet to timestamp.
- RTE_MBUF_F_TX_L4_NO_CKSUM = 147573952589676412928
Disable L4 cksum of TX pkt. Value is 0 in the DPDK library.
- RTE_MBUF_F_TX_TCP_CKSUM = 4503599627370496
TCP cksum of TX pkt. Computed by NIC.
- RTE_MBUF_F_TX_SCTP_CKSUM = 9007199254740992
SCTP cksum of TX pkt. Computed by NIC.
- RTE_MBUF_F_TX_UDP_CKSUM = 295147905179352825856
UDP cksum of TX pkt. Computed by NIC. Value is 3 << 52 in the DPDK library.
- RTE_MBUF_F_TX_IP_CKSUM = 18014398509481984
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.
- RTE_MBUF_F_TX_IPV4 = 590295810358705651712
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.
- RTE_MBUF_F_TX_IPV6 = 1180591620717411303424
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.
- RTE_MBUF_F_TX_VLAN = 2361183241434822606848
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.
- RTE_MBUF_F_TX_OUTER_IP_CKSUM = 4722366482869645213696
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.
- RTE_MBUF_F_TX_OUTER_IPV4 = 9444732965739290427392
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.
- RTE_MBUF_F_TX_OUTER_IPV6 = 18889465931478580854784
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.
- classmethod from_list_string(names: str) typing_extensions.Self
Makes a flag from a whitespace-separated list of names.
- Parameters:
names (str) – a whitespace-separated list containing the members of this flag.
- Returns:
An instance of this flag.
- Return type:
typing_extensions.Self
- classmethod from_str(name: str) typing_extensions.Self
Makes a flag matching the supplied name.
- Parameters:
name (str) – a valid member of this flag in text
- Returns:
An instance of this flag.
- Return type:
typing_extensions.Self
- class RtePTypes
Bases:
FlagFlag representing possible packet types in DPDK verbose output.
Values in this class are derived from definitions in the RTE MBUF ptype library in DPDK located in
lib/mbuf/rte_mbuf_ptype.h. Specifically, the names of values in this class should match the possible return options from the functionsrte_get_ptype_*_nameinrte_mbuf_ptype.c.References
DPDK lib:
lib/mbuf/rte_mbuf_ptype.hDPDK ptype name formatting functions:lib/mbuf/rte_mbuf_ptype.c:rte_get_ptype_*_name()- L2_ETHER = 1
Ethernet packet type. This is used for outer packet for tunneling cases.
- L2_ETHER_TIMESYNC = 2
Ethernet packet type for time sync.
- L2_ETHER_ARP = 4
ARP (Address Resolution Protocol) packet type.
- L2_ETHER_LLDP = 8
LLDP (Link Layer Discovery Protocol) packet type.
- L2_ETHER_NSH = 16
NSH (Network Service Header) packet type.
- L2_ETHER_VLAN = 32
VLAN packet type.
- L2_ETHER_QINQ = 64
QinQ packet type.
- L2_ETHER_PPPOE = 128
PPPOE packet type.
- L2_ETHER_FCOE = 256
FCoE packet type..
- L2_ETHER_MPLS = 512
MPLS packet type.
- L2_UNKNOWN = 1024
No L2 packet information.
- L3_IPV4 = 2048
IP (Internet Protocol) version 4 packet type. This is used for outer packet for tunneling cases, and does not contain any header option.
- L3_IPV4_EXT = 4096
IP (Internet Protocol) version 4 packet type. This is used for outer packet for tunneling cases, and contains header options.
- L3_IPV6 = 8192
IP (Internet Protocol) version 6 packet type. This is used for outer packet for tunneling cases, and does not contain any extension header.
- L3_IPV4_EXT_UNKNOWN = 16384
IP (Internet Protocol) version 4 packet type. This is used for outer packet for tunneling cases, and may or maynot contain header options.
- L3_IPV6_EXT = 32768
IP (Internet Protocol) version 6 packet type. This is used for outer packet for tunneling cases, and contains extension headers.
- L3_IPV6_EXT_UNKNOWN = 65536
IP (Internet Protocol) version 6 packet type. This is used for outer packet for tunneling cases, and may or maynot contain extension headers.
- L3_UNKNOWN = 131072
No L3 packet information.
- L4_TCP = 262144
TCP (Transmission Control Protocol) packet type. This is used for outer packet for tunneling cases.
- L4_UDP = 524288
UDP (User Datagram Protocol) packet type. This is used for outer packet for tunneling cases.
- L4_FRAG = 1048576
Fragmented IP (Internet Protocol) packet type. This is used for outer packet for tunneling cases and refers to those packets of any IP types which can be recognized as fragmented. A fragmented packet cannot be recognized as any other L4 types (RTE_PTYPE_L4_TCP, RTE_PTYPE_L4_UDP, RTE_PTYPE_L4_SCTP, RTE_PTYPE_L4_ICMP, RTE_PTYPE_L4_NONFRAG).
- L4_SCTP = 2097152
SCTP (Stream Control Transmission Protocol) packet type. This is used for outer packet for tunneling cases.
- L4_ICMP = 4194304
ICMP (Internet Control Message Protocol) packet type. This is used for outer packet for tunneling cases.
- L4_NONFRAG = 8388608
Non-fragmented IP (Internet Protocol) packet type. This is used for outer packet for tunneling cases and refers to those packets of any IP types, that cannot be recognized as any of the above L4 types (RTE_PTYPE_L4_TCP, RTE_PTYPE_L4_UDP, RTE_PTYPE_L4_FRAG, RTE_PTYPE_L4_SCTP, RTE_PTYPE_L4_ICMP).
- L4_IGMP = 16777216
IGMP (Internet Group Management Protocol) packet type.
- L4_UNKNOWN = 33554432
No L4 packet information.
- TUNNEL_IP = 67108864
IP (Internet Protocol) in IP (Internet Protocol) tunneling packet type.
- TUNNEL_GRE = 134217728
GRE (Generic Routing Encapsulation) tunneling packet type.
- TUNNEL_VXLAN = 268435456
VXLAN (Virtual eXtensible Local Area Network) tunneling packet type.
- TUNNEL_NVGRE = 536870912
NVGRE (Network Virtualization using Generic Routing Encapsulation) tunneling packet type.
- TUNNEL_GENEVE = 1073741824
GENEVE (Generic Network Virtualization Encapsulation) tunneling packet type.
- TUNNEL_GRENAT = 2147483648
Tunneling packet type of Teredo, VXLAN (Virtual eXtensible Local Area Network) or GRE (Generic Routing Encapsulation) could be recognized as this packet type, if they can not be recognized independently as of hardware capability.
- TUNNEL_GTPC = 4294967296
GTP-C (GPRS Tunnelling Protocol) control tunneling packet type.
- TUNNEL_GTPU = 8589934592
GTP-U (GPRS Tunnelling Protocol) user data tunneling packet type.
- TUNNEL_ESP = 17179869184
ESP (IP Encapsulating Security Payload) tunneling packet type.
- TUNNEL_L2TP = 34359738368
L2TP (Layer 2 Tunneling Protocol) tunneling packet type.
- TUNNEL_VXLAN_GPE = 68719476736
VXLAN-GPE (VXLAN Generic Protocol Extension) tunneling packet type.
- TUNNEL_MPLS_IN_UDP = 137438953472
MPLS-in-UDP tunneling packet type (RFC 7510).
- TUNNEL_MPLS_IN_GRE = 274877906944
MPLS-in-GRE tunneling packet type (RFC 4023).
- TUNNEL_UNKNOWN = 549755813888
No tunnel information found on the packet.
- INNER_L2_ETHER = 1099511627776
Ethernet packet type. This is used for inner packet type only.
- INNER_L2_ETHER_VLAN = 2199023255552
Ethernet packet type with VLAN (Virtual Local Area Network) tag.
- INNER_L2_ETHER_QINQ = 4398046511104
QinQ packet type.
- INNER_L2_UNKNOWN = 8796093022208
No inner L2 information found on the packet.
- INNER_L3_IPV4 = 17592186044416
IP (Internet Protocol) version 4 packet type. This is used for inner packet only, and does not contain any header option.
- INNER_L3_IPV4_EXT = 35184372088832
IP (Internet Protocol) version 4 packet type. This is used for inner packet only, and contains header options.
- INNER_L3_IPV6 = 70368744177664
IP (Internet Protocol) version 6 packet type. This is used for inner packet only, and does not contain any extension header.
- INNER_L3_IPV4_EXT_UNKNOWN = 140737488355328
IP (Internet Protocol) version 4 packet type. This is used for inner packet only, and may or may not contain header options.
- INNER_L3_IPV6_EXT = 281474976710656
IP (Internet Protocol) version 6 packet type. This is used for inner packet only, and contains extension headers.
- INNER_L3_IPV6_EXT_UNKNOWN = 562949953421312
IP (Internet Protocol) version 6 packet type. This is used for inner packet only, and may or may not contain extension headers.
- INNER_L3_UNKNOWN = 1125899906842624
No inner L3 information found on the packet.
- INNER_L4_TCP = 2251799813685248
TCP (Transmission Control Protocol) packet type. This is used for inner packet only.
- INNER_L4_UDP = 4503599627370496
UDP (User Datagram Protocol) packet type. This is used for inner packet only.
- INNER_L4_FRAG = 9007199254740992
Fragmented IP (Internet Protocol) packet type. This is used for inner packet only, and may or maynot have a layer 4 packet.
- INNER_L4_SCTP = 18014398509481984
SCTP (Stream Control Transmission Protocol) packet type. This is used for inner packet only.
- INNER_L4_ICMP = 36028797018963968
ICMP (Internet Control Message Protocol) packet type. This is used for inner packet only.
- INNER_L4_NONFRAG = 72057594037927936
Non-fragmented IP (Internet Protocol) packet type. It is used for inner packet only, and may or may not have other unknown layer 4 packet types.
- INNER_L4_UNKNOWN = 144115188075855872
No inner L4 information found on the packet.
- classmethod from_list_string(names: str) typing_extensions.Self
Makes a flag from a whitespace-separated list of names.
- Parameters:
names (str) – a whitespace-separated list containing the members of this flag.
- Returns:
An instance of this flag.
- Return type:
typing_extensions.Self
- classmethod from_str(name: str) typing_extensions.Self
Makes a flag matching the supplied name.
- Parameters:
name (str) – a valid member of this flag in text
- Returns:
An instance of this flag.
- Return type:
typing_extensions.Self
- classmethod make_parser(hw: bool) ParserFn
Makes a parser function.
- Parameters:
hw (bool) – Whether to make a parser for hardware ptypes or software ptypes. If
True, hardware ptypes will be collected, otherwise software pytpes will.- Returns:
- A dictionary for the dataclasses.field metadata argument containing a
parser function that makes an instance of this flag from text.
- Return type:
- class TestPmdVerbosePacket
Bases:
TextParserPacket information provided by verbose output in Testpmd.
This dataclass expects that packet information be prepended with the starting line of packet bursts. Specifically, the line that reads “port X/queue Y: sent/received Z packets”.
- port_id: int
ID of the port that handled the packet.
- queue_id: int
ID of the queue that handled the packet.
- was_received: bool
Whether the packet was received or sent by the queue/port.
- src_mac: str
- dst_mac: str
- pool: str
Memory pool the packet was handled on.
- p_type: int
Packet type in hex.
- length: int
- nb_segs: int
Number of segments in the packet.
- hw_ptype: RtePTypes
Hardware packet type.
- sw_ptype: RtePTypes
Software packet type.
- l2_len: int
- ol_flags: PacketOffloadFlag
- rss_hash: int | None = None
RSS hash of the packet in hex.
- rss_queue: int | None = None
RSS queue that handled the packet in hex.
- l3_len: int | None = None
- l4_len: int | None = None
- l4_dport: int | None = None
- __init__(port_id: int, queue_id: int, was_received: bool, src_mac: str, dst_mac: str, pool: str, p_type: int, length: int, nb_segs: int, hw_ptype: RtePTypes, sw_ptype: RtePTypes, l2_len: int, ol_flags: PacketOffloadFlag, rss_hash: int | None = None, rss_queue: int | None = None, l3_len: int | None = None, l4_len: int | None = None, l4_dport: int | None = None) None
- class RxOffloadCapability
Bases:
FlagRx offload capabilities of a device.
The flags are taken from
lib/ethdev/rte_ethdev.h. They’re prefixed withRTE_ETH_RX_OFFLOADinlib/ethdev/rte_ethdev.hinstead ofRX_OFFLOAD, which is what testpmd changes the prefix to. The values are not contiguous, so the correspondence is preserved by specifying concrete values interspersed between auto() values.The
RX_OFFLOADprefix has been preserved so that the same flag names can be used inNicCapability. The prefix is needed inNicCapabilitysince there’s no other qualifier which would sufficiently distinguish it from other capabilities.References
DPDK lib:
lib/ethdev/rte_ethdev.htestpmd display function:app/test-pmd/cmdline.c:print_rx_offloads()- RX_OFFLOAD_VLAN_STRIP = 1
- RX_OFFLOAD_IPV4_CKSUM = 2
Device supports L3 checksum offload.
- RX_OFFLOAD_UDP_CKSUM = 4
Device supports L4 checksum offload.
- RX_OFFLOAD_TCP_CKSUM = 8
Device supports L4 checksum offload.
- RX_OFFLOAD_TCP_LRO = 16
Device supports Large Receive Offload.
- RX_OFFLOAD_QINQ_STRIP = 32
Device supports QinQ (queue in queue) offload.
- RX_OFFLOAD_OUTER_IPV4_CKSUM = 64
Device supports inner packet L3 checksum.
- RX_OFFLOAD_MACSEC_STRIP = 128
Device supports MACsec.
- RX_OFFLOAD_VLAN_FILTER = 512
Device supports filtering of a VLAN Tag identifier.
- RX_OFFLOAD_VLAN_EXTEND = 1024
Device supports VLAN offload.
- RX_OFFLOAD_SCATTER = 8192
Device supports receiving segmented mbufs.
- RX_OFFLOAD_TIMESTAMP = 16384
Device supports Timestamp.
- RX_OFFLOAD_SECURITY = 32768
Device supports crypto processing while packet is received in NIC.
- RX_OFFLOAD_KEEP_CRC = 65536
Device supports CRC stripping.
- RX_OFFLOAD_SCTP_CKSUM = 131072
Device supports L4 checksum offload.
- RX_OFFLOAD_OUTER_UDP_CKSUM = 262144
Device supports inner packet L4 checksum.
- RX_OFFLOAD_RSS_HASH = 524288
Device supports RSS hashing.
- RX_OFFLOAD_BUFFER_SPLIT = 1048576
Device supports
- RX_OFFLOAD_CHECKSUM = 14
Device supports all checksum capabilities.
- RX_OFFLOAD_VLAN = 1569
Device supports all VLAN capabilities.
- classmethod from_string(line: str) typing_extensions.Self
Make an instance from a string containing the flag names separated with a space.
- Parameters:
line (str) – The line to parse.
- Returns:
A new instance containing all found flags.
- Return type:
typing_extensions.Self
- classmethod make_parser(per_port: bool) ParserFn
Make a parser function.
- Parameters:
per_port (bool) – If
True, will return capabilities per port. IfFalse, will return capabilities per queue.- Returns:
- A dictionary for the dataclasses.field metadata argument containing a
parser function that makes an instance of this flag from text.
- Return type:
- class RxOffloadCapabilities
Bases:
TextParserThe result of testpmd’s
show port <port_id> rx_offload capabilitiescommand.References
testpmd command function:
app/test-pmd/cmdline.c:cmd_rx_offload_get_capa()testpmd display function:app/test-pmd/cmdline.c:cmd_rx_offload_get_capa_parsed()- port_id: int
- per_queue: RxOffloadCapability
Per-queue Rx offload capabilities.
- per_port: RxOffloadCapability
Capabilities other than per-queue Rx offload capabilities.
- __init__(port_id: int, per_queue: RxOffloadCapability, per_port: RxOffloadCapability) None
- class TestPmdPortFlowCtrl
Bases:
TextParserClass representing a port’s flow control parameters.
The parameters can also be parsed from the output of
show port <port_id> flow_ctrl.- rx: bool = False
Enable Reactive Extensions.
- tx: bool = False
Enable Transmit.
- high_water: int = 0
High threshold value to trigger XOFF.
- low_water: int = 0
Low threshold value to trigger XON.
- pause_time: int = 0
Pause quota in the Pause frame.
- send_xon: bool = False
Send XON frame.
- mac_ctrl_frame_fwd: bool = False
Enable receiving MAC control frames.
- autoneg: bool = False
Change the auto-negotiation parameter.
- __init__(rx: bool = False, tx: bool = False, high_water: int = 0, low_water: int = 0, pause_time: int = 0, send_xon: bool = False, mac_ctrl_frame_fwd: bool = False, autoneg: bool = False) None