Setting the MTU size

A RoCE Express PCI function has two separate maximum transmission units (MTUs).

  • MTU for the networking interface.
  • MTU for the InfiniBand interface.
You explicitly set the MTU for the networking interface. Use the ip command for a transient configuration or distribution tools for a persistent configuration. The following example sets the MTU of the networking interface eno10 to 1500 bytes.
# ip link set dev eno10 mtu 1500

You cannot explicitly set the MTU for the InfiniBand interface. This MTU is derived from the MTU of the networking interface. The possible values depend on the adapter version. For example, RoCE Express2 adapters support 1024 bytes, 2048 bytes, and 4096 bytes. Of these possible values, the largest that does not exceed the MTU of the networking interface is used.

For example, for a PCI function of RoCE Express2 and an MTU of 1500 bytes for the networking interface, the MTU for the InfiniBand interface is 1024 bytes.

Use the ibv_devinfo command to display the MTU of the InfiniBand interface as shown in the following example.
# ibv_devinfo  
hca_id: mlx5_0 
       transport:                      InfiniBand (0) 
       ...
       phys_port_cnt:                  1 
               port:   1 
                       state:                  PORT_ACTIVE (4) 
                       max_mtu:                4096 (5) 
                       active_mtu:             1024 (3) 
                       ...
In the command output, the MTU information has the following meaning:
active_mtu
is the MTU that is used for the InfiniBand interface.
max_mtu
is the maximum MTU that is supported by the adapter hardware.

The MTU of the networking interface is not shown in the command output.