85. Jumbo Frame Tests

The support of jumbo frames by Poll Mode Drivers consists in enabling a port to receive Jumbo Frames with a configurable maximum packet length that is greater than the standard maximum Ethernet frame length (1518 bytes), up to a maximum value imposed by the hardware.

Note

Maximum Packet Length = MTU(Maximum Transmission Unit) + 14(src mac + dst mac) + 4(CRC) e.g., 1518 = 1500 + 14 + 4

85.1. Prerequisites

If using vfio the kernel must be >= 3.6+ and VT-d must be enabled in bios.When using vfio, use the following commands to load the vfio driver and bind it to the device under test:

modprobe vfio
modprobe vfio-pci
usertools/dpdk-devbind.py --bind=vfio-pci device_bus_id

Assuming that ports 0 and 1 of the test target are directly connected to the traffic generator, launch the testpmd application with the following arguments:

./<build_target>/app/dpdk-testpmd -c ffffff -n 6 -- -i --portmask=0x3 --max-pkt-len=9600 \
--tx-offloads=0x00008000

The -n command is used to select the number of memory channels. It should match the number of memory channels on that setup.

Setting tx-offload to 0x8000 and the maximum packet length to 9600 (CRC included) makes input Jumbo Frames to be stored in multiple buffers by the hardware RX engine.

Start packet forwarding in the testpmd application with the start command. Then, make the Traffic Generator transmit to the target’s port 0 packets of lengths (CRC included) 1517, 1518, 9599, and 9600 respectively. Check that the same amount of frames and bytes are received back by the Traffic Generator from its port connected to the target’s port 1.

Then, make the Traffic Generator transmit to the target’s port 0 packets of length (CRC included) 9600 and check that no packet is received by the Traffic Generator from its port connected to the target’s port 1.

85.2. Configuring the Maximum Length of Jumbo Frames

The maximum length of Jumbo Frames is configured with the parameter --max-pkt-len=N that is supplied in the set of parameters when launching the testpmd application.

85.3. Functional Tests of Jumbo Frames

Testing the support of Jumbo Frames in Poll Mode Drivers consists in configuring the maximum packet length with a value greater than 1518, and in sending to the test machine packets with the following lengths (CRC included):

  1. packet length = 1518 - 1
  2. packet length = 1518
  3. packet length = 1518 + 1
  4. packet length = maximum packet length - 1
  5. packet length = maximum packet length
  6. packet length = maximum packet length + 1

The cases 1) and 2) check that packets of standard lengths are still received when enabling the receipt of Jumbo Frames. The cases 3), 4) and 5) check that Jumbo Frames of lengths greater than the standard maximum frame (1518) and lower or equal to the maximum frame length can be received. The case 6) checks that packets larger than the configured maximum packet length are effectively dropped by the hardware.

85.4. Test Case: Normal frames with no jumbo frame support

Send a packet with size 1517 bytes

testpmd> show port stats 0
  ######################## NIC statistics for port 0  ########################
  RX-packets: 0          RX-errors: 0         RX-bytes: 0
  TX-packets: 1          TX-errors: 0         TX-bytes: 1517
  ############################################################################

testpmd> show port stats 1

  ######################## NIC statistics for port 1  ########################
  RX-packets: 1          RX-errors: 0         RX-bytes: 1517
  TX-packets: 0          TX-errors: 0         TX-bytes: 0
  ############################################################################

Verify that TX-bytes on port 0 and RX-bytes on port 1 are 1517

Send a packet with size 1518 bytes

testpmd> show port stats 0

  ######################## NIC statistics for port 0  ########################
  RX-packets: 0          RX-errors: 0         RX-bytes: 0
  TX-packets: 1          TX-errors: 0         TX-bytes: 1518
  ############################################################################

testpmd> show port stats 1

  ######################## NIC statistics for port 1  ########################
  RX-packets: 1          RX-errors: 0         RX-bytes: 1518
  TX-packets: 0          TX-errors: 0         TX-bytes: 0
  ############################################################################

Verify that TX-bytes on port 0 and RX-bytes on port 1 are 1518

85.5. Test Case: Jumbo frames with no jumbo frame support

Send a packet with size 1519 bytes

testpmd> show port stats 0

 ######################## NIC statistics for port 0  ########################
  RX-packets: 0          RX-errors: 0         RX-bytes: 0
  TX-packets: 0          TX-errors: 0         TX-bytes: 0
  ############################################################################

testpmd> show port stats 1

  ######################## NIC statistics for port 1  ########################
  RX-packets: 0          RX-errors: 1         RX-bytes: 0
  TX-packets: 0          TX-errors: 0         TX-bytes: 0
  ############################################################################

Verify that TX-bytes on port 0 and RX-bytes on port 1 are 0

85.6. Test Case: Normal frames with jumbo frame support

Start testpmd with jumbo frame support enabled

./<build_target>/app/dpdk-testpmd -c ffffff -n 3 -- -i --rxd=1024 --txd=1024 \
--burst=144 --txpt=32 --txht=8 --txwt=8 --txfreet=0 --rxfreet=64 \
--mbcache=200 --portmask=0x3 --mbuf-size=2048 --max-pkt-len=9600

Send a packet with size 1517 bytes

testpmd> show port stats 0
  ######################## NIC statistics for port 0  ########################
  RX-packets: 0          RX-errors: 0         RX-bytes: 0
  TX-packets: 1          TX-errors: 0         TX-bytes: 1517
  ############################################################################

testpmd> show port stats 1

  ######################## NIC statistics for port 1  ########################
  RX-packets: 1          RX-errors: 0         RX-bytes: 1517
  TX-packets: 0          TX-errors: 0         TX-bytes: 0
  ############################################################################

Verify that TX-bytes on port 0 and RX-bytes on port 1 are 1517

Send a packet with size 1518 bytes

testpmd> show port stats 0

  ######################## NIC statistics for port 0  ########################
  RX-packets: 0          RX-errors: 0         RX-bytes: 0
  TX-packets: 1          TX-errors: 0         TX-bytes: 1518
  ############################################################################

testpmd> show port stats 1

  ######################## NIC statistics for port 1  ########################
  RX-packets: 1          RX-errors: 0         RX-bytes: 1518
  TX-packets: 0          TX-errors: 0         TX-bytes: 0
  ############################################################################

Verify that TX-bytes on port 0 and RX-bytes on port 1 are 1518

85.7. Test Case: Jumbo frames with jumbo frame support

Send a packet with size 1519 bytes

testpmd> show port stats 0

  ######################## NIC statistics for port 0  ########################
  RX-packets: 0          RX-errors: 0         RX-bytes: 0
  TX-packets: 1          TX-errors: 0         TX-bytes: 1519
  ############################################################################

testpmd> show port stats 1

  ######################## NIC statistics for port 1  ########################
  RX-packets: 1          RX-errors: 0         RX-bytes: 1519
  TX-packets: 0          TX-errors: 0         TX-bytes: 0
  ############################################################################

Verify that TX-bytes on port 0 and RX-bytes on port 1 are 1519

Send a packet with size 9599 bytes

testpmd> show port stats 0

  ######################## NIC statistics for port 0  ########################
  RX-packets: 0          RX-errors: 0         RX-bytes: 0
  TX-packets: 1          TX-errors: 0         TX-bytes: 9599
  ############################################################################

testpmd> show port stats 1

  ######################## NIC statistics for port 1  ########################
  RX-packets: 1          RX-errors: 0         RX-bytes: 9599
  TX-packets: 0          TX-errors: 0         TX-bytes: 0
  ############################################################################

Verify that TX-bytes on port 0 and RX-bytes on port 1 are 9599.

Send a packet with size 9600 bytes

testpmd> show port stats 0

  ######################## NIC statistics for port 0  ########################
  RX-packets: 0          RX-errors: 0         RX-bytes: 0
  TX-packets: 1          TX-errors: 0         TX-bytes: 9600
  ############################################################################

testpmd> show port stats 1

  ######################## NIC statistics for port 1  ########################
  RX-packets: 1          RX-errors: 0         RX-bytes: 9600
  TX-packets: 0          TX-errors: 0         TX-bytes: 0
  ############################################################################

Verify that TX-bytes on port 0 and RX-bytes on port 1 are 9600.

85.8. Test Case: Frames bigger than jumbo frames, with jumbo frame support

Send a packet with size 9601 bytes

testpmd> show port stats 0

  ######################## NIC statistics for port 0  ########################
  RX-packets: 0          RX-errors: 0         RX-bytes: 0
  TX-packets: 0          TX-errors: 0         TX-bytes: 0
  ############################################################################

testpmd> show port stats 1

  ######################## NIC statistics for port 1  ########################
  RX-packets: 0          RX-errors: 1         RX-bytes: 0
  TX-packets: 0          TX-errors: 0         TX-bytes: 0
  ############################################################################

Verify that TX-bytes on port 0 and RX-bytes on port 1 are 0.