From patchwork Tue Jan 9 15:36:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135810 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 C4CCC43874; Tue, 9 Jan 2024 16:36:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B2FB340696; Tue, 9 Jan 2024 16:36:52 +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 0C7E04067C for ; Tue, 9 Jan 2024 16:36:51 +0100 (CET) Received: by mail-io1-f100.google.com with SMTP id ca18e2360f4ac-7ba903342c2so236323439f.3 for ; Tue, 09 Jan 2024 07:36:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704814610; x=1705419410; 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=nkJ+yLG29I8+/aQfw39m1kor0PzgWi5PaYNueNK4+V8=; b=FsAWqz8sfRZRRv1UBYnj955vK3o40cY9d6XBvwnnfIzlYxtDb9YwZlZZgR2ta+QDLK XfEAc5Eihw0Tf/VSMQ7K2eG/ZfoM6HtFIAiSjVfyffJ582te3iVzQ0YbXurzyUA+kjDV xM2VaTdCYNq2at0m8umWidwfLtdmk34Oynq94= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704814610; x=1705419410; 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=nkJ+yLG29I8+/aQfw39m1kor0PzgWi5PaYNueNK4+V8=; b=GbnvT8jzFzjczyQ2YLDAhpzKZ5lWkw7REL70L5i+6hPJwN0oOUVD0h7gE4Psb+/VXa gj1KjgjiVEAxmRr8PD8gH3cIO+Az2/+ef1hC11zAUquArUiwc/StuIwHiBKn+fN6oMiR 2LgtxgDm5h/iZ7Q/1hemFOzr8nvqsnsrZTYNp33QRE6DqyvcPR4gikOFQXGXYeMqP3G2 FxpwoXIR0vNFgz2S6+5czM9FT1R8ylZQ5rcZz2CcvAgh8Q4cg5j/mYw9MePwIBwsG2Q/ Vik5EmTZnG8TjcAzDb0TDwy0VdBNRXWYnfoSwKO0SNzDm1yzosK+/1rKGMy+oJQ6Vm9F EPng== X-Gm-Message-State: AOJu0YxC9WjadYbpVmOw6POTMV2Zrn5FfAcEA8TAXGGTVLS/r+YiWgyh qDFlJJIMzKsgFYK2x8kWBSNn3VS3S/8winVTRaQz5AI0zoEcMYxubEL1u+MBco+UR7Y+hd9mKg= = X-Google-Smtp-Source: AGHT+IEwSXKUscNkAC5xj2yI6sAHSkktCovKFBZ8tTAdnOvebtOEEzqCgIrM4TRA62EnxPpStd1qRgf+yNu3 X-Received: by 2002:a5d:9242:0:b0:7be:d960:664c with SMTP id e2-20020a5d9242000000b007bed960664cmr1158323iol.12.1704814610410; Tue, 09 Jan 2024 07:36:50 -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 gk5-20020a0566386a8500b0046ce7198871sm60904jab.67.2024.01.09.07.36.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2024 07:36:50 -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 76EBF6043300; Tue, 9 Jan 2024 10:36:49 -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 v7 1/7] dts: add startup verification and forwarding modes to testpmd shell Date: Tue, 9 Jan 2024 10:36:27 -0500 Message-ID: <20240109153633.766-2-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240109153633.766-1-jspewock@iol.unh.edu> References: <20240103223206.23129-1-jspewock@iol.unh.edu> <20240109153633.766-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..11c5c7f93c 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:`-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 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 Tue Jan 9 15:36:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135811 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 13DA143874; Tue, 9 Jan 2024 16:36:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB6A54069F; Tue, 9 Jan 2024 16:36:56 +0100 (CET) Received: from mail-qk1-f228.google.com (mail-qk1-f228.google.com [209.85.222.228]) by mails.dpdk.org (Postfix) with ESMTP id 3A0AD4067C for ; Tue, 9 Jan 2024 16:36:55 +0100 (CET) Received: by mail-qk1-f228.google.com with SMTP id af79cd13be357-783253c2182so148195085a.3 for ; Tue, 09 Jan 2024 07:36:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704814614; x=1705419414; 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=22Viv0p4NKB4q9UrUDAvFjYc676iS3F9qZHdqWIctF0=; b=KnM+IKCwTckLjWIqM+L4IYYRp3ZhpNmeu8O7AKOYeJnwz6OsEJNIJfNhzba+vqaoEx obeCjKDNpEPd9FON3ubaMCKY9QcexHcilGH+P8U8prj14GLFKXlTvwpN6/H5NIpEkh7X aLWbEpO9KzP3Y7p6AVaLoQ3Q/BjEdP6JRyD+Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704814614; x=1705419414; 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=22Viv0p4NKB4q9UrUDAvFjYc676iS3F9qZHdqWIctF0=; b=n9o7F7Lf3NyDvwkG8bnI9Pq8YCw6Xk8KS8j/OjaRET42VN7zVAjOpIjLhxtlMTN1gs KtPtTTvDgPBfesUhhewoEGNyHoxsDyr9E4rtaF05vTPJD+frFP/0ioj+1MKaJl7CscB6 OuPxMqc/XhZzljSm+5DQsYifuKwYrD04sehP2KhMNOEwot6zp6a08nlnjFkX6OVE6nDT YumuXda9z5PHt1OAfsREydDyJ5wl3y5C7M9xWZ8rkW/siE2CVr7rKqaLbFZIgOBxte+c FRShJ4Q+New0S3JwVmst9UygLtN/6ebnyq3T40rJxO3xlUr/HOKPwKrXaOI2piSJFChg ViEA== X-Gm-Message-State: AOJu0Yw+igB5dKG1diqkuiOsgpsj2DX9Pwe+U2l/f4yLxm/w2T/6sOpp j+HfyHVCkcmWofQt1XJsOEbyNcbVXwEFS3AOi6ss06qVOQyJU2OVER3qYgzo761RAB049YQ3aw= = X-Google-Smtp-Source: AGHT+IH9krnYjOQn1d6dhqauaWQtz3xvFmbvh9K+VDsinmm3M/uk3iWpysHBsHjGVQMyN46fCvBViGFCNTRe X-Received: by 2002:a05:620a:123a:b0:783:1a20:7db3 with SMTP id v26-20020a05620a123a00b007831a207db3mr4738970qkj.143.1704814614644; Tue, 09 Jan 2024 07:36:54 -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 bm37-20020a05620a19a500b007830f0c575fsm37773qkb.5.2024.01.09.07.36.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2024 07:36:54 -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 E5F8B6043300; Tue, 9 Jan 2024 10:36:53 -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 v7 2/7] dts: limit EAL parameters to DPDK apps and add parameters to all apps Date: Tue, 9 Jan 2024 10:36:28 -0500 Message-ID: <20240109153633.766-3-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240109153633.766-1-jspewock@iol.unh.edu> References: <20240103223206.23129-1-jspewock@iol.unh.edu> <20240109153633.766-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 11c5c7f93c..8a9578913b 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 Tue Jan 9 15:36:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135812 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 E27D643874; Tue, 9 Jan 2024 16:37:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1D4D8406FF; Tue, 9 Jan 2024 16:37:01 +0100 (CET) Received: from mail-qt1-f228.google.com (mail-qt1-f228.google.com [209.85.160.228]) by mails.dpdk.org (Postfix) with ESMTP id 71CA5406FF for ; Tue, 9 Jan 2024 16:36:59 +0100 (CET) Received: by mail-qt1-f228.google.com with SMTP id d75a77b69052e-4298c18d796so12809601cf.3 for ; Tue, 09 Jan 2024 07:36:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704814619; x=1705419419; 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=WpchfIrfC0HUqZ08HHIwYRfapscxUfjh3gbXn+0pwBE2Xs4uMEQHPQ0XbMBerpNNjQ 5Io/KAZ/burdur7WoilFp8Q1KsseWrEl/IxH1kT/wkOIKu1xOk9vC1SFVREFR+J7AzQn 9U05BSbJGC1xMV3tHGwPgF1ua06sdrPlNI4A0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704814619; x=1705419419; 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=jwhPRFTGVmgyCk59WPKc4SnL3FgZRz41JOpn50HJ58qfL83ujW89vk5It4/VGOt7VN cAAUK0YUEqhI6xHZdhNtYdJN31ffGe0Esd7tk2zprMwjIXNCv/wYqa6z+s1YKbssziWF BYo8ZD3OGXn9OGKiLO4iNDNKVfCsx59V6ksJdp23cmYGIs6u8NlZ9p9JYyewcwAqhy7M 1QJcNHASqexluqHkdk56ewLQUr/br5A1tL9HdXUXKZRI7so2feYHZMZ+F0Hx68AkToJ8 ySKoEv3SRgnf3U4yQtQ+kTKGuKzSNC10YswNrhQ5xGtsBphhlZskDz148vCv3QEoB5lt o4Ag== X-Gm-Message-State: AOJu0Yzb6Y5dVTm/9iLGsq/Fc67zoO3LuT2SbNTtFom9mQcT4FnY0X8f VZEZiSrFeFWtrYoPt3lmT+0ZqfBT5Sgd28T6hkgHwLXjB+vtR8Kc43q0Tc7GxsUo7fwCrUg++Q= = X-Google-Smtp-Source: AGHT+IGaA+uJmj9muy9wh+M8CdYN2ZAL1ATTaPSPUKhkfUTR/FE3t+0zw+HgRayJ3qtmN/BGO7kwh44kh7/z X-Received: by 2002:ac8:5806:0:b0:429:91fd:383d with SMTP id g6-20020ac85806000000b0042991fd383dmr3924921qtg.111.1704814618755; Tue, 09 Jan 2024 07:36:58 -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 t22-20020ac85896000000b004299f67c256sm88676qta.5.2024.01.09.07.36.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2024 07:36:58 -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 24FBE6043300; Tue, 9 Jan 2024 10:36:58 -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 v7 3/7] dts: add optional packet filtering to scapy sniffer Date: Tue, 9 Jan 2024 10:36:29 -0500 Message-ID: <20240109153633.766-4-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240109153633.766-1-jspewock@iol.unh.edu> References: <20240103223206.23129-1-jspewock@iol.unh.edu> <20240109153633.766-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 Tue Jan 9 15:36:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135813 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 1E16F43874; Tue, 9 Jan 2024 16:37:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7773140A79; Tue, 9 Jan 2024 16:37:02 +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 76381406FF for ; Tue, 9 Jan 2024 16:37:00 +0100 (CET) Received: by mail-oo1-f99.google.com with SMTP id 006d021491bc7-5981e5d4e7cso1852800eaf.0 for ; Tue, 09 Jan 2024 07:37:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704814620; x=1705419420; 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=NFJ8uK6IKIylxo+VUjp60xw8gikF56WJi/0mfh9WYPrYghBSU9eRRt80i2XVhp30b0 uyn3nmFfjcE4CACjvTS+GfZpsVJKdccFGax3t6PpNCTqZwlT7Z/ormE0+X8HY6llGugf rIZ2Gsldsv9UBFesnbgKZrzhOHB0IelgNRG7k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704814620; x=1705419420; 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=oSuXYzIS++/HKP2nA8kZMAbDAl1zeyD4rLYCKHOyeTG7poi6+7lw5MYseGXgyahVaP qrgjG6ER/NGbjYJfX+/OE7X1H3uzV0GWBvwYlAhsbuc2jgseJ/9UtLtoKaSpjmPVsJNd tzI/V6vgLw3nF9bmaG5IQ8iGZQUTFhN/pmk9l/tzio5wDJsfT8ehr5NmsRPCsn8ERHHn jferyqtkcOdFGwKHtwjYOoOcOBkHitTZuW26TrPo2gKkNmGLYiPmybVrGfiz6H4u/7Zt aeImU0PF2ornc9ueVNBDqddBwxLtZlPfFsPFU0odsb3Q+bv36BNBmJJZuPHdlL9mmfDj fPDw== X-Gm-Message-State: AOJu0Ywa1yxw75BaTfod9iHF0v8SUUsNtXhFk1koAyW1ivPJxR1Mh3P0 s9WH4j+vQzY4rZJIiYiLvQyotG/uzHmD/siuyjRKLyPQY7hNSWZfWQX8hA== X-Google-Smtp-Source: AGHT+IHgwk1w0U89UxP1BfV63NiudI5g3iwOhwg39AaDcBvt0ifSS44pafMbX3a4mHG0AVUrEDNT0lrXOcaC X-Received: by 2002:a4a:1ac7:0:b0:598:45be:2ca7 with SMTP id 190-20020a4a1ac7000000b0059845be2ca7mr2579860oof.11.1704814619769; Tue, 09 Jan 2024 07:36:59 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id h19-20020a4a6b53000000b00594cdd911d6sm95619oof.20.2024.01.09.07.36.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2024 07:36:59 -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 0FB0F6043300; Tue, 9 Jan 2024 10:36:59 -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 v7 4/7] dts: add pci addresses to EAL parameters Date: Tue, 9 Jan 2024 10:36:30 -0500 Message-ID: <20240109153633.766-5-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240109153633.766-1-jspewock@iol.unh.edu> References: <20240103223206.23129-1-jspewock@iol.unh.edu> <20240109153633.766-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 Tue Jan 9 15:36:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135815 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 544A343874; Tue, 9 Jan 2024 16:37:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC88140A70; Tue, 9 Jan 2024 16:37:05 +0100 (CET) Received: from mail-oa1-f99.google.com (mail-oa1-f99.google.com [209.85.160.99]) by mails.dpdk.org (Postfix) with ESMTP id 3647640A80 for ; Tue, 9 Jan 2024 16:37:03 +0100 (CET) Received: by mail-oa1-f99.google.com with SMTP id 586e51a60fabf-2045bedb806so2738416fac.3 for ; Tue, 09 Jan 2024 07:37:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704814622; x=1705419422; 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=NoNBeBJQlkt3iB6Lxwko1yuqC4bq8FCklF6sWfwkQ/eXHRRuUWSEb1IhZgjwtsrrDK IOqkWMNmRVdmBXaUJiN6CYc2MViCqGtUqfeNHTbbOZcLNgQiZ55jCLoM3o+c1YYgUMUy ysTgMmb9RRQfv3+ENHYvvxsNykMq17EdpEuRg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704814622; x=1705419422; 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=rk9BOZ4aXDVVHw3O2o4dnPvtYt0MZV81QXX6C9iDL6TeCzMHavCKEG8A75kAMhqszb HGL0hc2fI/vvodrcwii+HamGiyZfF7GxxTx8eAEgixDAVE4dnqsXzjdzkbar8BlOYCst aSAQSIfybMc04nL8yzzAsKTbyPzoUn4CbuPNHE4z+eI5axFu2a/glx3kPCNA62od9n5O 9CuLnJDwn1+DhnHghMnD8m+EU7JBT5aukzIqC1zD89SBNAUZTsSybYwk1Wd4nMhDM2cE iC1cu4omVILQuCnC1OXODy0w5nq5LMYs25ACcV/bkFEF9+RPQbGVC+UX4MpBSjjvsA5k MtEw== X-Gm-Message-State: AOJu0Ywj/ueI4ZnCgwES1vPIjjtENgJTS2a+ZhUkmnHDH06zwI4Gr6Al bkTE4MD0iE/zepES9hrP2OwuIKXu0q8DN2xwDni42+jrmOu1aHeDsDwcGQ== X-Google-Smtp-Source: AGHT+IG9i51JvmGVn/geeaTYj5WUoc3KkLEq6W8SFQuMr4tzyhWHRewk0fw/RzowgGWgx6g32f2JuzioC2Lj X-Received: by 2002:a05:6870:5e50:b0:1fb:75c:3fe4 with SMTP id ne16-20020a0568705e5000b001fb075c3fe4mr7710643oac.68.1704814621108; Tue, 09 Jan 2024 07:37:01 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id ds8-20020a0568705b0800b00203b9707d1fsm77820oab.2.2024.01.09.07.37.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2024 07:37:01 -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 2641F6043300; Tue, 9 Jan 2024 10:37:00 -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 v7 5/7] dts: allow configuring MTU of ports Date: Tue, 9 Jan 2024 10:36:31 -0500 Message-ID: <20240109153633.766-6-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240109153633.766-1-jspewock@iol.unh.edu> References: <20240103223206.23129-1-jspewock@iol.unh.edu> <20240109153633.766-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 Tue Jan 9 15:36:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135814 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 D45C343874; Tue, 9 Jan 2024 16:37:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 999D240A80; Tue, 9 Jan 2024 16:37:04 +0100 (CET) Received: from mail-io1-f99.google.com (mail-io1-f99.google.com [209.85.166.99]) by mails.dpdk.org (Postfix) with ESMTP id 875D440A7D for ; Tue, 9 Jan 2024 16:37:02 +0100 (CET) Received: by mail-io1-f99.google.com with SMTP id ca18e2360f4ac-7bed9fb159fso24680339f.1 for ; Tue, 09 Jan 2024 07:37:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704814622; x=1705419422; 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=BH8FFag5RraUnRTrKAgoifZBfeo5U4gqcdaHCYviiEhrZFnj7d+qGjjUbWpRtxVnqc I4S2cx8jEHv63McGdLUWdeDunIg0QjDPfRm3G0E/NwmdL6CRkYIU8bR4iezjnHs9dq+W A3o8ylPzCjN0eJUIIdLnWaIxuncU6PAL2x/g4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704814622; x=1705419422; 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=JrMrwnhVYsjenq59Tbsq9Wkx3rroda8zF4LK8cYAHjs2Xdu+k94QZZ26E5YKiL3Gj0 +X9iMRvWm3D4cwuhEZzQAoE8SwJ4855i31HaEMJgkJz33cq6yPpATlwVlxMMhyRcyCpj N7VfI+p+YPFJo7N8hM7VcTWO8RSvh8ptHezLJwMY+1Q7gCS1WWTvAUpKFgStoy5nnEID 3etfRTqpoBToxYPcQ9BefTjZRAniKjp6m4p1rGvoQnPCIZRqIY7Q8bn42VdOjiuPz8lx iDFwI2CwEkF3BdXzVnQf2awvtrSMTluZ7G+VnLJVbx5JCo8DuxF0wLHG8Mb0MVlB6fHp +07g== X-Gm-Message-State: AOJu0YzOk/IAZoH/7+lIVZtEEyeVSGF0CTl75/uUpTEznsJLKll7//oA 5f+uJni6LoHDF7lBWrWoHsS7wgoYea7HVt9Ls0X0N76JvrwOCW5WUYMdXzre/EmtV/wy+m50Ig= = X-Google-Smtp-Source: AGHT+IEXaTicsf3bsL7xmcccEve0ZCsAkfC1gTRULDRMQEOaNv3pIJjm9ZJUtjK+aY/TmnlEWTM+AC+URwqZ X-Received: by 2002:a5e:d815:0:b0:7be:d950:62a2 with SMTP id l21-20020a5ed815000000b007bed95062a2mr1241399iok.11.1704814621945; Tue, 09 Jan 2024 07:37:01 -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 n18-20020a6b5912000000b007bb652c1e7esm63949iob.14.2024.01.09.07.37.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2024 07:37:01 -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 21A806043301; Tue, 9 Jan 2024 10:37: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 v7 6/7] dts: add scatter to the yaml schema Date: Tue, 9 Jan 2024 10:36:32 -0500 Message-ID: <20240109153633.766-7-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240109153633.766-1-jspewock@iol.unh.edu> References: <20240103223206.23129-1-jspewock@iol.unh.edu> <20240109153633.766-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 Tue Jan 9 15:36:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135816 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 63B2243874; Tue, 9 Jan 2024 16:37:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E3C2240DCB; Tue, 9 Jan 2024 16:37:06 +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 1AD704013F for ; Tue, 9 Jan 2024 16:37:04 +0100 (CET) Received: by mail-pl1-f227.google.com with SMTP id d9443c01a7336-1d542701796so12877255ad.1 for ; Tue, 09 Jan 2024 07:37:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704814623; x=1705419423; 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=yG5ihyqksPkOfOKbLnHgz0MQyuovidBk5blRP7CchGk=; b=N3yZsLOEnhF87hdgIWrNKNLyO+uYaG6oiqcgKX1Bpn8AmccbmldsxsXb2ALnMCO6Z4 lvHq9e9X1rftaXb++lt90/IOYx0akfhYjor+QFQWjBGA/BMzIw/FILPCVHjomrjnlXFo CI9g4gpr4p0OptORPclw6Sp8Y5hQqYuC5oxNc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704814623; x=1705419423; 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=yG5ihyqksPkOfOKbLnHgz0MQyuovidBk5blRP7CchGk=; b=X3KiQKjo7hbhsAwfDQYh5Yt6/j8lnRbgRp9y2NfVBXDwYKqvTVMcVs5iLl18OS6aPv FqoYRAfzT8qkC70om/xmr9uCMI2TMI49YkkQYS+oAlY/Yul+xib5Wldl+3kNPgheZ/Hs ye71j67Eiy9beS58aDs4rYZxgLVvPYocK9YG3rohZi6JNhPWEqJyQ1v+93BcppajqR7t K1SkABWCSu4k+k+GV6FNFwv9KKJ6Wp+opqxszvarG2fQE0i+vEueOoy9AGXRL7YwsaYN zfRhUYsfj/kleDf/c9/vg2uU8tjDfZZVAeJ/fnGmPLZTgYa7zcug2xSLuaLmbX9FA519 BkAQ== X-Gm-Message-State: AOJu0YzpqUzkoN55S32ZkAUQtKhVQruqCoJP/MkQ51p9nSjHubnjOZJb lKqP+foNFICE7TjSkjJphnu8PjPsznJT7xcj0L+m9MYlquiZyEdZgDzKzw== X-Google-Smtp-Source: AGHT+IEiLlDkfSV7b+OvHwuKzUWZyTC8NO77hJKqpPncs5YFP4Nr52LAUNTPVI+F1s50eEh49JbiFj7gQ9CD X-Received: by 2002:a17:902:ced0:b0:1d4:d5bb:5d81 with SMTP id d16-20020a170902ced000b001d4d5bb5d81mr2624730plg.43.1704814623311; Tue, 09 Jan 2024 07:37:03 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id 6-20020a170902c14600b001d4910ff855sm73972plj.83.2024.01.09.07.37.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2024 07:37:03 -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 592536043300; Tue, 9 Jan 2024 10:37:02 -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 v7 7/7] dts: add pmd_buffer_scatter test suite Date: Tue, 9 Jan 2024 10:36:33 -0500 Message-ID: <20240109153633.766-8-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240109153633.766-1-jspewock@iol.unh.edu> References: <20240103223206.23129-1-jspewock@iol.unh.edu> <20240109153633.766-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..9ce1bacabf --- /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 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)