The maximum size of a frame that is transmitted without fragmentation can be configured using DPDK API, rte_eth_dev_set_mtu, and fragmentation settings can be adjusted in the flow_api_profile_inline_config.h file.
Maximum transmission unit (MTU)
The rte_eth_dev_set_mtu function configures the maximum transmission unit (MTU) in the SmartNIC. The MTU does not include the preamble/SFD, Ethernet header and CRC. The supported range of values is 512 to 9982 bytes. By default, the MTU is set to 1500 bytes.
General operation
- By default, fragmentation is disabled.
- Fragmentation can be configured per port.
- Fragmentation is only applied to flows offloaded by the SmartNIC.
- Frames to or from the application in the host are not fragmented by the SmartNIC.
- Fragmentation is the last process in the SmartNIC. This means that encapsulation/decapsulation impacts the decision of whether a frame needs fragmentation or not.
Configuring fragmentation
Fragmentation settings can be adjusted in the
flow_api_profile_inline_config.h file. The following shows the
default configuration for IPv4
traffic.
#define PORT_0_IPV4_FRAGMENTATION DISABLE_FRAGMENTATION #define PORT_0_IPV4_DF_ACTION IPV4_DF_DROP #define PORT_1_IPV4_FRAGMENTATION DISABLE_FRAGMENTATION #define PORT_1_IPV4_DF_ACTION IPV4_DF_DROPWhen IPV4_FRAGMENTATION is set to ENABLE, the following actions are taken.
- If a received frame exceeds the MTU, and the Don't Fragment flag (DF) bit is not set, the frame gets fragmented.
- If a received frame exceeds the MTU, the Don't Fragment flag (DF) bit is set, and IPV4_DF_ACTION is set to DF_DROP, the frame is discarded.
- If a received frame exceeds the MTU, the Don't Fragment flag (DF) bit is set, and IPV4_DF_ACTION is set to DF_Forward, the frame is forwarded.
The following shows the default configuration for IPv6
traffic.
When
IPV6_FRAGMENTATION is set to ENABLE, the following
actions are taken.#define PORT_0_IPV6_FRAGMENTATION DISABLE_FRAGMENTATION #define PORT_0_IPV6_ACTION IPV6_DROP #define PORT_1_IPV6_FRAGMENTATION DISABLE_FRAGMENTATION #define PORT_1_IPV6_ACTION IPV6_DROP
- If a received frame exceeds the MTU, and IPV6_ACTION is set to FRAGMENT, the frame gets fragmented.
- If a received frame exceeds the MTU, and IPV6_ACTION is set to DROP, the frame is discarded.
Note: It is not recommended to set the action to DROP, as an ICMP frame
is not sent when a frame is discarded.
The identification field of fragmented frames
The SmartNIC uses the upper half of the ID range for the identification field in the IP
header as follows.
- 16-bit identification field in the IPv4 header: 215 to 216 − 1 (32768 to 65535 in decimal)
- 32-bit identification field in the IPv6 header: 231 to 232 − 1 (2147483648 to 4294967295 in decimal)
Related links
See the DPDK API documentation for further details: