From patchwork Wed Jan 3 22:32:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135714 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 99CFB4380D; Wed, 3 Jan 2024 23:33:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 89800406FF; Wed, 3 Jan 2024 23:33:04 +0100 (CET) Received: from mail-oo1-f99.google.com (mail-oo1-f99.google.com [209.85.161.99]) by mails.dpdk.org (Postfix) with ESMTP id 4A0C8406BA for ; Wed, 3 Jan 2024 23:33:03 +0100 (CET) Received: by mail-oo1-f99.google.com with SMTP id 006d021491bc7-5961d380a6aso74096eaf.3 for ; Wed, 03 Jan 2024 14:33:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704321182; x=1704925982; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I0uO7f8F9w/Uz+LWjrj8ZwcRyYvgm+YIkM81Rk7JDWY=; b=NYx1s+Nh7Lc/GmiQMUX7X8PiWnvozR+L/1PXNCwiP0hl30fVfLz0J01DPLWZ92SqPy yP1spz6lflUwRKmq7zWzaqhBc7Za1w6pyzgFyC5Wiu+tqQnVcgmCIhPO9Oh3zikjNphe lxcBvcSrlz3Z1KY6zWf1RY5HA2bmS4pk5ivA8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704321182; x=1704925982; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I0uO7f8F9w/Uz+LWjrj8ZwcRyYvgm+YIkM81Rk7JDWY=; b=IeHsJvVqHthZCZ0R21luU1J/96ZaqintYcd/E8nXpt/lDBXIBjhKskZOT27pj7Il+5 YYM780F7bcv+RgXoWIutj5y2fUXieAoHZ2ERb5hKbjZ+sMlcXScR7X4xk3imusKTbl5b jVHFr3d8oi+PAcNfZF+VcY+/+HIYt2B+Z3w+oVHFAkwiABwq7q9XWsMCMAJXN7AQapqV 6nLKrKyislRS91o487JNmsqoqjXxUqLj8/TLev/M1I3oOSYr5LALVat7V074gNoSCoJV kX+84q40guV/GeUpbh6IytSXODd4Nfy1sgB70TQwvLHdTYqTJaN286COLvsxDpc0n2Pb hSkg== X-Gm-Message-State: AOJu0YxheI48+w4EFFZ2vHGWb4fdfvNaQZmjSqQKnW1Stxo7uz3s8YOZ lQVC3x9qv/tn+cjMJTrFZOQP02Irpb0FKVZ1Wkl38m/9VeiijUb5U4BLyDkydKCf6RI2cU+ahw= = X-Google-Smtp-Source: AGHT+IFmtl9dRYgYez1ZeKDkN7ocLs7MHCHhcKCIwrvldxuoX2p6mTyVKED9JJrMdO7f1H9atR3UW+RAtoqc X-Received: by 2002:a4a:184:0:b0:596:1a68:ccdb with SMTP id 126-20020a4a0184000000b005961a68ccdbmr474326oor.4.1704321182619; Wed, 03 Jan 2024 14:33:02 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id 186-20020a4a03c3000000b0059461c7f00fsm1346647ooi.7.2024.01.03.14.33.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:33:02 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::1083]) by postal.iol.unh.edu (Postfix) with ESMTP id BC53A605C311; Wed, 3 Jan 2024 17:33:01 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, lylavoie@iol.unh.edu, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v6 1/7] dts: add startup verification and forwarding modes to testpmd shell Date: Wed, 3 Jan 2024 17:32:00 -0500 Message-ID: <20240103223206.23129-2-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103223206.23129-1-jspewock@iol.unh.edu> References: <20240103221217.18954-1-jspewock@iol.unh.edu> <20240103223206.23129-1-jspewock@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock Added commonly used methods in testpmd such as starting and stopping packet forwarding, changing forward modes, and verifying link status of ports so that developers can configure testpmd and start forwarding through the provided class rather than sending commands to the testpmd session directly. Signed-off-by: Jeremy Spewock --- dts/framework/exception.py | 7 + dts/framework/remote_session/testpmd_shell.py | 149 +++++++++++++++++- 2 files changed, 155 insertions(+), 1 deletion(-) diff --git a/dts/framework/exception.py b/dts/framework/exception.py index 658eee2c38..cce1e0231a 100644 --- a/dts/framework/exception.py +++ b/dts/framework/exception.py @@ -146,6 +146,13 @@ def __str__(self) -> str: return f"Command {self.command} returned a non-zero exit code: {self._command_return_code}" +class InteractiveCommandExecutionError(DTSError): + """An unsuccessful execution of a remote command in an interactive environment.""" + + #: + severity: ClassVar[ErrorSeverity] = ErrorSeverity.REMOTE_CMD_EXEC_ERR + + class RemoteDirectoryExistsError(DTSError): """A directory that exists on a remote node.""" diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py index 0184cc2e71..f310705fac 100644 --- a/dts/framework/remote_session/testpmd_shell.py +++ b/dts/framework/remote_session/testpmd_shell.py @@ -15,9 +15,15 @@ testpmd_shell.close() """ +import time +from enum import auto from pathlib import PurePath from typing import Callable, ClassVar +from framework.exception import InteractiveCommandExecutionError +from framework.settings import SETTINGS +from framework.utils import StrEnum + from .interactive_shell import InteractiveShell @@ -43,14 +49,51 @@ def __str__(self) -> str: return self.pci_address +class TestPmdForwardingModes(StrEnum): + r"""The supported packet forwarding modes for :class:`~TestPmdShell`\s.""" + + #: + io = auto() + #: + mac = auto() + #: + macswap = auto() + #: + flowgen = auto() + #: + rxonly = auto() + #: + txonly = auto() + #: + csum = auto() + #: + icmpecho = auto() + #: + ieee1588 = auto() + #: + noisy = auto() + #: + fivetswap = "5tswap" + #: + shared_rxq = "shared-rxq" + #: + recycle_mbufs = auto() + + class TestPmdShell(InteractiveShell): """Testpmd interactive shell. The testpmd shell users should never use the :meth:`~.interactive_shell.InteractiveShell.send_command` method directly, but rather call specialized methods. If there isn't one that satisfies a need, it should be added. + + Attributes: + number_of_ports: The number of ports which were allowed on the command-line when testpmd + was started. """ + number_of_ports: int + #: The path to the testpmd executable. path: ClassVar[PurePath] = PurePath("app", "dpdk-testpmd") @@ -65,9 +108,66 @@ class TestPmdShell(InteractiveShell): _command_extra_chars: ClassVar[str] = "\n" def _start_application(self, get_privileged_command: Callable[[str], str] | None) -> None: - self._app_args += " -- -i" + """Overrides :meth:`~.interactive_shell._start_application`. + + Add flags for starting testpmd in interactive mode and disabling messages for link state + change events before starting the application. Link state is verified before starting + packet forwarding and the messages create unexpected newlines in the terminal which + complicates output collection. + + Also find the number of pci addresses which were allowed on the command line when the app + was started. + """ + self._app_args += " -- -i --mask-event intr_lsc" + self.number_of_ports = self._app_args.count("-a ") super()._start_application(get_privileged_command) + def start(self, verify: bool = True) -> None: + """Start packet forwarding with the current configuration. + + Args: + verify: If :data:`True` , a second start command will be sent in an attempt to verify + packet forwarding started as expected. + + Raises: + InteractiveCommandExecutionError: If `verify` is :data:`True` and forwarding fails to + start or ports fail to come up. + """ + self.send_command("start") + if verify: + # If forwarding was already started, sending "start" again should tell us + start_cmd_output = self.send_command("start") + if "Packet forwarding already started" not in start_cmd_output: + self._logger.debug(f"Failed to start packet forwarding: \n{start_cmd_output}") + raise InteractiveCommandExecutionError("Testpmd failed to start packet forwarding.") + + for port_id in range(self.number_of_ports): + if not self.wait_link_status_up(port_id): + raise InteractiveCommandExecutionError( + "Not all ports came up after starting packet forwarding in testpmd." + ) + + def stop(self, verify: bool = True) -> None: + """Stop packet forwarding. + + Args: + verify: If :data:`True` , the output of the stop command is scanned to verify that + forwarding was stopped successfully or not started. If neither is found, it is + considered an error. + + Raises: + InteractiveCommandExecutionError: If `verify` is :data:`True` and the command to stop + forwarding results in an error. + """ + stop_cmd_output = self.send_command("stop") + if verify: + if ( + "Done." not in stop_cmd_output + and "Packet forwarding not started" not in stop_cmd_output + ): + self._logger.debug(f"Failed to stop packet forwarding: \n{stop_cmd_output}") + raise InteractiveCommandExecutionError("Testpmd failed to stop packet forwarding.") + def get_devices(self) -> list[TestPmdDevice]: """Get a list of device names that are known to testpmd. @@ -82,3 +182,50 @@ def get_devices(self) -> list[TestPmdDevice]: if "device name:" in line.lower(): dev_list.append(TestPmdDevice(line)) return dev_list + + def wait_link_status_up(self, port_id: int, timeout=SETTINGS.timeout) -> bool: + """Wait until the link status on the given port is "up". + + Arguments: + port_id: Port to check the link status on. + timeout: Time to wait for the link to come up. The default value for this + argument is set using the :option:`-t, --timeout` command-line argument + or the :envvar:`DTS_TIMEOUT` environment variable. + + Returns: + Whether the link came up in time or not. + """ + time_to_stop = time.time() + timeout + port_info: str = "" + while time.time() < time_to_stop: + port_info = self.send_command(f"show port info {port_id}") + if "Link status: up" in port_info: + break + time.sleep(0.5) + else: + self._logger.error(f"The link for port {port_id} did not come up in the given timeout.") + return "Link status: up" in port_info + + def set_forward_mode(self, mode: TestPmdForwardingModes, verify: bool = True): + """Set packet forwarding mode. + + Args: + mode: The forwarding mode to use. + verify: If :data:`True` the output of the command will be scanned in an attempt to + verify that the forwarding mode was set to `mode` properly. + + Raises: + InteractiveCommandExecutionError: If `verify` is :data:`True` and forwarding mode fails + to update. + """ + set_fwd_output = self.send_command(f"set fwd {mode.value}") + if f"Set {mode.value} packet forwarding mode" not in set_fwd_output: + self._logger.debug(f"Failed to set fwd mode to {mode.value}:\n{set_fwd_output}") + raise InteractiveCommandExecutionError( + f"Test pmd failed to set fwd mode to {mode.value}" + ) + + def close(self) -> None: + """Overrides :meth:`~.interactive_shell.close`.""" + self.send_command("quit", "") + return super().close() From patchwork Wed Jan 3 22:32:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135715 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 201D74380D; Wed, 3 Jan 2024 23:33:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C765D40A6D; Wed, 3 Jan 2024 23:33:07 +0100 (CET) Received: from mail-yw1-f228.google.com (mail-yw1-f228.google.com [209.85.128.228]) by mails.dpdk.org (Postfix) with ESMTP id C59B840A6D for ; Wed, 3 Jan 2024 23:33:05 +0100 (CET) Received: by mail-yw1-f228.google.com with SMTP id 00721157ae682-5e89ba9810aso86904797b3.2 for ; Wed, 03 Jan 2024 14:33:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704321185; x=1704925985; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9sBuSec7fI7Z7rWHY25CViLMRcwyEg4OGA3nWGh5Sdg=; b=bLfH8F75WK3iWp2QOQQ4vUHjZj4hiBMof24S1y26aLKr7WhfB86+y22dTeZgEKLdV6 7oR1FKjyQSCCyNe00WaetvnmE1av2tQt1DslWhrm+86GU3cJujKq9iK04y2t97wyefDf QAA+TypDxnZNqcwIsuj+PkWgspUSJeOo39cFE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704321185; x=1704925985; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9sBuSec7fI7Z7rWHY25CViLMRcwyEg4OGA3nWGh5Sdg=; b=f5lZDss2cZ5XHGIhpbZ1XWqNbbvtUiAg2RsdxrSKEfX6pgUWF3fSn3ixpueVwzQqWH ZNBlylhOeb7myaj6bb0+c1NUy2c0uuSKW2/0qX9rJ5Q3V3P3axEQKlucah8PDYgRsFpE RobZg+VuEFgdr6/YO+/92tpb6F2ca75rFy5/4nzacV+WrdMtLIp7S9ZlLZ2Yg06QPizD QRyHVV02AVmPGrKTvmbqyxNQC8NUPYNTnZuS5ubi4c4LMjiNIrnOH8uEsbe5GHSsqIhi OGvdf4XvbmFpc7FOXMFoSv46OnAO4DFI7BgJ4fLaD4dQSG6wHIX7w8HM8ZB19p+vLxVg 0INg== X-Gm-Message-State: AOJu0YwNDvOTOcHUleoFxKaommWGdEnBVpyRfBoUTQJ+HmMHcCGu6OcC CzR/St+Tmgi1U0R0PWJSOaQ2oLo4OwaPuwzSOC5m4puydspeDDj0OLIHRpqEZ1hqdEoNtGn5mQ= = X-Google-Smtp-Source: AGHT+IHCj56OOlmvBeoZ5sYS5lcGWm+OqG8lguEqZnKea0iNBvho8r0NcZG+P2y9DXCAYEDEZsu0nGZnWNTE X-Received: by 2002:a81:530a:0:b0:5d7:1940:53d2 with SMTP id h10-20020a81530a000000b005d7194053d2mr17034360ywb.74.1704321185194; Wed, 03 Jan 2024 14:33:05 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id w14-20020a0dd40e000000b005e98b0e5396sm2035654ywd.44.2024.01.03.14.33.04 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:33:05 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::1083]) by postal.iol.unh.edu (Postfix) with ESMTP id 78047605C311; Wed, 3 Jan 2024 17:33:04 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, lylavoie@iol.unh.edu, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v6 2/7] dts: limit EAL parameters to DPDK apps and add parameters to all apps Date: Wed, 3 Jan 2024 17:32:01 -0500 Message-ID: <20240103223206.23129-3-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103223206.23129-1-jspewock@iol.unh.edu> References: <20240103221217.18954-1-jspewock@iol.unh.edu> <20240103223206.23129-1-jspewock@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock Changed the factory method for creating interactive apps in the SUT Node so that EAL parameters would only be passed into DPDK apps since non-DPDK apps wouldn't be able to process them. Also modified interactive apps to allow for the ability to pass parameters into the app on startup so that the applications can be started with certain configuration steps passed on the command line. Signed-off-by: Jeremy Spewock --- I ended up reverting part of this back to making the argument for eal_parameters allowed to be a string. This was because it was casuing mypy errors where the method signatures of sut_node did not match with that of node. dts/framework/remote_session/testpmd_shell.py | 2 +- dts/framework/testbed_model/sut_node.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py index f310705fac..8f40e8f40e 100644 --- a/dts/framework/remote_session/testpmd_shell.py +++ b/dts/framework/remote_session/testpmd_shell.py @@ -118,7 +118,7 @@ def _start_application(self, get_privileged_command: Callable[[str], str] | None Also find the number of pci addresses which were allowed on the command line when the app was started. """ - self._app_args += " -- -i --mask-event intr_lsc" + self._app_args += " -i --mask-event intr_lsc" self.number_of_ports = self._app_args.count("-a ") super()._start_application(get_privileged_command) diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py index c4acea38d1..4df18bc183 100644 --- a/dts/framework/testbed_model/sut_node.py +++ b/dts/framework/testbed_model/sut_node.py @@ -431,6 +431,7 @@ def create_interactive_shell( timeout: float = SETTINGS.timeout, privileged: bool = False, eal_parameters: EalParameters | str | None = None, + app_parameters: str = "", ) -> InteractiveShellType: """Extend the factory for interactive session handlers. @@ -449,20 +450,23 @@ def create_interactive_shell( eal_parameters: List of EAL parameters to use to launch the app. If this isn't provided or an empty string is passed, it will default to calling :meth:`create_eal_parameters`. + app_parameters: Additional arguments to pass into the application on the + command-line. Returns: An instance of the desired interactive application shell. """ - if not eal_parameters: - eal_parameters = self.create_eal_parameters() - - # We need to append the build directory for DPDK apps + # We need to append the build directory and add EAL parameters for DPDK apps if shell_cls.dpdk_app: + if not eal_parameters: + eal_parameters = self.create_eal_parameters() + app_parameters = f"{eal_parameters} -- {app_parameters}" + shell_cls.path = self.main_session.join_remote_path( self.remote_dpdk_build_dir, shell_cls.path ) - return super().create_interactive_shell(shell_cls, timeout, privileged, str(eal_parameters)) + return super().create_interactive_shell(shell_cls, timeout, privileged, app_parameters) def bind_ports_to_driver(self, for_dpdk: bool = True) -> None: """Bind all ports on the SUT to a driver. From patchwork Wed Jan 3 22:32:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135716 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 455404380D; Wed, 3 Jan 2024 23:33:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3029E40A73; Wed, 3 Jan 2024 23:33:10 +0100 (CET) Received: from mail-qt1-f227.google.com (mail-qt1-f227.google.com [209.85.160.227]) by mails.dpdk.org (Postfix) with ESMTP id 3CC1140A77 for ; Wed, 3 Jan 2024 23:33:09 +0100 (CET) Received: by mail-qt1-f227.google.com with SMTP id d75a77b69052e-4283cc63c04so2930211cf.1 for ; Wed, 03 Jan 2024 14:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704321188; x=1704925988; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G/fFLowcTHNLQrw5ls8IZ2ibWugX+AoKRyJMocHizh4=; b=H7XvlgNQebH2FyEYhqpxMlaBgyGJoOy0mfEhsaPmwnI8/734uKF9TR+yCUfK4hqb7v RfIwrUt3KS0o/8HVILDaQhLBklEIWN/Y3Q0xlTkiqw265G1ZNeymfs5kEKt8Cis19eBL cxjOM7C6FpXJjCuEeqj6sx8N9NAJ+U0vYUaiw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704321188; x=1704925988; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G/fFLowcTHNLQrw5ls8IZ2ibWugX+AoKRyJMocHizh4=; b=PEEMD5NAcOGHSxMhi3FVgdDeePkMtMluqJrPdHZc9xz57L9jI6WjScZqndxk3OptAf hCcimfM+6NGlWdcWm1yZwpxxWyY5s+q/EyKPjhR8b/3VaGx/Xl3CYLiCTiiqF0omo/9L w7nLIXoXVUNAOSd9q+3UqDWd331IIKOnGdtNaBEfemLXf2gIFs6lyF+UHjLnuaUPjns5 YzrkBeE4ua/+6G4sC88r/BXI9n1Y8N2P/Fidr5hfLVhnNCAcAUNR7gJhjedZ3qR2ZZfV S/8DBV8U01mp/SUXdPIiNrsP3Ucu8SRFkrBcswFpC5t3rk/FFm9Fn1mg579SIA4a/+k5 djwg== X-Gm-Message-State: AOJu0YwfHwPxS9TsfLKMCrOoWq9cguXU9BGF9D5VnW/v8vF0djC8ySR9 OzW8yhziaUGF8FrtQ/UPVZ5QjvAwkl4Syz7VEu1K/4UHWvuQyps4FJgo5jQdF/34kHtJgX3KnA= = X-Google-Smtp-Source: AGHT+IHFJhlrZwLHqmti4jm6a5sJ63R/GpZZHIlHN0p7ImpePcgwF4O5hVOJkMs9ci2WFjVmnzPWYE8DrEWW X-Received: by 2002:a05:622a:2c9:b0:427:8c57:5997 with SMTP id a9-20020a05622a02c900b004278c575997mr32402619qtx.65.1704321188686; Wed, 03 Jan 2024 14:33:08 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id t10-20020a05622a180a00b004283ffb8f80sm8395qtc.2.2024.01.03.14.33.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:33:08 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::1083]) by postal.iol.unh.edu (Postfix) with ESMTP id EAA43605C311; Wed, 3 Jan 2024 17:33:07 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, lylavoie@iol.unh.edu, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v6 3/7] dts: add optional packet filtering to scapy sniffer Date: Wed, 3 Jan 2024 17:32:02 -0500 Message-ID: <20240103223206.23129-4-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103223206.23129-1-jspewock@iol.unh.edu> References: <20240103221217.18954-1-jspewock@iol.unh.edu> <20240103223206.23129-1-jspewock@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock Added the options to filter out LLDP and ARP packets when sniffing for packets with scapy. This was done using BPF filters to ensure that the noise these packets provide does not interfere with test cases. Signed-off-by: Jeremy Spewock --- dts/framework/test_suite.py | 15 +++++++++-- dts/framework/testbed_model/tg_node.py | 14 ++++++++-- .../traffic_generator/__init__.py | 7 ++++- .../capturing_traffic_generator.py | 22 ++++++++++++++- .../testbed_model/traffic_generator/scapy.py | 27 +++++++++++++++++++ 5 files changed, 79 insertions(+), 6 deletions(-) diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py index dfb391ffbd..ffea917690 100644 --- a/dts/framework/test_suite.py +++ b/dts/framework/test_suite.py @@ -38,6 +38,7 @@ from .settings import SETTINGS from .test_result import BuildTargetResult, Result, TestCaseResult, TestSuiteResult from .testbed_model import Port, PortLink, SutNode, TGNode +from .testbed_model.traffic_generator import PacketFilteringConfig from .utils import get_packet_summaries @@ -208,7 +209,12 @@ def configure_testbed_ipv4(self, restore: bool = False) -> None: def _configure_ipv4_forwarding(self, enable: bool) -> None: self.sut_node.configure_ipv4_forwarding(enable) - def send_packet_and_capture(self, packet: Packet, duration: float = 1) -> list[Packet]: + def send_packet_and_capture( + self, + packet: Packet, + filter_config: PacketFilteringConfig = PacketFilteringConfig(), + duration: float = 1, + ) -> list[Packet]: """Send and receive `packet` using the associated TG. Send `packet` through the appropriate interface and receive on the appropriate interface. @@ -216,6 +222,7 @@ def send_packet_and_capture(self, packet: Packet, duration: float = 1) -> list[P Args: packet: The packet to send. + filter_config: The filter to use when capturing packets. duration: Capture traffic for this amount of time after sending `packet`. Returns: @@ -223,7 +230,11 @@ def send_packet_and_capture(self, packet: Packet, duration: float = 1) -> list[P """ packet = self._adjust_addresses(packet) return self.tg_node.send_packet_and_capture( - packet, self._tg_port_egress, self._tg_port_ingress, duration + packet, + self._tg_port_egress, + self._tg_port_ingress, + filter_config, + duration, ) def get_expected_packet(self, packet: Packet) -> Packet: diff --git a/dts/framework/testbed_model/tg_node.py b/dts/framework/testbed_model/tg_node.py index f269d4c585..d3206e87e0 100644 --- a/dts/framework/testbed_model/tg_node.py +++ b/dts/framework/testbed_model/tg_node.py @@ -15,7 +15,11 @@ from .node import Node from .port import Port -from .traffic_generator import CapturingTrafficGenerator, create_traffic_generator +from .traffic_generator import ( + CapturingTrafficGenerator, + PacketFilteringConfig, + create_traffic_generator, +) class TGNode(Node): @@ -53,6 +57,7 @@ def send_packet_and_capture( packet: Packet, send_port: Port, receive_port: Port, + filter_config: PacketFilteringConfig = PacketFilteringConfig(), duration: float = 1, ) -> list[Packet]: """Send `packet`, return received traffic. @@ -65,13 +70,18 @@ def send_packet_and_capture( packet: The packet to send. send_port: The egress port on the TG node. receive_port: The ingress port in the TG node. + filter_config: The filter to use when capturing packets. duration: Capture traffic for this amount of time after sending `packet`. Returns: A list of received packets. May be empty if no packets are captured. """ return self.traffic_generator.send_packet_and_capture( - packet, send_port, receive_port, duration + packet, + send_port, + receive_port, + filter_config, + duration, ) def close(self) -> None: diff --git a/dts/framework/testbed_model/traffic_generator/__init__.py b/dts/framework/testbed_model/traffic_generator/__init__.py index 11e2bd7d97..0eaf0355cd 100644 --- a/dts/framework/testbed_model/traffic_generator/__init__.py +++ b/dts/framework/testbed_model/traffic_generator/__init__.py @@ -14,11 +14,16 @@ and a capturing traffic generator is required. """ +# pylama:ignore=W0611 + from framework.config import ScapyTrafficGeneratorConfig, TrafficGeneratorType from framework.exception import ConfigurationError from framework.testbed_model.node import Node -from .capturing_traffic_generator import CapturingTrafficGenerator +from .capturing_traffic_generator import ( + CapturingTrafficGenerator, + PacketFilteringConfig, +) from .scapy import ScapyTrafficGenerator diff --git a/dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py b/dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py index 0246590333..c1c9facedd 100644 --- a/dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py +++ b/dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py @@ -11,6 +11,7 @@ import uuid from abc import abstractmethod +from dataclasses import dataclass import scapy.utils # type: ignore[import] from scapy.packet import Packet # type: ignore[import] @@ -26,6 +27,19 @@ def _get_default_capture_name() -> str: return str(uuid.uuid4()) +@dataclass(slots=True) +class PacketFilteringConfig: + """The supported filtering options for :class:`CapturingTrafficGenerator`. + + Attributes: + no_lldp: If :data:`True`, LLDP packets will be filtered out when capturing. + no_arp: If :data:`True`, ARP packets will be filtered out when capturing. + """ + + no_lldp: bool = True + no_arp: bool = True + + class CapturingTrafficGenerator(TrafficGenerator): """Capture packets after sending traffic. @@ -54,6 +68,7 @@ def send_packet_and_capture( packet: Packet, send_port: Port, receive_port: Port, + filter_config: PacketFilteringConfig, duration: float, capture_name: str = _get_default_capture_name(), ) -> list[Packet]: @@ -68,6 +83,7 @@ def send_packet_and_capture( packet: The packet to send. send_port: The egress port on the TG node. receive_port: The ingress port in the TG node. + filter_config: Filters to apply when capturing packets. duration: Capture traffic for this amount of time after sending the packet. capture_name: The name of the .pcap file where to store the capture. @@ -75,7 +91,7 @@ def send_packet_and_capture( The received packets. May be empty if no packets are captured. """ return self.send_packets_and_capture( - [packet], send_port, receive_port, duration, capture_name + [packet], send_port, receive_port, filter_config, duration, capture_name ) def send_packets_and_capture( @@ -83,6 +99,7 @@ def send_packets_and_capture( packets: list[Packet], send_port: Port, receive_port: Port, + filter_config: PacketFilteringConfig, duration: float, capture_name: str = _get_default_capture_name(), ) -> list[Packet]: @@ -99,6 +116,7 @@ def send_packets_and_capture( packets: The packets to send. send_port: The egress port on the TG node. receive_port: The ingress port in the TG node. + filter_config: Filters to apply when capturing packets. duration: Capture traffic for this amount of time after sending the packets. capture_name: The name of the .pcap file where to store the capture. @@ -113,6 +131,7 @@ def send_packets_and_capture( packets, send_port, receive_port, + filter_config, duration, ) @@ -126,6 +145,7 @@ def _send_packets_and_capture( packets: list[Packet], send_port: Port, receive_port: Port, + filter_config: PacketFilteringConfig, duration: float, ) -> list[Packet]: """The implementation of :method:`send_packets_and_capture`. diff --git a/dts/framework/testbed_model/traffic_generator/scapy.py b/dts/framework/testbed_model/traffic_generator/scapy.py index 5b60f66237..505de0be94 100644 --- a/dts/framework/testbed_model/traffic_generator/scapy.py +++ b/dts/framework/testbed_model/traffic_generator/scapy.py @@ -32,6 +32,7 @@ from .capturing_traffic_generator import ( CapturingTrafficGenerator, + PacketFilteringConfig, _get_default_capture_name, ) @@ -69,6 +70,7 @@ def scapy_send_packets_and_capture( send_iface: str, recv_iface: str, duration: float, + sniff_filter: str, ) -> list[bytes]: """The RPC function to send and capture packets. @@ -90,6 +92,7 @@ def scapy_send_packets_and_capture( iface=recv_iface, store=True, started_callback=lambda *args: scapy.all.sendp(scapy_packets, iface=send_iface), + filter=sniff_filter, ) sniffer.start() time.sleep(duration) @@ -260,11 +263,34 @@ def _send_packets(self, packets: list[Packet], port: Port) -> None: packets = [packet.build() for packet in packets] self.rpc_server_proxy.scapy_send_packets(packets, port.logical_name) + def _create_packet_filter(self, filter_config: PacketFilteringConfig) -> str: + """Combines filter settings from `filter_config` into a BPF that scapy can use. + + Scapy allows for the use of Berkeley Packet Filters (BPFs) to filter what packets are + collected based on various attributes of the packet. + + Args: + filter_config: Config class that specifies which filters should be applied. + + Returns: + A string representing the combination of BPF filters to be passed to scapy. For + example: + + "ether[12:2] != 0x88cc && ether[12:2] != 0x0806" + """ + bpf_filter: list[str] = [] + if filter_config.no_arp: + bpf_filter.append("ether[12:2] != 0x0806") + if filter_config.no_lldp: + bpf_filter.append("ether[12:2] != 0x88cc") + return " && ".join(bpf_filter) + def _send_packets_and_capture( self, packets: list[Packet], send_port: Port, receive_port: Port, + filter_config: PacketFilteringConfig, duration: float, capture_name: str = _get_default_capture_name(), ) -> list[Packet]: @@ -277,6 +303,7 @@ def _send_packets_and_capture( send_port.logical_name, receive_port.logical_name, duration, + self._create_packet_filter(filter_config), ) # type: ignore[assignment] scapy_packets = [Ether(packet.data) for packet in xmlrpc_packets] From patchwork Wed Jan 3 22:32:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135717 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B25594380D; Wed, 3 Jan 2024 23:33:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DEAA640A87; Wed, 3 Jan 2024 23:33:11 +0100 (CET) Received: from mail-oa1-f97.google.com (mail-oa1-f97.google.com [209.85.160.97]) by mails.dpdk.org (Postfix) with ESMTP id 46D6840A79 for ; Wed, 3 Jan 2024 23:33:10 +0100 (CET) Received: by mail-oa1-f97.google.com with SMTP id 586e51a60fabf-204520717b3so6828654fac.0 for ; Wed, 03 Jan 2024 14:33:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704321189; x=1704925989; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9O25ducMATwG+pavw82jWa5njc2pAl93LdrUmF2Ic6s=; b=VQHv9CuqazYdAzK+9tN0GkShK3U49KpRCjEtAxbqeU65d5rWIrmVMGoBmcQHFQYpYS vJp6uKc50nqWZ8SwgSk3sV9AKivAF+YIPmg+Zt51HRLHyWrRhq1qY6NZ/Lzjm3tUgy3M egLuszdZqJB7lh/1JNOYI+GkGx74FYfL24cxE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704321189; x=1704925989; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9O25ducMATwG+pavw82jWa5njc2pAl93LdrUmF2Ic6s=; b=bt37eMnH5B4/lCnVEE/GP3i8XAZsfLXV31wR6Y8Ee1beqhJ+/KaHcvDbWeaj6l/s7+ QR5AQosqLtRUUHK1x4VtiYr80WcSjS0ttfEEvz4eMTlMxw1Z2IxNosrPDkSq6HLbTtpm hGp21h7+AMgoM6OwnZe1Y+VtxJrjkUVWreC03G2mUD7sKpGMBSjSFCZLgNTExBlAYdxb Zy6WDgL4byvsOtedIBLO/gacXe0VzF5OZO525EH/Vs5T9R0DNb+cBosry9JiK/orwW1I GtdGjWjJtbnKQigrfxV0azFEwVSYQziD6okX5eZafXZsT/vwhCZVzTs5NkMcLmP39fBz G6KA== X-Gm-Message-State: AOJu0Yw2eDXbZsRBMYpDX/ZNVQ9aHsC7eWXfFnhgNZO4OQsPPut7xlNM 41hjF64q0/uE7tqo052IqGFKQGlXNBh+fzbd7rs/wnzq9DoVOQsxE4BaiQ== X-Google-Smtp-Source: AGHT+IHU0p+3o8WWgdTl+oCvCb5/rPc2/r9SHpSrKvoSGR/Dw0nVL3mLdFpvMCcgZ8zPpvToJJ5p/n7ccJ7H X-Received: by 2002:a05:6870:e38b:b0:204:d10:6c7 with SMTP id x11-20020a056870e38b00b002040d1006c7mr22146918oad.82.1704321189710; Wed, 03 Jan 2024 14:33:09 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id 23-20020a056870135700b002040c3b9a59sm984658oac.43.2024.01.03.14.33.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:33:09 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::1083]) by postal.iol.unh.edu (Postfix) with ESMTP id DDBA4605C311; Wed, 3 Jan 2024 17:33:08 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, lylavoie@iol.unh.edu, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v6 4/7] dts: add pci addresses to EAL parameters Date: Wed, 3 Jan 2024 17:32:03 -0500 Message-ID: <20240103223206.23129-5-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103223206.23129-1-jspewock@iol.unh.edu> References: <20240103221217.18954-1-jspewock@iol.unh.edu> <20240103223206.23129-1-jspewock@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock Added allow list to the EAL parameters created in DTS to ensure that only the relevant PCI devices are considered when launching DPDK applications. Signed-off-by: Jeremy Spewock Reviewed-by: Juraj Linkeš --- dts/framework/testbed_model/sut_node.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py index 4df18bc183..cc894fb07d 100644 --- a/dts/framework/testbed_model/sut_node.py +++ b/dts/framework/testbed_model/sut_node.py @@ -30,6 +30,7 @@ from .cpu import LogicalCoreCount, LogicalCoreList from .node import Node from .os_session import InteractiveShellType, OSSession +from .port import Port from .virtual_device import VirtualDevice @@ -46,6 +47,7 @@ def __init__( prefix: str, no_pci: bool, vdevs: list[VirtualDevice], + ports: list[Port], other_eal_param: str, ): """Initialize the parameters according to inputs. @@ -63,6 +65,7 @@ def __init__( VirtualDevice('net_ring0'), VirtualDevice('net_ring1') ] + ports: The list of ports to allow. other_eal_param: user defined DPDK EAL parameters, e.g.: ``other_eal_param='--single-file-segments'`` """ @@ -73,6 +76,7 @@ def __init__( self._prefix = f"--file-prefix={prefix}" self._no_pci = "--no-pci" if no_pci else "" self._vdevs = " ".join(f"--vdev {vdev}" for vdev in vdevs) + self._ports = " ".join(f"-a {port.pci}" for port in ports) self._other_eal_param = other_eal_param def __str__(self) -> str: @@ -83,6 +87,7 @@ def __str__(self) -> str: f"{self._prefix} " f"{self._no_pci} " f"{self._vdevs} " + f"{self._ports} " f"{self._other_eal_param}" ) @@ -347,6 +352,7 @@ def create_eal_parameters( append_prefix_timestamp: bool = True, no_pci: bool = False, vdevs: list[VirtualDevice] | None = None, + ports: list[Port] | None = None, other_eal_param: str = "", ) -> "EalParameters": """Compose the EAL parameters. @@ -370,6 +376,8 @@ def create_eal_parameters( VirtualDevice('net_ring0'), VirtualDevice('net_ring1') ] + ports: The list of ports to allow. If :data:`None`, all ports listed in `self.ports` + will be allowed. other_eal_param: user defined DPDK EAL parameters, e.g.: ``other_eal_param='--single-file-segments'``. @@ -388,12 +396,16 @@ def create_eal_parameters( if vdevs is None: vdevs = [] + if ports is None: + ports = self.ports + return EalParameters( lcore_list=lcore_list, memory_channels=self.config.memory_channels, prefix=prefix, no_pci=no_pci, vdevs=vdevs, + ports=ports, other_eal_param=other_eal_param, ) From patchwork Wed Jan 3 22:32:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135718 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B05874380D; Wed, 3 Jan 2024 23:33:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 287E440A7A; Wed, 3 Jan 2024 23:33:13 +0100 (CET) Received: from mail-yw1-f227.google.com (mail-yw1-f227.google.com [209.85.128.227]) by mails.dpdk.org (Postfix) with ESMTP id 9A30240A87 for ; Wed, 3 Jan 2024 23:33:11 +0100 (CET) Received: by mail-yw1-f227.google.com with SMTP id 00721157ae682-5efb0e180f0so46485257b3.1 for ; Wed, 03 Jan 2024 14:33:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704321191; x=1704925991; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gD7HfQGkMqy/apKHbVy34aDAnQ+oEBq1bvsBtNcmKeE=; b=EgA7Ft5cDlv4m/BTXH67LqDrFliUqUMsrmMrWfA2IKTE8BPsPx8B04l7rGmEbQ4xU3 4HW9Hhm4kmXLer34/0ACSAPqQkGfOqxh1Hl/7G6g8A1E2+cRNZ1mA1o0JzjqFOeKNigF EAeeS1XDv/NkY9GQbZnfsRNyu0PNBfTKKRr2g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704321191; x=1704925991; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gD7HfQGkMqy/apKHbVy34aDAnQ+oEBq1bvsBtNcmKeE=; b=Fc+aQpQPuaAJI6br0qzTzyVzeSaQP8dtCk5/2wWTsY20m1p68/pVB4/PWWDkDx8/DF c7qCoqrsioiyV6llH/3FYWCUlGMSS9AY8Fem8moKgHEExrKEW7qEGt5lQZNPP1g+5Um/ UYUa1BdfquXwPJinNjla3rOhJtWbmW25bejNUxSiyaTNVWoTiddDHI+fnk3zXK+0Zj/9 PQEZC+tqWgYoipr2ARiuhUdy+Nzkf7iiXW+yic3XZnjloBNw8YQ2WDcF6Z536BxR5C8O iBFEKWgvYtjo8g1lEePJIZQg9ocUmnZSSFIRD+BjVg0Isw6OvSz4lSdB/MJ6kP2bsq1R FfUw== X-Gm-Message-State: AOJu0Yy7biLz4pQvKZ6X6L3wmyXTjDQdVNPEkC1eM2iBZJ3ZnwPmFSS1 Iz2KBx9fj+dTGzxGxrAK5qnwWYs1GXlf9qKcaYzvuJ//rxUIiSt8Au99qARzHx2hjRenwZ1Uyg= = X-Google-Smtp-Source: AGHT+IF/PqtL771GGXIKKmoiLpg+VKoSVTLFKtPulV+ua8vBkR92OZ1Y5EZnC/7MliJXx8lpN7wxNCvK+9vi X-Received: by 2002:a0d:da07:0:b0:5e9:76a3:d6bc with SMTP id c7-20020a0dda07000000b005e976a3d6bcmr16904117ywe.69.1704321191059; Wed, 03 Jan 2024 14:33:11 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id fk9-20020a05690c334900b00595853f9832sm1374672ywb.45.2024.01.03.14.33.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:33:11 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::1083]) by postal.iol.unh.edu (Postfix) with ESMTP id 5A019605C311; Wed, 3 Jan 2024 17:33:10 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, lylavoie@iol.unh.edu, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v6 5/7] dts: allow configuring MTU of ports Date: Wed, 3 Jan 2024 17:32:04 -0500 Message-ID: <20240103223206.23129-6-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103223206.23129-1-jspewock@iol.unh.edu> References: <20240103221217.18954-1-jspewock@iol.unh.edu> <20240103223206.23129-1-jspewock@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock Adds methods in both os_session and linux session to allow for setting MTU of port interfaces so that suites that require the sending and receiving of packets of a specific size, or the rejection of packets over a certain size, can configure this maximum as needed. Signed-off-by: Jeremy Spewock Reviewed-by: Juraj Linkeš --- dts/framework/testbed_model/linux_session.py | 8 ++++++++ dts/framework/testbed_model/os_session.py | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py index 0ab59cef85..5d24030c3d 100644 --- a/dts/framework/testbed_model/linux_session.py +++ b/dts/framework/testbed_model/linux_session.py @@ -198,6 +198,14 @@ def configure_port_ip_address( verify=True, ) + def configure_port_mtu(self, mtu: int, port: Port) -> None: + """Overrides :meth:`~.os_session.OSSession.configure_port_mtu`.""" + self.send_command( + f"ip link set dev {port.logical_name} mtu {mtu}", + privileged=True, + verify=True, + ) + def configure_ipv4_forwarding(self, enable: bool) -> None: """Overrides :meth:`~.os_session.OSSession.configure_ipv4_forwarding`.""" state = 1 if enable else 0 diff --git a/dts/framework/testbed_model/os_session.py b/dts/framework/testbed_model/os_session.py index ac6bb5e112..e42f4d752a 100644 --- a/dts/framework/testbed_model/os_session.py +++ b/dts/framework/testbed_model/os_session.py @@ -413,6 +413,15 @@ def configure_port_ip_address( delete: If :data:`True`, remove the IP address, otherwise configure it. """ + @abstractmethod + def configure_port_mtu(self, mtu: int, port: Port) -> None: + """Configure `mtu` on `port`. + + Args: + mtu: Desired MTU value. + port: Port to set `mtu` on. + """ + @abstractmethod def configure_ipv4_forwarding(self, enable: bool) -> None: """Enable IPv4 forwarding in the operating system. From patchwork Wed Jan 3 22:32:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135719 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 546124380D; Wed, 3 Jan 2024 23:33:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6116040A7F; Wed, 3 Jan 2024 23:33:14 +0100 (CET) Received: from mail-ot1-f99.google.com (mail-ot1-f99.google.com [209.85.210.99]) by mails.dpdk.org (Postfix) with ESMTP id D864240A7A for ; Wed, 3 Jan 2024 23:33:12 +0100 (CET) Received: by mail-ot1-f99.google.com with SMTP id 46e09a7af769-6dc02727c62so4059505a34.1 for ; Wed, 03 Jan 2024 14:33:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704321192; x=1704925992; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mUwABtraKUQVk1+KNd+OixqPQgpIFoZLK6tAOpcjy5Y=; b=jiVCVPdwR+gp978BtfdMU1MCQ+BroYv3jByTj8oJfR+Km3H5JGHe91pgXwLkcRsE7W dmNVGlyMGCHmd9jJ9SQJzeHrHLYduLYBwBHXKIQ4TgkZ0z2QGMe45tzj/9DmBV/JmL7V dJPlrTOG5XSsedoPXKWEQ8CPUK22buJTyUolM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704321192; x=1704925992; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mUwABtraKUQVk1+KNd+OixqPQgpIFoZLK6tAOpcjy5Y=; b=S7zNM3VturflW4gc5z+TTmp3G0dG1KX7PMT2BgMJ9srAOPiFZHdLckUjPCE73gNU/g qys8bLUz4ZK25+uy/f3Agfe+czjhBqrlCbIk6UN5yAUvD957EgL8NrXQaiA9XcQlNLIS hTm91b0FIG4jvtgotomJrB99TqTq0wQXqIiZcSYgwZa8DOIevav3ca3yhglY5ESqbLOB N+9AxUrrUD/eiayYR8LMb/VWrGJZMc6SR7SaE0q73bbmqp/Ikbt4RC0zVYDjaOnnvvm6 k6SNYzMUXC9/4O3tqLmfO6TVDpyfMo1rLpEpbz1KX9RixLTQoMkLILmvwoD31cDYZeha ZM0w== X-Gm-Message-State: AOJu0YzVd6GRwHu/sge0CSizavRaiChiWcP3W91Eu7vMwMCSOXc0xqz0 oJPRkminOSCwH6SKxJIX0CRzmMlvkrpoRVzr6LG+c66ambgnzpB0Q6XWiL6fD/lpniy0EC8sDA= = X-Google-Smtp-Source: AGHT+IFtBvQovgNBDry2ELIZksjuVzuWAH757kNV9oO3chEWEMHkt/Z9WzW3/825CR1ZCtkIXpTiYGji+2Vd X-Received: by 2002:a05:6870:414a:b0:1fb:75b:2fa7 with SMTP id r10-20020a056870414a00b001fb075b2fa7mr25009100oad.62.1704321192290; Wed, 03 Jan 2024 14:33:12 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id zj42-20020a0568716caa00b001faeb3eb810sm934556oab.46.2024.01.03.14.33.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:33:12 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::1083]) by postal.iol.unh.edu (Postfix) with ESMTP id 509DB605C311; Wed, 3 Jan 2024 17:33:11 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, lylavoie@iol.unh.edu, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v6 6/7] dts: add scatter to the yaml schema Date: Wed, 3 Jan 2024 17:32:05 -0500 Message-ID: <20240103223206.23129-7-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103223206.23129-1-jspewock@iol.unh.edu> References: <20240103221217.18954-1-jspewock@iol.unh.edu> <20240103223206.23129-1-jspewock@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock Allow for scatter to be specified in the configuration file. Signed-off-by: Jeremy Spewock Reviewed-by: Juraj Linkeš --- dts/framework/config/conf_yaml_schema.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dts/framework/config/conf_yaml_schema.json b/dts/framework/config/conf_yaml_schema.json index 84e45fe3c2..e6dc50ca7f 100644 --- a/dts/framework/config/conf_yaml_schema.json +++ b/dts/framework/config/conf_yaml_schema.json @@ -186,7 +186,8 @@ "type": "string", "enum": [ "hello_world", - "os_udp" + "os_udp", + "pmd_buffer_scatter" ] }, "test_target": { From patchwork Wed Jan 3 22:32:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135720 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8F6D54380D; Wed, 3 Jan 2024 23:33:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96A6C40DDE; Wed, 3 Jan 2024 23:33:16 +0100 (CET) Received: from mail-yw1-f226.google.com (mail-yw1-f226.google.com [209.85.128.226]) by mails.dpdk.org (Postfix) with ESMTP id 6B08540DDC for ; Wed, 3 Jan 2024 23:33:14 +0100 (CET) Received: by mail-yw1-f226.google.com with SMTP id 00721157ae682-5f254d1a6daso25994677b3.2 for ; Wed, 03 Jan 2024 14:33:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704321194; x=1704925994; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Q5hIIqy0MYvz31xGZ5AlKUZs/DM14pxsBt7Gqcmbhto=; b=T6VP/jkVebd8IWOM+eC6jlI3i/Ar3H9iRoUzBXy4Z9T/qfnwsYWj46e2Yb075OKwbJ DdZXvgZBUajW9Ciuky6Jb6eQOQ16py/ugg4u1fOVg3CHn9xMEbLhC/eh+VrBADzsfaWk efxH6FdfEg2RwJUtKakqsooIKqvrm2ZuXOQUM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704321194; x=1704925994; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q5hIIqy0MYvz31xGZ5AlKUZs/DM14pxsBt7Gqcmbhto=; b=w3nIeBuXwR4DYWzLhSwW7qLH7Fs13dOlQnu9H1RBLmXYwx0dtsgmopVG1Hi4riN78I QBdIo3QE9wnwVX7jEzlgVDBBzsYcE/rFYBzOtcJK4F2frV21TCxUPd6m/ij+mfdItJWX OJ4BrTuX7qp2CFOx9w3oxShYCaOO6YLI4q4RD8PWn8+J5YPrHZPorsEc1Jbj1elJcv4V LyDyrV+I79r7ROjIWfCLVm5BTGNU7afrI/E7FtM3qSV7awAyee1ci+9akDCvh07QHqpe WGTic17mugBi8fLHYqhozuaNEvXPQe6cyAI9lArQs4/a4sxxnk2Kf18vkgGt7fzE74PE +RpA== X-Gm-Message-State: AOJu0Yw+v5lQmmkkMRnxEGA4N/NRMXA3H0cb8xJhlg9pvVOc9Ntr/L5z CSNKwRvYbVL3+vel1wSO6Lj9drMv/N5Jxn7ys/D3swB3v/o9TVPupHyKc9rr4Fvjn9pXNPjyAw= = X-Google-Smtp-Source: AGHT+IEcgzraKPvDWA3+iYRgLCzFEoAnWUjGQwArm+oooQnV55mpBtZsEO1DS6LCuBhTzzS+T5CduZRvG6Ef X-Received: by 2002:a0d:e68f:0:b0:5e8:d8e6:2f2f with SMTP id p137-20020a0de68f000000b005e8d8e62f2fmr11053623ywe.93.1704321193874; Wed, 03 Jan 2024 14:33:13 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id g73-20020a0ddd4c000000b005efeb95b03bsm754465ywe.37.2024.01.03.14.33.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:33:13 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::1083]) by postal.iol.unh.edu (Postfix) with ESMTP id 255C9605C311; Wed, 3 Jan 2024 17:33:13 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, lylavoie@iol.unh.edu, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v6 7/7] dts: add pmd_buffer_scatter test suite Date: Wed, 3 Jan 2024 17:32:06 -0500 Message-ID: <20240103223206.23129-8-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103223206.23129-1-jspewock@iol.unh.edu> References: <20240103221217.18954-1-jspewock@iol.unh.edu> <20240103223206.23129-1-jspewock@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock This test suite provides testing of the support of scattered packets by Poll Mode Drivers using testpmd, verifying the ability to receive and transmit scattered multi-segment packets made up of multiple non-contiguous memory buffers. This is tested through 5 different cases in which the length of the packets sent are less than the mbuf size, equal to the mbuf size, and 1, 4, and 5 bytes greater than the mbuf size in order to show both the CRC and the packet data are capable of existing in the first, second, or both buffers. Naturally, if the PMD is capable of forwarding scattered packets which it receives as input, this shows it is capable of both receiving and transmitting scattered packets. Signed-off-by: Jeremy Spewock --- dts/tests/TestSuite_pmd_buffer_scatter.py | 126 ++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 dts/tests/TestSuite_pmd_buffer_scatter.py diff --git a/dts/tests/TestSuite_pmd_buffer_scatter.py b/dts/tests/TestSuite_pmd_buffer_scatter.py new file mode 100644 index 0000000000..8838c3404f --- /dev/null +++ b/dts/tests/TestSuite_pmd_buffer_scatter.py @@ -0,0 +1,126 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2023-2024 University of New Hampshire + +"""Multi-segment packet scattering testing suite. + +This testing suite tests the support of transmitting and receiving scattered packets. This is shown +by the Poll Mode Driver being able to forward scattered multi-segment packets composed of multiple +non-contiguous memory buffers. To ensure the receipt of scattered packets, the DMA rings of the +port's RX queues must be configured with mbuf data buffers whose size is less than the maximum +length. + +If it is the case that the Poll Mode Driver can forward scattered packets which it receives, then +this suffices to show the Poll Mode Driver is capable of both receiving and transmitting scattered +packets. +""" +import struct + +from scapy.layers.inet import IP # type: ignore[import] +from scapy.layers.l2 import Ether # type: ignore[import] +from scapy.packet import Raw # type: ignore[import] +from scapy.utils import hexstr # type: ignore[import] + +from framework.remote_session.testpmd_shell import TestPmdForwardingModes, TestPmdShell +from framework.test_suite import TestSuite + + +class PmdBufferScatter(TestSuite): + """DPDK PMD packet scattering test suite. + + Configure the Rx queues to have mbuf data buffers whose sizes are smaller than the maximum + packet size. Specifically, set mbuf data buffers to have a size of 2048 to fit a full 1512-byte + (CRC included) ethernet frame in a mono-segment packet. The testing of scattered packets is + done by sending a packet whose length is greater than the size of the configured size of mbuf + data buffers. There are a total of 5 packets sent within test cases which have lengths less + than, equal to, and greater than the mbuf size. There are multiple packets sent with lengths + greater than the mbuf size in order to test cases such as: + + 1. A single byte of the CRC being in a second buffer while the remaining 3 bytes are stored in + the first buffer alongside packet data. + 2. The entire CRC being stored in a second buffer while all of the packet data is stored in the + first. + 3. Most of the packet data being stored in the first buffer and a single byte of packet data + stored in a second buffer alongside the CRC. + """ + + def set_up_suite(self) -> None: + """Set up the test suite. + + Setup: + Verify they we have at least 2 port links in the current execution and increase the MTU + of both ports on the tg_node to 9000 to support larger packet sizes. + """ + self.verify( + len(self._port_links) > 1, + "Must have at least two port links to run scatter", + ) + + self.tg_node.main_session.configure_port_mtu(9000, self._tg_port_egress) + self.tg_node.main_session.configure_port_mtu(9000, self._tg_port_ingress) + + def scatter_pktgen_send_packet(self, pktsize: int) -> str: + """Generate and send packet to the SUT. + + Functional test for scatter packets. + + Args: + pktsize: Size of the packet to generate and send. + """ + packet = Ether() / IP() / Raw() + packet.getlayer(2).load = "" + payload_len = pktsize - len(packet) - 4 + payload = ["58"] * payload_len + # pack the payload + for X_in_hex in payload: + packet.load += struct.pack("=B", int("%s%s" % (X_in_hex[0], X_in_hex[1]), 16)) + received_packets = self.send_packet_and_capture(packet) + self.verify(len(received_packets) > 0, "Did not receive any packets.") + load = hexstr(received_packets[0].getlayer(2), onlyhex=1) + + return load + + def pmd_scatter(self, mbsize: int) -> None: + """Testpmd support of receiving and sending scattered multi-segment packets. + + Support for scattered packets is shown by sending 5 packets of differing length + where the length of the packet is calculated by taking mbuf-size + an offset. The + offsets used in the test case are -1, 0, 1, 4, 5 respectively. + + Test: + Start testpmd and run functional test with preset mbsize. + """ + testpmd = self.sut_node.create_interactive_shell( + TestPmdShell, + app_parameters=( + "--mbcache=200 " + f"--mbuf-size={mbsize} " + "--max-pkt-len=9000 " + "--port-topology=paired " + "--tx-offloads=0x00008000" + ), + privileged=True, + ) + testpmd.set_forward_mode(TestPmdForwardingModes.mac) + testpmd.start() + + for offset in [-1, 0, 1, 4, 5]: + recv_payload = self.scatter_pktgen_send_packet(mbsize + offset) + self._logger.debug(f"Payload of scattered packet after forwarding: \n{recv_payload}") + self.verify( + ("58 " * 8).strip() in recv_payload, + f"Payload of scattered packet did not match expected payload with offset {offset}.", + ) + testpmd.stop() + + def test_scatter_mbuf_2048(self) -> None: + """Run :func:`~PmdBufferScatter.pmd_scatter` function with `mbsize` set to 2048.""" + self.pmd_scatter(mbsize=2048) + + def tear_down_suite(self) -> None: + """Tear down the test suite. + + Teardown: + Set the MTU of the tg_node back to a more standard size of 1500 + """ + self.tg_node.main_session.configure_port_mtu(1500, self._tg_port_egress) + self.tg_node.main_session.configure_port_mtu(1500, self._tg_port_ingress)