mtu Test Suite
MTU update and jumbo frame forwarding test suite.
A suite of tests to ensures the consistency of jumbo and standard frame transmission within a DPDK application. If a NIC receives a packet that is greater than its assigned MTU length, then that packet should be dropped. Likewise, if a NIC receives a packet that is less than or equal to a designated MTU length, the packet should be accepted.
The definition of MTU between individual vendors varies with a +/- difference of 9 bytes, at most. To universally test MTU functionality, and not concern over individual vendor behavior, this test suite compensates using a 9 byte upper and lower bound when testing a set MTU boundary.
- class TestMtu
Bases:
TestSuiteDPDK PMD jumbo frames and MTU update test suite.
Assess the expected behavior of frames greater than, less then, or equal to a designated MTU size in a DPDK application.
Verify the behavior of both runtime MTU and pre-runtime MTU adjustments within DPDK applications. (Testpmd’s CLI and runtime MTU adjustment options leverage different logical in components within ethdev to set a value).
Test cases will verify that any frame greater than an assigned MTU are dropped and packets less than or equal to a designated MTU are forwarded and fully intact.
- set_up_suite() None
Set up the test suite.
- Setup:
Set traffic generator MTU lengths to a size greater than scope of all test cases.
- runtime_mtu_updating_and_forwarding() None
Verify runtime MTU adjustments and assess packet forwarding behavior.
- Steps:
Start testpmd in a paired topology.
Set port MTU to 1500.
- Send packets of 1491, 1500 and 1509 bytes.
Verify the first two packets are forwarded and the last is dropped.
Set port MTU to 2400.
- Send packets of 1491, 1500 and 1509 bytes.
Verify all three packets are forwarded.
- Send packets of 2391, 2400 and 2409 bytes.
Verify the first two packets are forwarded and the last is dropped.
Set port MTU to 4800.
- Send packets of 1491, 1500 and 1509 bytes.
Verify all three packets are forwarded.
- Send packets of 4791, 4800 and 4809 bytes.
Verify the first two packets are forwarded and the last is dropped.
Set port MTU to 9000.
- Send packets of 1491, 1500 and 1509 bytes.
Verify all three packets are forwarded.
- Send packets of 8991, 9000 and 9009 bytes.
Verify the first two packets are forwarded and the last is dropped.
- Verify:
Successful forwarding of packets via a search for an inserted payload. If the payload is found, the packet was transmitted successfully. Otherwise, the packet is considered dropped.
Standard MTU packets forward, in addition to packets within the limits of an MTU size set during runtime.
- cli_mtu_forwarding_for_std_packets() None
Assesses packet forwarding of standard MTU packets after pre-runtime MTU adjustments.
- Steps:
Start testpmd with MTU size of 1518 bytes, set pre-runtime.
Send packets of size 1491, 1500 and 1509 bytes.
- Verify:
First two packets are forwarded and the last is dropped.
Successful forwarding of packets via a search for an inserted payload. If the payload is found, the packet was transmitted successfully. Otherwise, the packet is considered dropped.
All packets are forwarded and the last is dropped after pre-runtime MTU modification.
- cli_jumbo_forwarding_for_jumbo_mtu() None
Assess packet forwarding of packets within the bounds of a pre-runtime MTU adjustment.
- Steps:
Start testpmd with MTU size of 9018 bytes, set pre-runtime.
Send packets of size 8991, 9000 and 1509 bytes.
- Verify:
Successful forwarding of packets via a search for an inserted payload. If the payload is found, the packet was transmitted successfully. Otherwise, the packet is considered dropped.
All packets are forwarded after pre-runtime MTU modification.
- cli_mtu_std_packets_for_jumbo_mtu() None
Assess boundary of jumbo MTU value set pre-runtime.
- Steps:
Start testpmd with MTU size of 9018 bytes, set pre-runtime.
Send a packets of size 8991, 9000 and 9009 bytes.
- Verify:
First two packets are forwarded and the last is dropped.
Successful forwarding of packets via a search for an inserted payload. If the payload is found, the packet was transmitted successfully. Otherwise, the packet is considered dropped.
Packets are forwarded and the last is dropped after pre-runtime MTU modification.
- tear_down_suite() None
Tear down the test suite.
- Teardown:
Set the MTU size of the traffic generator back to the standard 1518 byte size.
- required_capabilities: ClassVar[set[Capability]] = {28}
The capabilities the test case or suite requires in order to be executed.