[PATCH v1 2/2] dts: add mtu update and jumbo frames test suite
Patrick Robb
probb at iol.unh.edu
Mon Jan 20 02:47:32 CET 2025
On Fri, Jan 17, 2025 at 9:58 AM Nicholas Pratte <npratte at iol.unh.edu> wrote:
>
> + def assess_mtu_boundary(self, testpmd_shell: TestPmdShell, mtu: int)
> -> None:
> + """Sets the new MTU and verifies packets at the set boundary.
> +
> + Ensure that packets smaller than or equal to a set MTU will be
> received and packets larger
> + will not.
> +
> + First, start testpmd and update the MTU. Then ensure the new
> value appears
> + on port info for all ports.
> + Next, start packet capturing and send 3 different lengths of
> packet and verify
> + they are handled correctly.
> + # 1. VENDOR_AGNOSTIC_PADDING units smaller than the MTU
> specified.
> + # 2. Equal to the MTU specified.
> + # 3. VENDOR_AGNOSTIC_PADDING units larger than the MTU
> specified (should be fragmented).
> + Finally, stop packet capturing.
> +
> + Args:
> + testpmd_shell: Active testpmd shell of a given test case.
> + mtu: New Maximum Transmission Unit to be tested.
> + """
> + # Send 3 packets of different sizes (accounting for vendor
> inconsistencies).
> + # 1. VENDOR_AGNOSTIC_PADDING units smaller than the MTU specified.
> + # 2. Equal to the MTU specified.
> + # 3. VENDOR_AGNOSTIC_PADDING units larger than the MTU specified.
> + smaller_frame_size: int = mtu - VENDOR_AGNOSTIC_PADDING
> + equal_frame_size: int = mtu
> + larger_frame_size: int = mtu + VENDOR_AGNOSTIC_PADDING
> +
> + self.send_packet_and_verify(pkt_size=smaller_frame_size,
> should_receive=True)
> + self.send_packet_and_verify(pkt_size=equal_frame_size,
> should_receive=True)
> +
> + current_mtu = testpmd_shell.show_port_info(0).mtu
> + self.verify(current_mtu is not None, "Error grabbing testpmd MTU
> value.")
> + if current_mtu and (
> + current_mtu >= STANDARD_MTU + VENDOR_AGNOSTIC_PADDING and mtu
> == STANDARD_MTU
> + ):
> + self.send_packet_and_verify(pkt_size=larger_frame_size,
> should_receive=True)
>
I don't understand when this condition may be true - can you explain?
Thanks!
> + else:
> + self.send_packet_and_verify(pkt_size=larger_frame_size,
> should_receive=False)
> +
> + @func_test
> + def test_runtime_mtu_updating_and_forwarding(self) -> None:
> + """Verify runtime MTU adjustments and assess packet forwarding
> behavior.
> +
> + Test:
> + Start TestPMD in a paired topology.
> + Set port MTU to 1500.
> + Send packets of 1493, 1500 and 1509 bytes.
>
I think 1493 should be 1491.
> --
> 2.47.1
>
>
Thanks, other than a couple questions here and in the associated patch this
looks good. I can merge on Tuesday.
Reviewed-by: Patrick Robb <probb at iol.unh.edu>
Tested-by: Patrick Robb <probb at iol.unh.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20250119/2bc8a128/attachment.htm>
More information about the dev
mailing list