From patchwork Wed Jan 3 22:12:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135707 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 4386F4380D; Wed, 3 Jan 2024 23:13:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32CE4402E4; Wed, 3 Jan 2024 23:13:27 +0100 (CET) Received: from mail-yw1-f226.google.com (mail-yw1-f226.google.com [209.85.128.226]) by mails.dpdk.org (Postfix) with ESMTP id A7A6F4013F for ; Wed, 3 Jan 2024 23:13:25 +0100 (CET) Received: by mail-yw1-f226.google.com with SMTP id 00721157ae682-5e7467eb93aso70200567b3.1 for ; Wed, 03 Jan 2024 14:13:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704320005; x=1704924805; 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=NdDlvudO2l0q7r8N4T1fDzlulaY9LQ4nOijlNNqwE4U=; b=VUiPYVwjQ+TJhs14+3305qK7i2qlatQgVnRit09ln4BYRx6c5rTMu3sZnjdUd9b8Zh Xr87NmUnJhAqpywlLfUbglFQbBW0ODx7Yo+8K/oHQI23A5ZctK/UrfSf01ebj7kzvHSl 2j1XgjAGzy2p1LGWnIP3wQOQtcKxCAoTkYW0s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704320005; x=1704924805; 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=NdDlvudO2l0q7r8N4T1fDzlulaY9LQ4nOijlNNqwE4U=; b=LEkSZ0LVI/HHaFWvzWqw0AqWXMpALiRLOqqIZR9mvY4VpwbHa/ChlzvZpo9pXcp9dL HaKxEEgb5B1zRWomsB/9K7pGVMuitRd8zzgNfUkbu6W7nJI6Gi2WaAFU3AjmNXuHXEuH nln64TJddE6sxGR27hbAQ1JAhIeyfXnCSLt1s8NSbq1jN/+xIkqOXP5dgGVHyVG9Wkuz Z1yz0e8NG3+K59Wa+G5ObI7F0etPZ279etNw3fce6Y6f68eoyNo+d3qwRi4/RELmkJpL jOT9JKoR9nmF7KebWxS9AWmLcxuJ/7/3U/4D2Ua9wtCg11fnzTX/SP59+axMD2UolDj4 Xh5A== X-Gm-Message-State: AOJu0Yx+v+Uw0dTKoXRqhIdWrV1TNte+kQ8uDALGDS9E4vHrqaZmnDVz +P+NJ5Kpp8NGhtw2poKTnkmNF81wBSDGfuCpoVpnQqUz4UBpxjuKvVZ0LQ/jWTIQ5iirjDv2zA= = X-Google-Smtp-Source: AGHT+IFJ8/CzoXEKx/z6bQxdwUUiPKgfCdKiC6iJWCxGQAJwA711qfwlFdNhK66lXk8Y3dxDqg5nQHoM2+xm X-Received: by 2002:a81:6582:0:b0:5d9:987d:36e1 with SMTP id z124-20020a816582000000b005d9987d36e1mr7915941ywb.76.1704320004987; Wed, 03 Jan 2024 14:13:24 -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 m70-20020a0dca49000000b005ee411e57a7sm938806ywd.68.2024.01.03.14.13.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:13:24 -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 537F7605C311; Wed, 3 Jan 2024 17:13:24 -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 v5 1/7] dts: add startup verification and forwarding modes to testpmd shell Date: Wed, 3 Jan 2024 17:12:11 -0500 Message-ID: <20240103221217.18954-2-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103221217.18954-1-jspewock@iol.unh.edu> References: <20231218181221.10057-1-jspewock@iol.unh.edu> <20240103221217.18954-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 foward modes, and verifying link status of ports so that developers can configure testpmd and start forwaring through the provided class rather than sending commands to the testpmd session directly. Signed-off-by: Jeremy Spewock --- dts/framework/exception.py | 7 + dts/framework/remote_session/testpmd_shell.py | 149 +++++++++++++++++- 2 files changed, 155 insertions(+), 1 deletion(-) diff --git a/dts/framework/exception.py b/dts/framework/exception.py index 658eee2c38..cce1e0231a 100644 --- a/dts/framework/exception.py +++ b/dts/framework/exception.py @@ -146,6 +146,13 @@ def __str__(self) -> str: return f"Command {self.command} returned a non-zero exit code: {self._command_return_code}" +class InteractiveCommandExecutionError(DTSError): + """An unsuccessful execution of a remote command in an interactive environment.""" + + #: + severity: ClassVar[ErrorSeverity] = ErrorSeverity.REMOTE_CMD_EXEC_ERR + + class RemoteDirectoryExistsError(DTSError): """A directory that exists on a remote node.""" diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py index 0184cc2e71..f310705fac 100644 --- a/dts/framework/remote_session/testpmd_shell.py +++ b/dts/framework/remote_session/testpmd_shell.py @@ -15,9 +15,15 @@ testpmd_shell.close() """ +import time +from enum import auto from pathlib import PurePath from typing import Callable, ClassVar +from framework.exception import InteractiveCommandExecutionError +from framework.settings import SETTINGS +from framework.utils import StrEnum + from .interactive_shell import InteractiveShell @@ -43,14 +49,51 @@ def __str__(self) -> str: return self.pci_address +class TestPmdForwardingModes(StrEnum): + r"""The supported packet forwarding modes for :class:`~TestPmdShell`\s.""" + + #: + io = auto() + #: + mac = auto() + #: + macswap = auto() + #: + flowgen = auto() + #: + rxonly = auto() + #: + txonly = auto() + #: + csum = auto() + #: + icmpecho = auto() + #: + ieee1588 = auto() + #: + noisy = auto() + #: + fivetswap = "5tswap" + #: + shared_rxq = "shared-rxq" + #: + recycle_mbufs = auto() + + class TestPmdShell(InteractiveShell): """Testpmd interactive shell. The testpmd shell users should never use the :meth:`~.interactive_shell.InteractiveShell.send_command` method directly, but rather call specialized methods. If there isn't one that satisfies a need, it should be added. + + Attributes: + number_of_ports: The number of ports which were allowed on the command-line when testpmd + was started. """ + number_of_ports: int + #: The path to the testpmd executable. path: ClassVar[PurePath] = PurePath("app", "dpdk-testpmd") @@ -65,9 +108,66 @@ class TestPmdShell(InteractiveShell): _command_extra_chars: ClassVar[str] = "\n" def _start_application(self, get_privileged_command: Callable[[str], str] | None) -> None: - self._app_args += " -- -i" + """Overrides :meth:`~.interactive_shell._start_application`. + + Add flags for starting testpmd in interactive mode and disabling messages for link state + change events before starting the application. Link state is verified before starting + packet forwarding and the messages create unexpected newlines in the terminal which + complicates output collection. + + Also find the number of pci addresses which were allowed on the command line when the app + was started. + """ + self._app_args += " -- -i --mask-event intr_lsc" + self.number_of_ports = self._app_args.count("-a ") super()._start_application(get_privileged_command) + def start(self, verify: bool = True) -> None: + """Start packet forwarding with the current configuration. + + Args: + verify: If :data:`True` , a second start command will be sent in an attempt to verify + packet forwarding started as expected. + + Raises: + InteractiveCommandExecutionError: If `verify` is :data:`True` and forwarding fails to + start or ports fail to come up. + """ + self.send_command("start") + if verify: + # If forwarding was already started, sending "start" again should tell us + start_cmd_output = self.send_command("start") + if "Packet forwarding already started" not in start_cmd_output: + self._logger.debug(f"Failed to start packet forwarding: \n{start_cmd_output}") + raise InteractiveCommandExecutionError("Testpmd failed to start packet forwarding.") + + for port_id in range(self.number_of_ports): + if not self.wait_link_status_up(port_id): + raise InteractiveCommandExecutionError( + "Not all ports came up after starting packet forwarding in testpmd." + ) + + def stop(self, verify: bool = True) -> None: + """Stop packet forwarding. + + Args: + verify: If :data:`True` , the output of the stop command is scanned to verify that + forwarding was stopped successfully or not started. If neither is found, it is + considered an error. + + Raises: + InteractiveCommandExecutionError: If `verify` is :data:`True` and the command to stop + forwarding results in an error. + """ + stop_cmd_output = self.send_command("stop") + if verify: + if ( + "Done." not in stop_cmd_output + and "Packet forwarding not started" not in stop_cmd_output + ): + self._logger.debug(f"Failed to stop packet forwarding: \n{stop_cmd_output}") + raise InteractiveCommandExecutionError("Testpmd failed to stop packet forwarding.") + def get_devices(self) -> list[TestPmdDevice]: """Get a list of device names that are known to testpmd. @@ -82,3 +182,50 @@ def get_devices(self) -> list[TestPmdDevice]: if "device name:" in line.lower(): dev_list.append(TestPmdDevice(line)) return dev_list + + def wait_link_status_up(self, port_id: int, timeout=SETTINGS.timeout) -> bool: + """Wait until the link status on the given port is "up". + + Arguments: + port_id: Port to check the link status on. + timeout: Time to wait for the link to come up. The default value for this + argument is set using the :option:`-t, --timeout` command-line argument + or the :envvar:`DTS_TIMEOUT` environment variable. + + Returns: + Whether the link came up in time or not. + """ + time_to_stop = time.time() + timeout + port_info: str = "" + while time.time() < time_to_stop: + port_info = self.send_command(f"show port info {port_id}") + if "Link status: up" in port_info: + break + time.sleep(0.5) + else: + self._logger.error(f"The link for port {port_id} did not come up in the given timeout.") + return "Link status: up" in port_info + + def set_forward_mode(self, mode: TestPmdForwardingModes, verify: bool = True): + """Set packet forwarding mode. + + Args: + mode: The forwarding mode to use. + verify: If :data:`True` the output of the command will be scanned in an attempt to + verify that the forwarding mode was set to `mode` properly. + + Raises: + InteractiveCommandExecutionError: If `verify` is :data:`True` and forwarding mode fails + to update. + """ + set_fwd_output = self.send_command(f"set fwd {mode.value}") + if f"Set {mode.value} packet forwarding mode" not in set_fwd_output: + self._logger.debug(f"Failed to set fwd mode to {mode.value}:\n{set_fwd_output}") + raise InteractiveCommandExecutionError( + f"Test pmd failed to set fwd mode to {mode.value}" + ) + + def close(self) -> None: + """Overrides :meth:`~.interactive_shell.close`.""" + self.send_command("quit", "") + return super().close() From patchwork Wed Jan 3 22:12:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135708 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 C83874380D; Wed, 3 Jan 2024 23:13:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7FCCD402E9; Wed, 3 Jan 2024 23:13:31 +0100 (CET) Received: from mail-pj1-f98.google.com (mail-pj1-f98.google.com [209.85.216.98]) by mails.dpdk.org (Postfix) with ESMTP id 2B341402E8 for ; Wed, 3 Jan 2024 23:13:30 +0100 (CET) Received: by mail-pj1-f98.google.com with SMTP id 98e67ed59e1d1-28b6218d102so8473560a91.0 for ; Wed, 03 Jan 2024 14:13:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704320009; x=1704924809; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9sBuSec7fI7Z7rWHY25CViLMRcwyEg4OGA3nWGh5Sdg=; b=MgTCDMbJY4/3Hk/vz+YLI+fmTtDVSLD2UTzRzoVLo00uXMEN8CfqOn1XkYGop9GYJq V5pPFM7qo2507ltb5jyKGwo6YtcobPxAl4oahtBsI4rTF3ddHgdbDreA5AXgF2TcJOjd ExtcNxJgLi3vS5gLNDPzSxoclI+8pHEmh5xQk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704320009; x=1704924809; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9sBuSec7fI7Z7rWHY25CViLMRcwyEg4OGA3nWGh5Sdg=; b=c9/8QwSf7iR3nAoyI1dxb/nr20fshBDoJ9aQfVY05yFdqpkWK31i4c4SuVr2/PcNjj txUwqI+sbWnmQ3hSrrNcTHODbuhmYe+FVBoBiwvLzpLAm92TT0ESIBluqFPsg5rqPe+g +Q1DcPYTXjn7q3hpleIYZUpHlqlf7JPFYt762XoKV6+JyeYEg3F/QjAdTjPSWWY5HPuB /lIDn4AOF0FP2BUODkcJCDpZzJRYeirFWAMNLcpRubgRaXXgKLrRB6QCBnQOKzX+DevT lQ/EDPuz6zyO0Q3EE0apGBC1RFdNCIrp27ejHpwFFcArJJT2WwLT/f4hjud04LQApBhB usKg== X-Gm-Message-State: AOJu0Yx+qR6f1MYxpxWMNWSxNSEmrxbsuim26/wo0BHfFMjvX8m2hhul /RKaIbGVveU8j6JSmORle5UJyO6t9Y6sP1p4mjL8LuV7Q9w4G0qcNVhPrBg2Ois1LTyospQs6A= = X-Google-Smtp-Source: AGHT+IFsNVUa61FyDEWu8E0AxtaToHnrYJoCWTLIT3fL1q57Gt5wKL4QRIheZbPolEMmWfEOCMUSpjYFGoDa X-Received: by 2002:a17:90a:528b:b0:28c:e611:ee05 with SMTP id w11-20020a17090a528b00b0028ce611ee05mr1841289pjh.74.1704320009480; Wed, 03 Jan 2024 14:13:29 -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 si14-20020a17090b528e00b0028ce2950b90sm145504pjb.15.2024.01.03.14.13.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:13:29 -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 66EF8605C311; Wed, 3 Jan 2024 17:13:28 -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 v5 2/7] dts: limit EAL parameters to DPDK apps and add parameters to all apps Date: Wed, 3 Jan 2024 17:12:12 -0500 Message-ID: <20240103221217.18954-3-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103221217.18954-1-jspewock@iol.unh.edu> References: <20231218181221.10057-1-jspewock@iol.unh.edu> <20240103221217.18954-1-jspewock@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock Changed the factory method for creating interactive apps in the SUT Node so that EAL parameters would only be passed into DPDK apps since non-DPDK apps wouldn't be able to process them. Also modified interactive apps to allow for the ability to pass parameters into the app on startup so that the applications can be started with certain configuration steps passed on the command line. Signed-off-by: Jeremy Spewock --- I ended up reverting part of this back to making the argument for eal_parameters allowed to be a string. This was because it was casuing mypy errors where the method signatures of sut_node did not match with that of node. dts/framework/remote_session/testpmd_shell.py | 2 +- dts/framework/testbed_model/sut_node.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py index f310705fac..8f40e8f40e 100644 --- a/dts/framework/remote_session/testpmd_shell.py +++ b/dts/framework/remote_session/testpmd_shell.py @@ -118,7 +118,7 @@ def _start_application(self, get_privileged_command: Callable[[str], str] | None Also find the number of pci addresses which were allowed on the command line when the app was started. """ - self._app_args += " -- -i --mask-event intr_lsc" + self._app_args += " -i --mask-event intr_lsc" self.number_of_ports = self._app_args.count("-a ") super()._start_application(get_privileged_command) diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py index c4acea38d1..4df18bc183 100644 --- a/dts/framework/testbed_model/sut_node.py +++ b/dts/framework/testbed_model/sut_node.py @@ -431,6 +431,7 @@ def create_interactive_shell( timeout: float = SETTINGS.timeout, privileged: bool = False, eal_parameters: EalParameters | str | None = None, + app_parameters: str = "", ) -> InteractiveShellType: """Extend the factory for interactive session handlers. @@ -449,20 +450,23 @@ def create_interactive_shell( eal_parameters: List of EAL parameters to use to launch the app. If this isn't provided or an empty string is passed, it will default to calling :meth:`create_eal_parameters`. + app_parameters: Additional arguments to pass into the application on the + command-line. Returns: An instance of the desired interactive application shell. """ - if not eal_parameters: - eal_parameters = self.create_eal_parameters() - - # We need to append the build directory for DPDK apps + # We need to append the build directory and add EAL parameters for DPDK apps if shell_cls.dpdk_app: + if not eal_parameters: + eal_parameters = self.create_eal_parameters() + app_parameters = f"{eal_parameters} -- {app_parameters}" + shell_cls.path = self.main_session.join_remote_path( self.remote_dpdk_build_dir, shell_cls.path ) - return super().create_interactive_shell(shell_cls, timeout, privileged, str(eal_parameters)) + return super().create_interactive_shell(shell_cls, timeout, privileged, app_parameters) def bind_ports_to_driver(self, for_dpdk: bool = True) -> None: """Bind all ports on the SUT to a driver. From patchwork Wed Jan 3 22:12:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135709 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 58D054380D; Wed, 3 Jan 2024 23:13:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0D0B402EF; Wed, 3 Jan 2024 23:13:32 +0100 (CET) Received: from mail-yb1-f228.google.com (mail-yb1-f228.google.com [209.85.219.228]) by mails.dpdk.org (Postfix) with ESMTP id 1F9F2402E8 for ; Wed, 3 Jan 2024 23:13:31 +0100 (CET) Received: by mail-yb1-f228.google.com with SMTP id 3f1490d57ef6-dbdacafe012so7259148276.1 for ; Wed, 03 Jan 2024 14:13:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704320010; x=1704924810; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G/fFLowcTHNLQrw5ls8IZ2ibWugX+AoKRyJMocHizh4=; b=Ald/BidzRPkTJA1MO1OxS+Lce6Imi3hRpA5kYpVeX5iiZrYPvPNoT3OZqyohiS50O+ wexDXprO+DXAhMU9x6yXIAl4Lio29aAiHNIzti1KOOnk1wtXA4qGHzL6mVNVrtDrKiTD 57NrRLzbr+Y4P9FKTaCXuD0YG4gNskZIj1sFI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704320010; x=1704924810; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G/fFLowcTHNLQrw5ls8IZ2ibWugX+AoKRyJMocHizh4=; b=V2bQ4L/+WFEpxCG53ZCnOdFRGgdFcqVV/b87e6CtC2AnPGyX/0w9MjRWI+l0n30yDi Asxhu6csT+uf1pJ1lpRheHt12dE56Pq6NRYFd4R4PJQ9ydG0cwr/ACp0hx8IGe1jbufD g0tEWok+IzCVndKsF+DPyZZ58KoDIxuVew7UYU0JODd1P/08h54W6Y8yMIEBJZUqJd1A I2+z49dUH6qQ5EMEMhpnw5uJIVpzaEzP7bQtYvp2mCOe0zVpkxv+jiaDOvUrA/g2JycP W5x4HqhdThoLT3+UExtUcmpkwJ0OAIIcjCxi7/n1GJbWPtA5CV8c4pjwIDpD4CcsatbH YnSw== X-Gm-Message-State: AOJu0YxbXwXsGAAwxcYLRiME/3NNrZmVhtLKvSNC/l4YF9zQqWCz66Ig p9XcxG75eTml2fPFbgmvUOA/MOSuczgJIXOLYu1/hfGdetjIbqkuAjAWwQ== X-Google-Smtp-Source: AGHT+IGEgk4j+Vx5VW1er0fxw0L2/Zo5DzvXs76rrvRazctNkCcbEsWc8VB+ZtaxoJOjp4LwzjxaZUC65+U7 X-Received: by 2002:a05:6902:848:b0:dbe:328a:3d9b with SMTP id d8-20020a056902084800b00dbe328a3d9bmr7101463ybu.17.1704320010408; Wed, 03 Jan 2024 14:13:30 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id i34-20020a25b222000000b00dbd7442b7ffsm1728543ybj.33.2024.01.03.14.13.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:13:30 -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 B870D605C311; Wed, 3 Jan 2024 17:13:29 -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 v5 3/7] dts: add optional packet filtering to scapy sniffer Date: Wed, 3 Jan 2024 17:12:13 -0500 Message-ID: <20240103221217.18954-4-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103221217.18954-1-jspewock@iol.unh.edu> References: <20231218181221.10057-1-jspewock@iol.unh.edu> <20240103221217.18954-1-jspewock@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock Added the options to filter out LLDP and ARP packets when sniffing for packets with scapy. This was done using BPF filters to ensure that the noise these packets provide does not interfere with test cases. Signed-off-by: Jeremy Spewock --- dts/framework/test_suite.py | 15 +++++++++-- dts/framework/testbed_model/tg_node.py | 14 ++++++++-- .../traffic_generator/__init__.py | 7 ++++- .../capturing_traffic_generator.py | 22 ++++++++++++++- .../testbed_model/traffic_generator/scapy.py | 27 +++++++++++++++++++ 5 files changed, 79 insertions(+), 6 deletions(-) diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py index dfb391ffbd..ffea917690 100644 --- a/dts/framework/test_suite.py +++ b/dts/framework/test_suite.py @@ -38,6 +38,7 @@ from .settings import SETTINGS from .test_result import BuildTargetResult, Result, TestCaseResult, TestSuiteResult from .testbed_model import Port, PortLink, SutNode, TGNode +from .testbed_model.traffic_generator import PacketFilteringConfig from .utils import get_packet_summaries @@ -208,7 +209,12 @@ def configure_testbed_ipv4(self, restore: bool = False) -> None: def _configure_ipv4_forwarding(self, enable: bool) -> None: self.sut_node.configure_ipv4_forwarding(enable) - def send_packet_and_capture(self, packet: Packet, duration: float = 1) -> list[Packet]: + def send_packet_and_capture( + self, + packet: Packet, + filter_config: PacketFilteringConfig = PacketFilteringConfig(), + duration: float = 1, + ) -> list[Packet]: """Send and receive `packet` using the associated TG. Send `packet` through the appropriate interface and receive on the appropriate interface. @@ -216,6 +222,7 @@ def send_packet_and_capture(self, packet: Packet, duration: float = 1) -> list[P Args: packet: The packet to send. + filter_config: The filter to use when capturing packets. duration: Capture traffic for this amount of time after sending `packet`. Returns: @@ -223,7 +230,11 @@ def send_packet_and_capture(self, packet: Packet, duration: float = 1) -> list[P """ packet = self._adjust_addresses(packet) return self.tg_node.send_packet_and_capture( - packet, self._tg_port_egress, self._tg_port_ingress, duration + packet, + self._tg_port_egress, + self._tg_port_ingress, + filter_config, + duration, ) def get_expected_packet(self, packet: Packet) -> Packet: diff --git a/dts/framework/testbed_model/tg_node.py b/dts/framework/testbed_model/tg_node.py index f269d4c585..d3206e87e0 100644 --- a/dts/framework/testbed_model/tg_node.py +++ b/dts/framework/testbed_model/tg_node.py @@ -15,7 +15,11 @@ from .node import Node from .port import Port -from .traffic_generator import CapturingTrafficGenerator, create_traffic_generator +from .traffic_generator import ( + CapturingTrafficGenerator, + PacketFilteringConfig, + create_traffic_generator, +) class TGNode(Node): @@ -53,6 +57,7 @@ def send_packet_and_capture( packet: Packet, send_port: Port, receive_port: Port, + filter_config: PacketFilteringConfig = PacketFilteringConfig(), duration: float = 1, ) -> list[Packet]: """Send `packet`, return received traffic. @@ -65,13 +70,18 @@ def send_packet_and_capture( packet: The packet to send. send_port: The egress port on the TG node. receive_port: The ingress port in the TG node. + filter_config: The filter to use when capturing packets. duration: Capture traffic for this amount of time after sending `packet`. Returns: A list of received packets. May be empty if no packets are captured. """ return self.traffic_generator.send_packet_and_capture( - packet, send_port, receive_port, duration + packet, + send_port, + receive_port, + filter_config, + duration, ) def close(self) -> None: diff --git a/dts/framework/testbed_model/traffic_generator/__init__.py b/dts/framework/testbed_model/traffic_generator/__init__.py index 11e2bd7d97..0eaf0355cd 100644 --- a/dts/framework/testbed_model/traffic_generator/__init__.py +++ b/dts/framework/testbed_model/traffic_generator/__init__.py @@ -14,11 +14,16 @@ and a capturing traffic generator is required. """ +# pylama:ignore=W0611 + from framework.config import ScapyTrafficGeneratorConfig, TrafficGeneratorType from framework.exception import ConfigurationError from framework.testbed_model.node import Node -from .capturing_traffic_generator import CapturingTrafficGenerator +from .capturing_traffic_generator import ( + CapturingTrafficGenerator, + PacketFilteringConfig, +) from .scapy import ScapyTrafficGenerator diff --git a/dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py b/dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py index 0246590333..c1c9facedd 100644 --- a/dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py +++ b/dts/framework/testbed_model/traffic_generator/capturing_traffic_generator.py @@ -11,6 +11,7 @@ import uuid from abc import abstractmethod +from dataclasses import dataclass import scapy.utils # type: ignore[import] from scapy.packet import Packet # type: ignore[import] @@ -26,6 +27,19 @@ def _get_default_capture_name() -> str: return str(uuid.uuid4()) +@dataclass(slots=True) +class PacketFilteringConfig: + """The supported filtering options for :class:`CapturingTrafficGenerator`. + + Attributes: + no_lldp: If :data:`True`, LLDP packets will be filtered out when capturing. + no_arp: If :data:`True`, ARP packets will be filtered out when capturing. + """ + + no_lldp: bool = True + no_arp: bool = True + + class CapturingTrafficGenerator(TrafficGenerator): """Capture packets after sending traffic. @@ -54,6 +68,7 @@ def send_packet_and_capture( packet: Packet, send_port: Port, receive_port: Port, + filter_config: PacketFilteringConfig, duration: float, capture_name: str = _get_default_capture_name(), ) -> list[Packet]: @@ -68,6 +83,7 @@ def send_packet_and_capture( packet: The packet to send. send_port: The egress port on the TG node. receive_port: The ingress port in the TG node. + filter_config: Filters to apply when capturing packets. duration: Capture traffic for this amount of time after sending the packet. capture_name: The name of the .pcap file where to store the capture. @@ -75,7 +91,7 @@ def send_packet_and_capture( The received packets. May be empty if no packets are captured. """ return self.send_packets_and_capture( - [packet], send_port, receive_port, duration, capture_name + [packet], send_port, receive_port, filter_config, duration, capture_name ) def send_packets_and_capture( @@ -83,6 +99,7 @@ def send_packets_and_capture( packets: list[Packet], send_port: Port, receive_port: Port, + filter_config: PacketFilteringConfig, duration: float, capture_name: str = _get_default_capture_name(), ) -> list[Packet]: @@ -99,6 +116,7 @@ def send_packets_and_capture( packets: The packets to send. send_port: The egress port on the TG node. receive_port: The ingress port in the TG node. + filter_config: Filters to apply when capturing packets. duration: Capture traffic for this amount of time after sending the packets. capture_name: The name of the .pcap file where to store the capture. @@ -113,6 +131,7 @@ def send_packets_and_capture( packets, send_port, receive_port, + filter_config, duration, ) @@ -126,6 +145,7 @@ def _send_packets_and_capture( packets: list[Packet], send_port: Port, receive_port: Port, + filter_config: PacketFilteringConfig, duration: float, ) -> list[Packet]: """The implementation of :method:`send_packets_and_capture`. diff --git a/dts/framework/testbed_model/traffic_generator/scapy.py b/dts/framework/testbed_model/traffic_generator/scapy.py index 5b60f66237..505de0be94 100644 --- a/dts/framework/testbed_model/traffic_generator/scapy.py +++ b/dts/framework/testbed_model/traffic_generator/scapy.py @@ -32,6 +32,7 @@ from .capturing_traffic_generator import ( CapturingTrafficGenerator, + PacketFilteringConfig, _get_default_capture_name, ) @@ -69,6 +70,7 @@ def scapy_send_packets_and_capture( send_iface: str, recv_iface: str, duration: float, + sniff_filter: str, ) -> list[bytes]: """The RPC function to send and capture packets. @@ -90,6 +92,7 @@ def scapy_send_packets_and_capture( iface=recv_iface, store=True, started_callback=lambda *args: scapy.all.sendp(scapy_packets, iface=send_iface), + filter=sniff_filter, ) sniffer.start() time.sleep(duration) @@ -260,11 +263,34 @@ def _send_packets(self, packets: list[Packet], port: Port) -> None: packets = [packet.build() for packet in packets] self.rpc_server_proxy.scapy_send_packets(packets, port.logical_name) + def _create_packet_filter(self, filter_config: PacketFilteringConfig) -> str: + """Combines filter settings from `filter_config` into a BPF that scapy can use. + + Scapy allows for the use of Berkeley Packet Filters (BPFs) to filter what packets are + collected based on various attributes of the packet. + + Args: + filter_config: Config class that specifies which filters should be applied. + + Returns: + A string representing the combination of BPF filters to be passed to scapy. For + example: + + "ether[12:2] != 0x88cc && ether[12:2] != 0x0806" + """ + bpf_filter: list[str] = [] + if filter_config.no_arp: + bpf_filter.append("ether[12:2] != 0x0806") + if filter_config.no_lldp: + bpf_filter.append("ether[12:2] != 0x88cc") + return " && ".join(bpf_filter) + def _send_packets_and_capture( self, packets: list[Packet], send_port: Port, receive_port: Port, + filter_config: PacketFilteringConfig, duration: float, capture_name: str = _get_default_capture_name(), ) -> list[Packet]: @@ -277,6 +303,7 @@ def _send_packets_and_capture( send_port.logical_name, receive_port.logical_name, duration, + self._create_packet_filter(filter_config), ) # type: ignore[assignment] scapy_packets = [Ether(packet.data) for packet in xmlrpc_packets] From patchwork Wed Jan 3 22:12:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135710 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 6F6C54380D; Wed, 3 Jan 2024 23:13:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D8A14067B; Wed, 3 Jan 2024 23:13:34 +0100 (CET) Received: from mail-qt1-f226.google.com (mail-qt1-f226.google.com [209.85.160.226]) by mails.dpdk.org (Postfix) with ESMTP id 2B4ED402EF for ; Wed, 3 Jan 2024 23:13:32 +0100 (CET) Received: by mail-qt1-f226.google.com with SMTP id d75a77b69052e-42832ddd9d1so8680361cf.0 for ; Wed, 03 Jan 2024 14:13:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704320011; x=1704924811; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9O25ducMATwG+pavw82jWa5njc2pAl93LdrUmF2Ic6s=; b=b3lCywXmEg5qRxt2J2wfUYbyNrxWtW0Cwjpd90pEq0pnwFIK5ag+Pkk5mshLtjYeZ1 t/MHOwhDNqO3yqCeEOHoVnWMdqRfG2Vhqlg97zyQIbs40pbaUoebzrXWvDRwzdTxmqnf HGuumzjanKMAMtNIGPoax94Ek18xuwllSk79k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704320011; x=1704924811; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9O25ducMATwG+pavw82jWa5njc2pAl93LdrUmF2Ic6s=; b=rFUqf9VQl/tYJK8PPRkpdcChZQtTZMPHfq2MRN9ctitwEgfpc7wOQE+qNnpuxZLmmb M/MTNC8Rc13AyBQJd4ytQsxMsUhkwRAiNl+M4Zf6/yrBPSkYY7c07gEZnDOFND1lJDfJ Wig732rg5d09kSt6marUN+Bph5Dd1qcJxNdrxtTO5fk7sm+pyqCHFxT2MOuoYg9BBl6l +q4dJzbcsxfbWI3ATSBm9fg2liFeW88fQ74WuWFjwtBh1ThBmM0GhlNkgzMOj+iuFPa7 2uafKSs6+q97p5m6Iq3oyoVjBK70x5RMSWqebzMvuZMEgLFNfHK3haOlRAAKdpaQ6H0q yAWw== X-Gm-Message-State: AOJu0YzpJ4Eyf56tREdCL+sj5bETvITnbuuZ/ndAr5z3ib5kE+FUk15R Nbx4ZEiW97Cfn7rywgR58hwskClSIxdiy4d0ePQbho2aV2KHsr/ka4NdTyCY1bJw5iU4qy+uYg= = X-Google-Smtp-Source: AGHT+IFmWK1XhYn8zSAvJEBEnrc/+tUmzh0ESPvOyE4B0XUnzS0rqHC7Ywuusdb3a1qsoE8PMTledibNa0jS X-Received: by 2002:a05:622a:1646:b0:427:80c4:aa2c with SMTP id y6-20020a05622a164600b0042780c4aa2cmr31584447qtj.50.1704320011554; Wed, 03 Jan 2024 14:13:31 -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 t21-20020a05622a149500b004283623bb53sm99451qtx.26.2024.01.03.14.13.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:13:31 -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 F3097605C311; Wed, 3 Jan 2024 17:13:30 -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 v5 4/7] dts: add pci addresses to EAL parameters Date: Wed, 3 Jan 2024 17:12:14 -0500 Message-ID: <20240103221217.18954-5-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103221217.18954-1-jspewock@iol.unh.edu> References: <20231218181221.10057-1-jspewock@iol.unh.edu> <20240103221217.18954-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 4df18bc183..cc894fb07d 100644 --- a/dts/framework/testbed_model/sut_node.py +++ b/dts/framework/testbed_model/sut_node.py @@ -30,6 +30,7 @@ from .cpu import LogicalCoreCount, LogicalCoreList from .node import Node from .os_session import InteractiveShellType, OSSession +from .port import Port from .virtual_device import VirtualDevice @@ -46,6 +47,7 @@ def __init__( prefix: str, no_pci: bool, vdevs: list[VirtualDevice], + ports: list[Port], other_eal_param: str, ): """Initialize the parameters according to inputs. @@ -63,6 +65,7 @@ def __init__( VirtualDevice('net_ring0'), VirtualDevice('net_ring1') ] + ports: The list of ports to allow. other_eal_param: user defined DPDK EAL parameters, e.g.: ``other_eal_param='--single-file-segments'`` """ @@ -73,6 +76,7 @@ def __init__( self._prefix = f"--file-prefix={prefix}" self._no_pci = "--no-pci" if no_pci else "" self._vdevs = " ".join(f"--vdev {vdev}" for vdev in vdevs) + self._ports = " ".join(f"-a {port.pci}" for port in ports) self._other_eal_param = other_eal_param def __str__(self) -> str: @@ -83,6 +87,7 @@ def __str__(self) -> str: f"{self._prefix} " f"{self._no_pci} " f"{self._vdevs} " + f"{self._ports} " f"{self._other_eal_param}" ) @@ -347,6 +352,7 @@ def create_eal_parameters( append_prefix_timestamp: bool = True, no_pci: bool = False, vdevs: list[VirtualDevice] | None = None, + ports: list[Port] | None = None, other_eal_param: str = "", ) -> "EalParameters": """Compose the EAL parameters. @@ -370,6 +376,8 @@ def create_eal_parameters( VirtualDevice('net_ring0'), VirtualDevice('net_ring1') ] + ports: The list of ports to allow. If :data:`None`, all ports listed in `self.ports` + will be allowed. other_eal_param: user defined DPDK EAL parameters, e.g.: ``other_eal_param='--single-file-segments'``. @@ -388,12 +396,16 @@ def create_eal_parameters( if vdevs is None: vdevs = [] + if ports is None: + ports = self.ports + return EalParameters( lcore_list=lcore_list, memory_channels=self.config.memory_channels, prefix=prefix, no_pci=no_pci, vdevs=vdevs, + ports=ports, other_eal_param=other_eal_param, ) From patchwork Wed Jan 3 22:12:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135711 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 5FB4D4380D; Wed, 3 Jan 2024 23:13:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DE8B04068E; Wed, 3 Jan 2024 23:13:35 +0100 (CET) Received: from mail-pl1-f226.google.com (mail-pl1-f226.google.com [209.85.214.226]) by mails.dpdk.org (Postfix) with ESMTP id 2B0A240608 for ; Wed, 3 Jan 2024 23:13:34 +0100 (CET) Received: by mail-pl1-f226.google.com with SMTP id d9443c01a7336-1d4c3393f99so16566225ad.0 for ; Wed, 03 Jan 2024 14:13:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704320013; x=1704924813; 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=beYLCIXUxJDqkSlkF2aKf5dzi8pgy4qUAH3yiKxWALmM/P7BjBdWbEkXMZ9pLtSKeT QYXgm/+YkffqkSNVmnO4y3YZwODCW8c44jecESxAq8xTyfOsYTADJPgaf4F24S+aQ8Ft siXfh7d71jVL4/8RnAguieFK8BWGO890ZMkUA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704320013; x=1704924813; 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=RQC1hRzUcLtQmwRHh+pQ9NwIsHBKPfA8/nb6z9wSWKfiGjpu1Rgw3X/V8v61kWEWEM EuDuwSuHJuRqwFcxznAizt7uyhevnOMVQPAq9qXAXQ7kNgLi8iYxKn6JcjOhaoiIteMi faW0mL3tPwgKBjLyUG73m8JdKe2cCnya87q/iLqpeBPmKS3HCO6e+spxnKTXIZ9dZ84k KlvPdWuWBo97jRvzqFY0KjDLnhb0jvwsqElhSd1IxdMc2qm9xtfWgSX72Iwb/+xX+Itr bUeTaeqRjVn7QX4LQwNsw/DtoUZ5r8thenEMOPZJwd/9Ost205wNNZaoJelhr4mu1o6e bgdg== X-Gm-Message-State: AOJu0Yy7Z1qK58juJGjRTfdNaIuIKYyKMzptEqnWDFZmMUZ4sn8tSXUm bcfiGFnlqz+B13/1wShN+yhuuNqICKZGMfz9GpQ0E8ZOSjkx5IpQIxjbjw== X-Google-Smtp-Source: AGHT+IE/p20bmhi3geLSV1MbXnMW/pZV3ot/Fc4FpAWfePI0HiIeyPVuehvGrUeXmK97gKUg1oD2tBwC46p8 X-Received: by 2002:a17:903:64d:b0:1d3:f112:2c03 with SMTP id kh13-20020a170903064d00b001d3f1122c03mr19072191plb.53.1704320013395; Wed, 03 Jan 2024 14:13:33 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id c18-20020a170902849200b001d4872d942asm407636plo.132.2024.01.03.14.13.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:13:33 -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 4CEE9605C311; Wed, 3 Jan 2024 17:13:32 -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 v5 5/7] dts: allow configuring MTU of ports Date: Wed, 3 Jan 2024 17:12:15 -0500 Message-ID: <20240103221217.18954-6-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103221217.18954-1-jspewock@iol.unh.edu> References: <20231218181221.10057-1-jspewock@iol.unh.edu> <20240103221217.18954-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 3 22:12:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135712 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 A35984380D; Wed, 3 Jan 2024 23:13:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D54240649; Wed, 3 Jan 2024 23:13:37 +0100 (CET) Received: from mail-yw1-f228.google.com (mail-yw1-f228.google.com [209.85.128.228]) by mails.dpdk.org (Postfix) with ESMTP id 051974067E for ; Wed, 3 Jan 2024 23:13:35 +0100 (CET) Received: by mail-yw1-f228.google.com with SMTP id 00721157ae682-5eefd0da5c0so53047007b3.2 for ; Wed, 03 Jan 2024 14:13:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704320014; x=1704924814; 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=dZy8OE/MKDdND9zoQ99o9bMT8CD0D19v+jI4DH/WClO/QcfMdvGmHAc0xAaqw6kHps Dpo56jlNbhjBwvIWtgW06Lb94OXa8U5r1PHcA9kYNbEXDxcuQjP7yYp9Sj9Y0Xvd0dV7 ISNQJs+eOO5yntk12vMqfkDwxBHkPWofEZuGk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704320014; x=1704924814; 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=A4/PvEmfC1z/MFdCWAoTOu1RfsCjERvbzT8zf8McZobFs5IU2KiWc9MziBHVceFiwu /llmkN/GraDtCWenPHqcK0U+lY8XqTtFY5yJCj0CwWtFgzlCr6WRM/SzLkxMP0c+kEAD 6IpdyJVBFTN3qwBzXwqA1cXeyEKNEgghIuvK3eMSmBN7Wl3ir0G7r371Z9mVR+asI9UU ssS/R+qfwI2MuQfr79AfW31rog9q8owW53dYL5SXjlzzm8dG5el2LGCAQoEVOSn9BlZH Zc0zOowciPq4snqUhbMgcwSUKJvC/EQOsvr9TQrdsd6SqkKWyWNO/TDGaHtRNHOz+BSB 44Fw== X-Gm-Message-State: AOJu0YyTk007W2wYhO1+Ea5WxJ8zRkHrC3xjJjCyawj20xw7y5Kchbg9 aqOLgKOgPj+r+NeD/P47J6nfCxDHzp0IamXUJ8uhlK+o25MrlH+9IziBog== X-Google-Smtp-Source: AGHT+IEkW8/Wym/lTkude1E/X0+YEx8EQlhJ0/vR/KFKxoAWqo9YCRX+q3xUQhEGpTjWCgSwUqa6QgucrFL6 X-Received: by 2002:a25:d855:0:b0:dbe:9f7e:f4ed with SMTP id p82-20020a25d855000000b00dbe9f7ef4edmr1342808ybg.18.1704320014345; Wed, 03 Jan 2024 14:13:34 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id g67-20020a25db46000000b00dbd5cffc3a2sm1681911ybf.16.2024.01.03.14.13.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:13:34 -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 A4DF9605C311; Wed, 3 Jan 2024 17:13:33 -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 v5 6/7] dts: add scatter to the yaml schema Date: Wed, 3 Jan 2024 17:12:16 -0500 Message-ID: <20240103221217.18954-7-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103221217.18954-1-jspewock@iol.unh.edu> References: <20231218181221.10057-1-jspewock@iol.unh.edu> <20240103221217.18954-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 3 22:12:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135713 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 91F224380D; Wed, 3 Jan 2024 23:14:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8AD1640697; Wed, 3 Jan 2024 23:13:39 +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 E945540696 for ; Wed, 3 Jan 2024 23:13:37 +0100 (CET) Received: by mail-yw1-f225.google.com with SMTP id 00721157ae682-5e7f0bf46a2so91318617b3.1 for ; Wed, 03 Jan 2024 14:13:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704320017; x=1704924817; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Q5hIIqy0MYvz31xGZ5AlKUZs/DM14pxsBt7Gqcmbhto=; b=PF8MAd/sGH65G3juXwDjSsgz9lCxzPdDHhSXUDTOnRh25bQKTSgiPENlMdgouFkDWV gZA3LqzB4UwR8XhC5OdSbwevR0epnB1G7hebaiNsXNRAOJ9jR9NqJhPDHQ2+ow+2nNHo 2qtV842XEro91Yq7jd9Uag0COEvEc5bOKE9W0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704320017; x=1704924817; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q5hIIqy0MYvz31xGZ5AlKUZs/DM14pxsBt7Gqcmbhto=; b=G+8Mc9P2V4NXRrliq5Psz9u4DUnHErgCb9H5LtStGtL2TnA/DT5SJhnbx1MD8rxEq0 V1x5lxpbS4lP1AabkUc20EeZc79v7vKc4PppoM9VjVEpln8ca3F8yKqkZMn8RaseSOhc YbojmstMZyiDKdbb7rpwSiW5b+Zwd2Pm69JN6Pg2OYJK/BLC3LtdXunCOkm8P/iZ46AS KqHeo1OKD6qpmGadCdFtADDk9dW/2vYAAo7QjkWuJhzzHtqxkBrnvfmo/LHA+gOKF2vr Bzob569eI0GfqsMn81Ee3IFJjB1GAv2VJwZZXtWeHPFtRyWRvXE5awtGJBZO1vc/M3hX 1bJQ== X-Gm-Message-State: AOJu0Yz6jG6LwLQaqFXh7bxtUFC2jcQGkC6K5HHCpuyS2NPvoHqE0k/q Y3uNJAPz2kWLiLEcnOejcJBYw4btvo4hmaax0A15RKORF+398JsLEEBUcilXYykEV+Y3aGiEgQ= = X-Google-Smtp-Source: AGHT+IENzwFkO9Cg5TBFlP52B2tKu69onwefnnugA+QEAbCileEHHZzTOdIRjqaTaU3sDBAqWLOshaGihgdn X-Received: by 2002:a05:690c:2911:b0:5ea:ba6d:b2e9 with SMTP id eg17-20020a05690c291100b005eaba6db2e9mr9005582ywb.18.1704320017338; Wed, 03 Jan 2024 14:13:37 -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 g134-20020a81528c000000b005f14aef74b6sm590546ywb.40.2024.01.03.14.13.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:13:37 -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 AA4F0605C311; Wed, 3 Jan 2024 17:13:36 -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 v5 7/7] dts: add pmd_buffer_scatter test suite Date: Wed, 3 Jan 2024 17:12:17 -0500 Message-ID: <20240103221217.18954-8-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103221217.18954-1-jspewock@iol.unh.edu> References: <20231218181221.10057-1-jspewock@iol.unh.edu> <20240103221217.18954-1-jspewock@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock This test suite provides testing of the support of scattered packets by Poll Mode Drivers using testpmd, verifying the ability to receive and transmit scattered multi-segment packets made up of multiple non-contiguous memory buffers. This is tested through 5 different cases in which the length of the packets sent are less than the mbuf size, equal to the mbuf size, and 1, 4, and 5 bytes greater than the mbuf size in order to show both the CRC and the packet data are capable of existing in the first, second, or both buffers. Naturally, if the PMD is capable of forwarding scattered packets which it receives as input, this shows it is capable of both receiving and transmitting scattered packets. Signed-off-by: Jeremy Spewock --- dts/tests/TestSuite_pmd_buffer_scatter.py | 126 ++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 dts/tests/TestSuite_pmd_buffer_scatter.py diff --git a/dts/tests/TestSuite_pmd_buffer_scatter.py b/dts/tests/TestSuite_pmd_buffer_scatter.py new file mode 100644 index 0000000000..8838c3404f --- /dev/null +++ b/dts/tests/TestSuite_pmd_buffer_scatter.py @@ -0,0 +1,126 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2023-2024 University of New Hampshire + +"""Multi-segment packet scattering testing suite. + +This testing suite tests the support of transmitting and receiving scattered packets. This is shown +by the Poll Mode Driver being able to forward scattered multi-segment packets composed of multiple +non-contiguous memory buffers. To ensure the receipt of scattered packets, the DMA rings of the +port's RX queues must be configured with mbuf data buffers whose size is less than the maximum +length. + +If it is the case that the Poll Mode Driver can forward scattered packets which it receives, then +this suffices to show the Poll Mode Driver is capable of both receiving and transmitting scattered +packets. +""" +import struct + +from scapy.layers.inet import IP # type: ignore[import] +from scapy.layers.l2 import Ether # type: ignore[import] +from scapy.packet import Raw # type: ignore[import] +from scapy.utils import hexstr # type: ignore[import] + +from framework.remote_session.testpmd_shell import TestPmdForwardingModes, TestPmdShell +from framework.test_suite import TestSuite + + +class PmdBufferScatter(TestSuite): + """DPDK PMD packet scattering test suite. + + Configure the Rx queues to have mbuf data buffers whose sizes are smaller than the maximum + packet size. Specifically, set mbuf data buffers to have a size of 2048 to fit a full 1512-byte + (CRC included) ethernet frame in a mono-segment packet. The testing of scattered packets is + done by sending a packet whose length is greater than the size of the configured size of mbuf + data buffers. There are a total of 5 packets sent within test cases which have lengths less + than, equal to, and greater than the mbuf size. There are multiple packets sent with lengths + greater than the mbuf size in order to test cases such as: + + 1. A single byte of the CRC being in a second buffer while the remaining 3 bytes are stored in + the first buffer alongside packet data. + 2. The entire CRC being stored in a second buffer while all of the packet data is stored in the + first. + 3. Most of the packet data being stored in the first buffer and a single byte of packet data + stored in a second buffer alongside the CRC. + """ + + def set_up_suite(self) -> None: + """Set up the test suite. + + Setup: + Verify they we have at least 2 port links in the current execution and increase the MTU + of both ports on the tg_node to 9000 to support larger packet sizes. + """ + self.verify( + len(self._port_links) > 1, + "Must have at least two port links to run scatter", + ) + + self.tg_node.main_session.configure_port_mtu(9000, self._tg_port_egress) + self.tg_node.main_session.configure_port_mtu(9000, self._tg_port_ingress) + + def scatter_pktgen_send_packet(self, pktsize: int) -> str: + """Generate and send packet to the SUT. + + Functional test for scatter packets. + + Args: + pktsize: Size of the packet to generate and send. + """ + packet = Ether() / IP() / Raw() + packet.getlayer(2).load = "" + payload_len = pktsize - len(packet) - 4 + payload = ["58"] * payload_len + # pack the payload + for X_in_hex in payload: + packet.load += struct.pack("=B", int("%s%s" % (X_in_hex[0], X_in_hex[1]), 16)) + received_packets = self.send_packet_and_capture(packet) + self.verify(len(received_packets) > 0, "Did not receive any packets.") + load = hexstr(received_packets[0].getlayer(2), onlyhex=1) + + return load + + def pmd_scatter(self, mbsize: int) -> None: + """Testpmd support of receiving and sending scattered multi-segment packets. + + Support for scattered packets is shown by sending 5 packets of differing length + where the length of the packet is calculated by taking mbuf-size + an offset. The + offsets used in the test case are -1, 0, 1, 4, 5 respectively. + + Test: + Start testpmd and run functional test with preset mbsize. + """ + testpmd = self.sut_node.create_interactive_shell( + TestPmdShell, + app_parameters=( + "--mbcache=200 " + f"--mbuf-size={mbsize} " + "--max-pkt-len=9000 " + "--port-topology=paired " + "--tx-offloads=0x00008000" + ), + privileged=True, + ) + testpmd.set_forward_mode(TestPmdForwardingModes.mac) + testpmd.start() + + for offset in [-1, 0, 1, 4, 5]: + recv_payload = self.scatter_pktgen_send_packet(mbsize + offset) + self._logger.debug(f"Payload of scattered packet after forwarding: \n{recv_payload}") + self.verify( + ("58 " * 8).strip() in recv_payload, + f"Payload of scattered packet did not match expected payload with offset {offset}.", + ) + testpmd.stop() + + def test_scatter_mbuf_2048(self) -> None: + """Run :func:`~PmdBufferScatter.pmd_scatter` function with `mbsize` set to 2048.""" + self.pmd_scatter(mbsize=2048) + + def tear_down_suite(self) -> None: + """Tear down the test suite. + + Teardown: + Set the MTU of the tg_node back to a more standard size of 1500 + """ + self.tg_node.main_session.configure_port_mtu(1500, self._tg_port_egress) + self.tg_node.main_session.configure_port_mtu(1500, self._tg_port_ingress)