On Mon, Aug 12, 2024 at 9:41 AM Dean Marx <dm...@iol.unh.edu> wrote:
>
> test suite for verifying layer 3/4 checksum offload
> features on poll mode driver.
>
> Depends-on: patch-142762
> ("dts: add text parser for testpmd verbose output")
> Depends-on: patch-142691
> ("dts: add send_packets to test suites and rework packet addressing")
>
> Signed-off-by: Dean Marx <dm...@iol.unh.edu>
> ---
>  dts/framework/config/conf_yaml_schema.json    |   3 +-
>  dts/framework/remote_session/testpmd_shell.py |   2 +-
>  dts/tests/TestSuite_checksum_offload.py       | 288 ++++++++++++++++++
>  3 files changed, 291 insertions(+), 2 deletions(-)
>  create mode 100644 dts/tests/TestSuite_checksum_offload.py
>
> diff --git a/dts/framework/config/conf_yaml_schema.json 
> b/dts/framework/config/conf_yaml_schema.json
> index f02a310bb5..a83a6786df 100644
> --- a/dts/framework/config/conf_yaml_schema.json
> +++ b/dts/framework/config/conf_yaml_schema.json
> @@ -187,7 +187,8 @@
>        "enum": [
>          "hello_world",
>          "os_udp",
> -        "pmd_buffer_scatter"
> +        "pmd_buffer_scatter",
> +        "checksum_offload"
>        ]
>      },
>      "test_target": {
> diff --git a/dts/framework/remote_session/testpmd_shell.py 
> b/dts/framework/remote_session/testpmd_shell.py
> index be8fbdc295..01f378acc3 100644
> --- a/dts/framework/remote_session/testpmd_shell.py
> +++ b/dts/framework/remote_session/testpmd_shell.py
> @@ -856,7 +856,7 @@ def csum_set_hw(self, layer: str, port_id: int, verify: 
> bool = True) -> None:
>              InteractiveCommandExecutionError: If checksum offload is not 
> enabled successfully.
>          """
>          csum_output = self.send_command(f"csum set {layer} hw {port_id}")
> -        if (verify and ("Bad arguments" in csum_output or f"Please stop port 
> {port_id} first")):
> +        if (verify and ("Bad arguments" in csum_output or f"Please stop port 
> {port_id} first" in csum_output)):
>              self._logger.debug(f"Failed to set csum hw mode on port 
> {port_id}:\n{csum_output}")
>              raise InteractiveCommandExecutionError(
>                  f"Failed to set csum hw mode on port {port_id}"

It looks like some testpmd changes snuck into the git history for your
test suite, these probably belong in the previous commit.

<snip>
> +
> +    def test_no_insert_checksums(self) -> None:
> +        """Enable checksum offload insertion and verify packet reception."""
> +        packet_list = [
> +            Ether() / IP() / UDP() / Raw("xxxxx"),
> +            Ether() / IP() / TCP() / Raw("xxxxx"),

In cases like this where the payload is used so many times, it
probably makes more sense to pull it out into its own variable.

> +            Ether() / IPv6(src="::1") / UDP() / Raw("xxxxx"),
> +            Ether() / IPv6(src="::1") / TCP() / Raw("xxxxx"),
> +        ]
> +        with TestPmdShell(node=self.sut_node, enable_rx_cksum=True) as 
> testpmd:
> +            testpmd.set_forward_mode(SimpleForwardingModes.csum)
> +            testpmd.set_verbose(level=1)
> +            testpmd.start()
> +            self.send_packet_and_verify(packet_list=packet_list, 
> load="xxxxx", should_receive=True)
> +            for i in range(0, len(packet_list)):
> +                self.send_packet_and_verify_checksum(
> +                    packet=packet_list[i], goodL4=True, goodIP=True, 
> testpmd=testpmd
> +                )
> +
<snip>
> 2.44.0
>

Reply via email to