From patchwork Wed Jan 10 14:42:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135823 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 4790B43883; Wed, 10 Jan 2024 15:43:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C448E402DC; Wed, 10 Jan 2024 15:43:13 +0100 (CET) Received: from mail-vs1-f97.google.com (mail-vs1-f97.google.com [209.85.217.97]) by mails.dpdk.org (Postfix) with ESMTP id 51394402CC for ; Wed, 10 Jan 2024 15:43:12 +0100 (CET) Received: by mail-vs1-f97.google.com with SMTP id ada2fe7eead31-46788b25f95so945635137.0 for ; Wed, 10 Jan 2024 06:43:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704897791; x=1705502591; 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=rKIkDZzDotgALxe7lIJpJHvWlgJD02jhLY1H0QLsNps=; b=EGOH2ICVpx2wV4wAfvUR2I4LP6RpJlzO/b8MFz8+T7HB/9VpyhnvryUQVEr1yLAK0h ez6Bnqy3DyPFnxO9XNzwJVmE1gibMHmDy/0qOgH+ZVOdtHJopFFiPVPfQJOKMXgoNWs5 h9WTdf11CDH+fhO+jZA6ZQmtwBt6rPKShMMi0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704897791; x=1705502591; 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=rKIkDZzDotgALxe7lIJpJHvWlgJD02jhLY1H0QLsNps=; b=B1O1FCHM5fzpzUUXvpOHZLl/daBO+wqcd1Kxb2W05QmdkY4c9kpi3h//PKvoQ7Ioft eO/3ZXVyUt09JxKAx8RDmNMCIQhXvMywi4oFvNsdAfvbsjQ74fF4U3AoW7Ijqo/kvgEt wQqTeHrkhAc1OG06yd1FS75NQE49ntPeL7h3QHyQEVC2HCNKXF18SPwJW5oGwPV2gld2 0XXkYKD5Pt7V9oSiPqgM5MgXxwU47kdQU7g7J4nlFM/3gQmd3Tw3ES9+AjXJP1gCrQQu Zzgqa/3hFNbZjWUkdMgNKr7f4ZfrzycoHB3GtmT0DCYqhgtnIVwO6exGqiJa0ntiCZ1h utSw== X-Gm-Message-State: AOJu0YyF/40J2Ak4etHzYqrReoW2O7bbWGOIvKdssBZWYDp23WSS71Hb 3a0tVJBJY5drv/Ss7I+WkLSrdl/1OomR1aJ+EDHTGxE40So3KxNGCAUa6pnZ+7Qf+K7w8XoOZw= = X-Google-Smtp-Source: AGHT+IG3EGsb1boMYh8cY7Ktr7VDEP0WDEIk5tlRqlb+3d085QjtZsCWlTJ3YTk6Q+rRicjprOV9Q0MIFVyG X-Received: by 2002:a05:6102:5043:b0:466:fc2c:3cac with SMTP id by3-20020a056102504300b00466fc2c3cacmr781077vsb.67.1704897791013; Wed, 10 Jan 2024 06:43: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 c12-20020a9f3e4c000000b007cc705bbad0sm166956uaj.0.2024.01.10.06.43.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2024 06:43: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 4CDD26043481; Wed, 10 Jan 2024 09:43: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 v8 1/7] dts: add startup verification and forwarding modes to testpmd shell Date: Wed, 10 Jan 2024 09:42:43 -0500 Message-ID: <20240110144249.20719-2-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240110144249.20719-1-jspewock@iol.unh.edu> References: <20240109153633.766-1-jspewock@iol.unh.edu> <20240110144249.20719-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..3a66907394 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 may be modified using the :option:`--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 the 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 10 14:42:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135824 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 CBC8E43883; Wed, 10 Jan 2024 15:43:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 09C0F402F1; Wed, 10 Jan 2024 15:43:15 +0100 (CET) Received: from mail-yw1-f225.google.com (mail-yw1-f225.google.com [209.85.128.225]) by mails.dpdk.org (Postfix) with ESMTP id 6B0CB402CC for ; Wed, 10 Jan 2024 15:43:13 +0100 (CET) Received: by mail-yw1-f225.google.com with SMTP id 00721157ae682-5efb0e180f0so41725627b3.1 for ; Wed, 10 Jan 2024 06:43:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704897793; x=1705502593; 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=81QIl95D/luKOFCRremptKj0NAtei/OAWDhJqGrkUF4=; b=foIc93ovSIBa2h7vhPVPLaMSvFlakqXi4mWZRlII7RE5vl3jo6bOjoESLpWibSni0m G6hmoTKsKGub4WshX4t6XzdUk4jANPGmJbQRDk5f05wVHkm4M+qe9XDY0Vu7aIVfm/Do 9m7seNO/iUntXHbAST94/bZRipw40sJXX8tC4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704897793; x=1705502593; 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=81QIl95D/luKOFCRremptKj0NAtei/OAWDhJqGrkUF4=; b=BpXhbfePWqDqD8fA4g8Cclb4rigggzT+w8kRoIEgu0mgdXlm0tW8wceZMjia80F05k vCWbzbtL6/XAZs7zmQ15SMs0dbkd/8SWBITxrRw74xugxacXuH700W62+Q/9cYg6yA9I iZP0K4dHz6YbMFLnUBmc+Zia/1nhFa5fzUfrSZTJN9T/j8vpnw++II9Z5fIKbEOQT2yG gIgZgfOCwqeZRHyQRxicz6H7ddDjbGHE7LBQd9+V9LE9pdHVxUf4EQgdtfadnrtVUgPC ZHHmjP+OwynbmhAmMI+vC/CiiNEIP0pfrBqRfEu/Y2woEU71CeOPn4EUGAZBSOqOCpEX wHKA== X-Gm-Message-State: AOJu0YwBYKEbJeFiUyWRUaUHutEmUJTht+hScHu+kj0HU+doNDor7vg1 Bhi2kst/NluEWQUCD3mW8koO0VPwF5QJUmqTE2kDF1y9EfHqBGyyBFRlOw== X-Google-Smtp-Source: AGHT+IHF/U6I8Bv036Ldq54gE+m85JmIInIyuMf4Hv8qb69ANIMH/gHgLmnucn+rZ3UZumkXadvY/X29mc25 X-Received: by 2002:a25:ab88:0:b0:dbd:2e78:f8ad with SMTP id v8-20020a25ab88000000b00dbd2e78f8admr751473ybi.118.1704897792627; Wed, 10 Jan 2024 06:43:12 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id x196-20020a25cecd000000b00dbcc78ac8ddsm240555ybe.10.2024.01.10.06.43.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2024 06:43: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 DFC586043481; Wed, 10 Jan 2024 09:43: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 v8 2/7] dts: limit EAL parameters to DPDK apps and add parameters to all apps Date: Wed, 10 Jan 2024 09:42:44 -0500 Message-ID: <20240110144249.20719-3-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240110144249.20719-1-jspewock@iol.unh.edu> References: <20240109153633.766-1-jspewock@iol.unh.edu> <20240110144249.20719-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 --- dts/framework/remote_session/testpmd_shell.py | 2 +- dts/framework/testbed_model/sut_node.py | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py index 3a66907394..cb2ab6bd00 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..909394e756 100644 --- a/dts/framework/testbed_model/sut_node.py +++ b/dts/framework/testbed_model/sut_node.py @@ -430,7 +430,8 @@ def create_interactive_shell( shell_cls: Type[InteractiveShellType], timeout: float = SETTINGS.timeout, privileged: bool = False, - eal_parameters: EalParameters | str | None = None, + app_parameters: str = "", + eal_parameters: EalParameters | None = None, ) -> 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 10 14:42:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135825 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 905AE43883; Wed, 10 Jan 2024 15:43:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 846B74069F; Wed, 10 Jan 2024 15:43:17 +0100 (CET) Received: from mail-il1-f228.google.com (mail-il1-f228.google.com [209.85.166.228]) by mails.dpdk.org (Postfix) with ESMTP id 5BF8A402EB for ; Wed, 10 Jan 2024 15:43:14 +0100 (CET) Received: by mail-il1-f228.google.com with SMTP id e9e14a558f8ab-3606dda206aso22938075ab.3 for ; Wed, 10 Jan 2024 06:43:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704897793; x=1705502593; 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=k0M6T+YEfDCSHqY2sH36bpUcdJcBkWGIsu2uhEZz2y8=; b=He7r0ylRJ7vAnFB8ViXVHoibbd70y+i6lubEh91d/GiMh+7OWcn3JQcmO3HhVxLwxY CBLePrJgDwjfkwNXFf6rld0A4Tz6t4fkakTybiMOjojd29KmREn9t1dyXI6WoHNVsk/K kKjY1upYnG+6IsRWVdb1FWfl48thksKcK4EL0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704897793; x=1705502593; 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=k0M6T+YEfDCSHqY2sH36bpUcdJcBkWGIsu2uhEZz2y8=; b=vlTr6pZn8xYZxCVfAvRPiYzEaKjQXriAPDvd+7cNx2DMw5kumZnefEAWfVUJdn7r/a 4OVbereEhPghBcCCrkc7mpCbuZEiV36vrKV6zMw484lLrlSbQmboPOuKq9QMgXivmgWC Rjc+G5DqAwVKu7bGVOL2Vgd3wSAl9+vC5v76m8gCLLCOPGuPpUemjMXC63D7ceJj/6kf hSAFsTR3h6++cFPlByM7sd0EETH7r7Tc48H2Jx3wfoRy5XdNz2P76MUf/0aal+tBhVkD xsL94FCzWQgVpbSaVPimejziw9Ae8AK+XRt2VZRfOWfWCZN0RCDz4C6Sio7mgpZweDzr biUQ== X-Gm-Message-State: AOJu0Yya1MrdyvCvbbgP8SUpP1x1TGuZCruG1VE2ne54mL/IByN9aod5 u2GWxDCHmD60XhejgImHcWWdg7CoovVHf6w47noVSzgHOKKGxbbybWO4uw== X-Google-Smtp-Source: AGHT+IGxp+lFtVOzijzHInPsVEAZv4l3mJWwfT/dby7+GIuT3wijmBbRoKc4uPfZ1jBo2wC/GD+3v7blK3K3 X-Received: by 2002:a92:c564:0:b0:35f:dc78:48d5 with SMTP id b4-20020a92c564000000b0035fdc7848d5mr1634799ilj.52.1704897793701; Wed, 10 Jan 2024 06:43:13 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id o16-20020a056e02115000b0035ff7e9ee4fsm219464ill.30.2024.01.10.06.43.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2024 06:43: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 E09826043481; Wed, 10 Jan 2024 09:43:12 -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 v8 3/7] dts: add optional packet filtering to scapy sniffer Date: Wed, 10 Jan 2024 09:42:45 -0500 Message-ID: <20240110144249.20719-4-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240110144249.20719-1-jspewock@iol.unh.edu> References: <20240109153633.766-1-jspewock@iol.unh.edu> <20240110144249.20719-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..e5a1560e90 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, frozen=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..df3069d516 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 = [] + 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 10 14:42:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135827 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 2B24143883; Wed, 10 Jan 2024 15:43:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0177D40696; Wed, 10 Jan 2024 15:43:20 +0100 (CET) Received: from mail-pg1-f225.google.com (mail-pg1-f225.google.com [209.85.215.225]) by mails.dpdk.org (Postfix) with ESMTP id 297D840685 for ; Wed, 10 Jan 2024 15:43:16 +0100 (CET) Received: by mail-pg1-f225.google.com with SMTP id 41be03b00d2f7-517ab9a4a13so3237858a12.1 for ; Wed, 10 Jan 2024 06:43:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704897795; x=1705502595; 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=pRnrX2NkCTD9Oy40zRgq71nD2pbb99S5ImuL2IF0CRE=; b=VVdz86Az5ZgzLWrY/TXpQM26WzbSqTszw6TqsEF6R2xJha9KJ8psO37IIkMpu9FzE8 +rj0q2F4YAXr0zPSEU4gx4qmy6Gy5bq4DNjS+/fO5e6GNnkfgRHclC8z0U2RX0sEmYb3 StoxhbSfqfuHC5aDFUVFbyAld2B2myVKRfHc4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704897795; x=1705502595; 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=pRnrX2NkCTD9Oy40zRgq71nD2pbb99S5ImuL2IF0CRE=; b=et3MRmjziRIWhzd6ZNUIhMuUHqksxxH+5W9ymdCZvYHr3ozjY8CDBTMEjLNCh07wnP XS/IqcBAkpxIJphMY9eWI7XpN3qFN9W6EDouhFL0bVvroCUbyiWy0CqDFegarnme7nBb Zdhjd48egAiFG9nMZUf9V8jQd7VNoy3avavfCZOTd69WqXUlLI+fGQRDpk4maO7H2VoC SNeoZBSD8+nrawujRntFl+I1MS3FxjrgUSjArc0YPCvteZqFqTYO04Hv5LU8x6F1ETty 9JvuTeQ9io1bAMHq9/A+5O8Ht+1ggF7aBfhVDp+U1+bGMr2vbdzWB79kg0tQUoODSIPR nlCA== X-Gm-Message-State: AOJu0YxJJ7hIkTfIe+szSP8m5x5ymuM4UF4PBlHk+aPxUz+WbLuMoKFr vaM53oBOSmK2UKPhAsYtEzdzJ/aLJkNnnmzw35ymRsCEeeLfkkivHk8c2UuQ3TKYAfdRqW7HkQ= = X-Google-Smtp-Source: AGHT+IGu8yZxeCe8wsqSx+1d/v4JZIj8PV3ixLeuKVp3Ub33ECXk5OllKc9GaKfejlRV9QnI6gzOoU/wGzTL X-Received: by 2002:a17:90a:c90d:b0:28c:17de:c8ce with SMTP id v13-20020a17090ac90d00b0028c17dec8cemr850958pjt.2.1704897795033; Wed, 10 Jan 2024 06:43:15 -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 qb4-20020a17090b280400b0028b042385ecsm88460pjb.9.2024.01.10.06.43.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2024 06:43:15 -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 AE6706043482; Wed, 10 Jan 2024 09:43: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 v8 4/7] dts: add pci addresses to EAL parameters Date: Wed, 10 Jan 2024 09:42:46 -0500 Message-ID: <20240110144249.20719-5-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240110144249.20719-1-jspewock@iol.unh.edu> References: <20240109153633.766-1-jspewock@iol.unh.edu> <20240110144249.20719-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 --- 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 909394e756..97aa26d419 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 10 14:42:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135826 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 1598743883; Wed, 10 Jan 2024 15:43:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BCF9B406BC; Wed, 10 Jan 2024 15:43:18 +0100 (CET) Received: from mail-pl1-f227.google.com (mail-pl1-f227.google.com [209.85.214.227]) by mails.dpdk.org (Postfix) with ESMTP id 24EBD4067C for ; Wed, 10 Jan 2024 15:43:16 +0100 (CET) Received: by mail-pl1-f227.google.com with SMTP id d9443c01a7336-1d3eb299e2eso25513415ad.2 for ; Wed, 10 Jan 2024 06:43:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704897795; x=1705502595; 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=QDUAne9XD+6/osGoVkSSeV7Dm5uiKDddL3STaSQ/vWCS1fLaTg0CWkHERi/wvJO56C gE+qpjJQ69UNkRO3ipaxvg99sC102Am1B+4Lx6D9cpwwllJLrdvILavRZqCmYJy+alkd huGce8Oql1sCXHSP7TkbTvKcsaDiwZRpuwF30= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704897795; x=1705502595; 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=OndXDDv2l+QVcjLRAF3XW5hQJUWGeTMgG81bJsDRtvjMsYOSZfjUQU1lS57It10RwR OvXvacYqkNyPEtjAOsFqLzXGdmvK/Jvw0Wyf7uPPRRsWvwLdNTDe4a9r0y/7QX4SqLvF 4pOUUn+rWLe42WBDe2T1J2nyrP9ElOF7WsaA/Gf+pJB+Zk1f33vyvvZx6F2NhMzn3Z12 IOU0Kxc9g9ej8eUwCX6nzAHZ75cLFIW8QgytrePXenv9FQ1sZZOfb8SbBKt50sisuCBl Ao0OdCak3mNg5f6X+UZgxJJO9B7Eq4BfmTEDIDj+BWjgEBA5wxUG5cEOlVUdDVrVQOxL RSoA== X-Gm-Message-State: AOJu0YwsO4pMFt3xcqhLoWxuTN18qXHBkd0KtR5HJWE9LQ59gG0z57aT 6oNULENtM348UDV7I48RXs5r7x4SQZY3QxjrOyl+v2O17NTOTQO6VFiz97Sw75Otr28xDo7M7g= = X-Google-Smtp-Source: AGHT+IEzcNBAj+Z46hDxZJV40tZJqSua35i4/kjctgzuq6tcV8zHoa/oT7gJJt02usSO8xTCfv+c5rwfB4n/ X-Received: by 2002:a17:903:52:b0:1d3:ee8d:25db with SMTP id l18-20020a170903005200b001d3ee8d25dbmr714647pla.117.1704897795329; Wed, 10 Jan 2024 06:43:15 -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 q18-20020a170902b11200b001d3af947bf3sm147364plr.121.2024.01.10.06.43.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2024 06:43:15 -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 790696043481; Wed, 10 Jan 2024 09:43:14 -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 v8 5/7] dts: allow configuring MTU of ports Date: Wed, 10 Jan 2024 09:42:47 -0500 Message-ID: <20240110144249.20719-6-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240110144249.20719-1-jspewock@iol.unh.edu> References: <20240109153633.766-1-jspewock@iol.unh.edu> <20240110144249.20719-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 --- 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 10 14:42:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135828 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 2AF7F43883; Wed, 10 Jan 2024 15:43:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8287840A79; Wed, 10 Jan 2024 15:43:21 +0100 (CET) Received: from mail-io1-f100.google.com (mail-io1-f100.google.com [209.85.166.100]) by mails.dpdk.org (Postfix) with ESMTP id 02B4F40685 for ; Wed, 10 Jan 2024 15:43:16 +0100 (CET) Received: by mail-io1-f100.google.com with SMTP id ca18e2360f4ac-7bee328027bso55013439f.1 for ; Wed, 10 Jan 2024 06:43:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704897796; x=1705502596; 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=XkkDYIQhlJJ4C7zy101XdOax4wKXUGNf+DiVski6clGsQH+XoqQfovZdEwq62nf6sx CBEZKtnPMaGQKkS+C2niJODpB7+yEPHBn3RZTrvv/0i3X0YulfIDrste/sRdF67Ne43G Nquf4OtgAq9jYrDDuw7MB7AFOaThbSNlTHtwo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704897796; x=1705502596; 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=dQb5/l4oHu3SvtNHnPyx0qMKRzD6Fvvo7Kpiq4ufZLCOGomh6qaHsJCwN2D4BmjyZL PnbuOCgXAeeR7+ybrt24XXKLjlLyWGjkptId8zQ5mY++O91TrWuQEKFnaEcJq0IdGx40 q2+5JhWKuA+8eBB9rIQmsD9NfgBmT4/J62mHUY8zs8ONxcUVySaE2sFnZy2UO5LLXQY5 nCZ5TukoFfAVG3jmobAgbjZLvwL+0XTMTta+5hb/x492cKmpmMidzc1BMKODMN4AWp6f zRL5sT/f4r9/sdVxJoJeD70p9D3YShphgy51C4tYmFIHeyOs4FpIpZZrTiRWMUn+gSj8 T6RQ== X-Gm-Message-State: AOJu0YxHpry1KLhxuwERoKLPswE9Gl8nznM4w7IYbnHlGlbm1HpqhAYH YJd1YWBDGzGHlEJdeewC5uYCraQDzRv6rKbk1IsEEdBze4MjVKRXDJHsb1EIruaQnVRZqoEY3w= = X-Google-Smtp-Source: AGHT+IGrVNWJymP8gZTclqnGht3HqAL0SKC0+qjnRV6kfLMyAf8MFSJ83qKtbVbdyKgVqoUyv9ACvY22czjf X-Received: by 2002:a5d:91cc:0:b0:7be:e6a1:2eea with SMTP id k12-20020a5d91cc000000b007bee6a12eeamr880284ior.16.1704897796183; Wed, 10 Jan 2024 06:43:16 -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 v1-20020a5ec201000000b007bbc1764c83sm153834iop.8.2024.01.10.06.43.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2024 06:43:16 -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 50A7E6043483; Wed, 10 Jan 2024 09:43:15 -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 v8 6/7] dts: add scatter to the yaml schema Date: Wed, 10 Jan 2024 09:42:48 -0500 Message-ID: <20240110144249.20719-7-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240110144249.20719-1-jspewock@iol.unh.edu> References: <20240109153633.766-1-jspewock@iol.unh.edu> <20240110144249.20719-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 --- 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 10 14:42:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135829 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 0AADC43883; Wed, 10 Jan 2024 15:44:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B909740A7D; Wed, 10 Jan 2024 15:43:22 +0100 (CET) Received: from mail-yw1-f225.google.com (mail-yw1-f225.google.com [209.85.128.225]) by mails.dpdk.org (Postfix) with ESMTP id BABF3406B4 for ; Wed, 10 Jan 2024 15:43:17 +0100 (CET) Received: by mail-yw1-f225.google.com with SMTP id 00721157ae682-5e7467eb93aso33420577b3.1 for ; Wed, 10 Jan 2024 06:43:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704897797; x=1705502597; 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=fgqC8ojfMmzb5vmM+cT5gWY+K8JW5xF69kzl3GpQQsw=; b=c4vV44UxVjxS6GuWx54uxgV9johemdSKSRlWGXjVbwORrKstNGJqVM0qAY0qnqpg8s CwYAMJsljYYF4hYXX+dXlDm8iAVeQSboFLt+AaqKA/74rd1kFiGXLXE7nMPMcJVIlkH1 LPb94vp1vFAgdmIhIwLxMaXeAvG+1k2LGgWfM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704897797; x=1705502597; 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=fgqC8ojfMmzb5vmM+cT5gWY+K8JW5xF69kzl3GpQQsw=; b=sfqcadBa49RZTxPpnsihvZJQuxBCfNQlbmNS+NVBnJ+uFOO5DXIMaJ4CHznt+TcpG3 kgG5OY6RUbTYrBc5Wvj9/Nq0CPrmwf0bEcDNOTJwP9MUbpcuasSN6uaTERRUhZzWzY89 T0NxwHWyKFt5OwcEA5obWV3bSkHSnhzmUtNU1dPGfUhQL808kOeMJ5W4Ssw8w3hIWoY7 vPoSIZK2V7AVpt5KQ51Y9rZAD2RDgbbPaWY1ALqa3/c1ih0xPgNIjHvmYZfXDQ0P8Xok 1ZjbRduOgyiM6DrfgWPZsLvGCuq/Mfgg0fEej617R8I8Au14BmaL92OqwWeEVF07ffd3 V5gA== X-Gm-Message-State: AOJu0YzEeeojhhuA+Tczaiua0hVW2ocqeWCkYTj3dtorMwn6u/6TqzFv pkPGy+f4b0qLozBMRu8HdRQs16UwkOUOWLYndOMxFDiGWf9EiLsepbxsOGuPiZG9oy5wpnVKMA= = X-Google-Smtp-Source: AGHT+IHt4RuPuKWYcehyMzcEkhFyhFRHioAEyoMvGAJtBdN8H0oWH7FkUtesKOpYcZ2D0G8D0quCP1uiYl25 X-Received: by 2002:a0d:f801:0:b0:5e9:94dc:b77f with SMTP id i1-20020a0df801000000b005e994dcb77fmr811917ywf.9.1704897797114; Wed, 10 Jan 2024 06:43:17 -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 k84-20020a816f57000000b005efdda9c3d7sm241601ywc.22.2024.01.10.06.43.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2024 06:43:17 -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 693FE6043481; Wed, 10 Jan 2024 09:43:16 -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 v8 7/7] dts: add pmd_buffer_scatter test suite Date: Wed, 10 Jan 2024 09:42:49 -0500 Message-ID: <20240110144249.20719-8-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240110144249.20719-1-jspewock@iol.unh.edu> References: <20240109153633.766-1-jspewock@iol.unh.edu> <20240110144249.20719-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 | 132 ++++++++++++++++++++++ 1 file changed, 132 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..d7535ac822 --- /dev/null +++ b/dts/tests/TestSuite_pmd_buffer_scatter.py @@ -0,0 +1,132 @@ +# 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 that we have at least 2 port links in the current execution and increase the MTU + of both ports on the traffic generator to 9000 to support larger packet sizes. + """ + self.verify( + len(self._port_links) > 1, + "There must be at least two port links to run the scatter test suite", + ) + + 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 a packet to the SUT then capture what is forwarded back. + + Generate an IP packet of a specific length and send it to the SUT, then capture the + resulting received packet and extract its payload. The desired length of the packet is met + by packing its payload with the letter "X" in hexadecimal. + + Args: + pktsize: Size of the packet to generate and send. + + Returns: + The payload of the received packet as a string. + """ + 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 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 the :meth:`pmd_scatter` test 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)