From patchwork Thu Nov 9 23:07:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134039 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 B4312432EC; Fri, 10 Nov 2023 00:09:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E74CA40FDE; Fri, 10 Nov 2023 00:09:11 +0100 (CET) Received: from mail-io1-f97.google.com (mail-io1-f97.google.com [209.85.166.97]) by mails.dpdk.org (Postfix) with ESMTP id ADA7540156 for ; Fri, 10 Nov 2023 00:09:08 +0100 (CET) Received: by mail-io1-f97.google.com with SMTP id ca18e2360f4ac-7a66aa8ebb7so50997639f.3 for ; Thu, 09 Nov 2023 15:09:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699571348; x=1700176148; 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=XeGhsEWscqMfEmEUcxpZr6BRiyV0QtEgWJmNXiR6cMU=; b=Ft2pO+vIt5MoTqZzV68unaUZvqsZqCLH/ksKZGXSS1m/5NnV0Z9xATDeCekRlXuytW I7XgazRvndBBX08Cj7MPWlWEq7+ITW5OFaYeFdGpFKOQAe9cINBIowS7UEQt+hqILj3H W2oXGA7LijmJi3p7X/DhpvueHLbpFDstx+CHE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699571348; x=1700176148; 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=XeGhsEWscqMfEmEUcxpZr6BRiyV0QtEgWJmNXiR6cMU=; b=qcq40jcqPg2II8YbTGVKKgexIsb6SjYBCt8G73AX09bzaXNkKdJR50aHLgOjkiaqYM oW3wrdxhvYFttUmRy0jWmHm0P5JfNfIq6MIqbm/0LOl1BdhIn5MQUajdBWLQkCabgPa7 yV2YKu65X/EUGb9NFvGWXfM/a680QbUR7/PBHYGwKc3yTygxsrtaQ0RjQeC5aU2dTh2r 8WUeCc6oAgKs6nC26WCAdbr1OIW/gWXpXoQqgV2N/AA+T3tIUBF/7vojSoolPwioNNfJ 6qh4O63NDJkKr12ydabPJcPaHfBO5mOtNHfIgWXywN9lX420+Myf64IfGbEgL5ZB4kj1 KvMQ== X-Gm-Message-State: AOJu0Yw9U/LrWPnunr8lLniokfBSU7xhKDvk8UmiooDokS/9XgZB64i/ 0e1yJHiVIWm7SEQgaie8bGpqNnqLyst4TjNSHlaY0RamKqTwrpxZNsDxQtr1UHDeJg== X-Google-Smtp-Source: AGHT+IGqQfoPc9VmHCwNgGk942v/XurqBPlcvFSBlmfh3FRs/VGl5a9KDQLjyFSQ7ybVToSuk1WpSILZDOOQ X-Received: by 2002:a6b:f203:0:b0:7a9:7de6:7cbc with SMTP id q3-20020a6bf203000000b007a97de67cbcmr3444660ioh.18.1699571348011; Thu, 09 Nov 2023 15:09:08 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id e14-20020a056638020e00b0042b0c440bafsm926270jaq.70.2023.11.09.15.09.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:09:07 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1271:90f9:1b64:f6e6:867f]) by postal.iol.unh.edu (Postfix) with ESMTP id 6E43A605C319; Thu, 9 Nov 2023 18:09:07 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v1 1/7] dts: Add scatter test suite Date: Thu, 9 Nov 2023 18:07:31 -0500 Message-ID: <20231109230900.24572-2-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109230900.24572-1-jspewock@iol.unh.edu> References: <20231109230900.24572-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 the support of scattered packets by Poll Mode Drivers using testpmd. It incorporates 5 different test cases which test the sending and receiving of packets with lengths that are less than the mbuf data buffer size, the same as the mbuf data buffer size, and the mbuf data buffer size plus 1, 4, and 5. The goal of this test suite is to align with the existing dts test plan for scattered packets within DTS. Signed-off-by: Jeremy Spewock --- dts/tests/TestSuite_scatter.py | 85 ++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 dts/tests/TestSuite_scatter.py diff --git a/dts/tests/TestSuite_scatter.py b/dts/tests/TestSuite_scatter.py new file mode 100644 index 0000000000..0adaad1b2c --- /dev/null +++ b/dts/tests/TestSuite_scatter.py @@ -0,0 +1,85 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2023 University of New Hampshire + +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 import TestPmdShell +from framework.test_suite import TestSuite + + +class Scatter(TestSuite): + mbsize: int + + def set_up_suite(self) -> None: + self.verify( + len(self._port_links) > 1, + "Must have at least two port links to run scatter", + ) + if self._sut_port_egress.os_driver in ["i40e", "ixgbe", "ice"]: + self.mbsize = 2048 + else: + self.mbsize = 1024 + + 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 test_scatter_mbuf_2048(self) -> None: + """ + 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={self.mbsize} " + "--max-pkt-len=9000 " + "--port-topology=paired " + "--tx-offloads=0x00008000" + ), + privileged=True, + ) + testpmd.send_command("set fwd mac") + testpmd.send_command("start") + link_is_up = testpmd.wait_link_status_up(0) and testpmd.wait_link_status_up(1) + self.verify(link_is_up, "Links never came up in TestPMD.") + + for offset in [-1, 0, 1, 4, 5]: + recv_payload = self.scatter_pktgen_send_packet(self.mbsize + offset) + self.verify( + ("58 " * 8).strip() in recv_payload, + "Received packet had incorrect payload", + ) + testpmd.send_command("stop") + + def tear_down_suite(self) -> None: + 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) From patchwork Thu Nov 9 23:07:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134040 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 AA91B432EC; Fri, 10 Nov 2023 00:09:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1182F41148; Fri, 10 Nov 2023 00:09:13 +0100 (CET) Received: from mail-il1-f228.google.com (mail-il1-f228.google.com [209.85.166.228]) by mails.dpdk.org (Postfix) with ESMTP id 8EEF04064C for ; Fri, 10 Nov 2023 00:09:09 +0100 (CET) Received: by mail-il1-f228.google.com with SMTP id e9e14a558f8ab-3576e74ae9dso5708155ab.3 for ; Thu, 09 Nov 2023 15:09:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699571349; x=1700176149; 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=cBVZ6Ako4cf++sKNKESsCUqzqNGyv1mmpwPM3X84mWU=; b=SLRg0zmZ+w1lQS2RDF6Yf07kTEnGCM4ugxleVYLXrIfGyNPDMtvvr+1/xWtZQQvQBE EjNzomJ9kXajlMpsuVsjVJUvLfy7yyfPIeTaYRxGiekwauJOLcvg5gvDBKrZMaGwgH9R idP2slSb6u6Uq/wWazAFKGtSxXzjCJ+V4j17U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699571349; x=1700176149; 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=cBVZ6Ako4cf++sKNKESsCUqzqNGyv1mmpwPM3X84mWU=; b=fnHoadbyPamhSmvWAzlIAJJt/dA2SuzjXZZ337jCEvVzuC/HquZxzuppw3uQNh7dIL gq7/fU6/uFnu+pni/LuMJzrW9L1M4miMclet26vdN9meSyN6IE2NdC2C3t8EZIKhjP2k t2teOVsRRAqtVVvSDLBijIQuSCJ0wNQhKpcVH4RfiXONLaE6K3dl777Od9OR2K/O9vwp PNEiYRBQMkvjY/7iumeCxegdvqyZuAkqZJIchWqL/kVx2HZ0nsjNasecxAAfKQbjyZJ9 bLGzRccs7eQvIAtWADEK1vTUoCrMcraWO9ojny02Cva5m8/TalnofkmuecHtCnRDC5rg Da6A== X-Gm-Message-State: AOJu0Yz1BxdMUA2YX6td3Z0h4o/8gx3JLVffyIMjSNSORruE+D5mN4EB 8ngDiLxqNSU3wOJ4aUhkshf+y0lcugvXcMX8SEmSVnjKI5F6kUEJx0TsPikhvYADOw== X-Google-Smtp-Source: AGHT+IGjpasNGv99RA+9DRQK9KKSF5ILguB/wHi+Ayt3najQUJHBpPnb7NXuk9LDJj0Wl6EpHhkeq7odOKcU X-Received: by 2002:a92:cd89:0:b0:359:cbff:fc69 with SMTP id r9-20020a92cd89000000b00359cbfffc69mr6919256ilb.12.1699571348876; Thu, 09 Nov 2023 15:09:08 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id do6-20020a0566384c8600b0043a226a8838sm975756jab.35.2023.11.09.15.09.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:09:08 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1271:90f9:1b64:f6e6:867f]) by postal.iol.unh.edu (Postfix) with ESMTP id 38C50605C318; Thu, 9 Nov 2023 18:09:08 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v1 2/7] dts: add waiting for port up in testpmd Date: Thu, 9 Nov 2023 18:07:32 -0500 Message-ID: <20231109230900.24572-3-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109230900.24572-1-jspewock@iol.unh.edu> References: <20231109230900.24572-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 a method within the testpmd interactive shell that polls the status of ports and verifies that the link status on a given port is "up." Polling will continue until either the link comes up, or the timeout is reached. Signed-off-by: Jeremy Spewock --- .../remote_session/remote/testpmd_shell.py | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/dts/framework/remote_session/remote/testpmd_shell.py b/dts/framework/remote_session/remote/testpmd_shell.py index 1455b5a199..3ea16c7ab3 100644 --- a/dts/framework/remote_session/remote/testpmd_shell.py +++ b/dts/framework/remote_session/remote/testpmd_shell.py @@ -1,9 +1,12 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2023 University of New Hampshire +import time from pathlib import PurePath from typing import Callable +from framework.settings import SETTINGS + from .interactive_shell import InteractiveShell @@ -47,3 +50,29 @@ 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. + + Returns: + If the link came up in time or not. + """ + time_to_stop = time.time() + timeout + 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 close(self) -> None: + self.send_command("exit", "") + return super().close() From patchwork Thu Nov 9 23:07:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134041 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 76F57432EC; Fri, 10 Nov 2023 00:09:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 49C55415D7; Fri, 10 Nov 2023 00:09:14 +0100 (CET) Received: from mail-il1-f227.google.com (mail-il1-f227.google.com [209.85.166.227]) by mails.dpdk.org (Postfix) with ESMTP id E2B7340FDE for ; Fri, 10 Nov 2023 00:09:09 +0100 (CET) Received: by mail-il1-f227.google.com with SMTP id e9e14a558f8ab-359c1f42680so5321295ab.2 for ; Thu, 09 Nov 2023 15:09:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699571349; x=1700176149; 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=Y7kmpgPAi5x6o+R7z46Fu5d6uBY572eVSUGdn352WkI=; b=NtWt9H2x0SgQVeOyP0AbspJCxeKhN3fcPOdZ1APVwB1i+ttSbql/s1mSgnKUaeWm4R uLrVEC0749Rk0ujdDJEqrPQIp3Nwx1g0CBZiBY/r1A/V+C11T9chVXMw6xfkds4lCzNK KGS3pkkwfpCewlzgiw36K/qbWiQfqjbYiU1bo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699571349; x=1700176149; 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=Y7kmpgPAi5x6o+R7z46Fu5d6uBY572eVSUGdn352WkI=; b=caY2D55gs8lp81spcW3M9gTxzPCUrBWq0SSAq+MNYvalU7Nu6VVXRFd9Tv4LZrBgwz ulrweiXImwXVQpnUkAafxysHrt9XkKC7X8Dbvo0I2EDcqz4QSW49xSP7oGzv9E8RRAGZ 6r+1eT8emLKHZVjvZKH/B81xxcu1jgE5eo7aC0aIVm6FI5xLWfyxwehuAwMMG6x27Qgw VwgV4Tjc+H1nmBJDmqTQjLAGRc5V7XxPa2+OYYLX91q/m5k9jasVD5gpiG3laiUlf20X z78gnbVzXV1t/KeuVNCPo4N0yPagQmTkG/urNTE+6/ixjAuasDNt8yIEoD7hvu828M4C DUWg== X-Gm-Message-State: AOJu0Yx75hmQ5rxWq1TEliXA4pgy1GfIBsHR9cx9ZQYrF0rs++hye85e IxbAUmEXDr8EcFvv/QgfLH0SCGPATRwul3Xm5f/xfO6uSwv+8A== X-Google-Smtp-Source: AGHT+IEMXnY0/jov46UWvoBo0AK+h9ZXEk5TF8CeE2+fjbk7dMtoUylA58i0nH3B3X/0hdCpWPQjMBLf+SGy X-Received: by 2002:a05:6e02:1785:b0:359:d258:1b91 with SMTP id y5-20020a056e02178500b00359d2581b91mr4056946ilu.20.1699571349358; Thu, 09 Nov 2023 15:09:09 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id x5-20020a056e021bc500b00359b9ff2696sm912564ilv.48.2023.11.09.15.09.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:09:09 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1271:90f9:1b64:f6e6:867f]) by postal.iol.unh.edu (Postfix) with ESMTP id C5739605C319; Thu, 9 Nov 2023 18:09:08 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v1 3/7] dts: add scatter to the yaml schema Date: Thu, 9 Nov 2023 18:07:33 -0500 Message-ID: <20231109230900.24572-4-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109230900.24572-1-jspewock@iol.unh.edu> References: <20231109230900.24572-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 specificed 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..97ee32f47a 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", + "scatter" ] }, "test_target": { From patchwork Thu Nov 9 23:07:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134042 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 7A117432EC; Fri, 10 Nov 2023 00:09:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8FD53427D8; Fri, 10 Nov 2023 00:09:15 +0100 (CET) Received: from mail-pf1-f226.google.com (mail-pf1-f226.google.com [209.85.210.226]) by mails.dpdk.org (Postfix) with ESMTP id DAF974064C for ; Fri, 10 Nov 2023 00:09:10 +0100 (CET) Received: by mail-pf1-f226.google.com with SMTP id d2e1a72fcca58-6b77ab73c6fso1212812b3a.1 for ; Thu, 09 Nov 2023 15:09:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699571350; x=1700176150; 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=rxomyntegdrXYkBv8b690HuDHshTcpLqZU8Wlt/jce4=; b=HHJ7Ho4RTfIwCQL8y/XVqYNGh1bLMYNnir6xZ42Iic+D9tW2UoTubxruB0rP7jIsPP Ol0KMXSdUK/aomItj+Le7QmBdAKrNMA7McoYrfiuNgU5wDEu2nse63J8scWQtWizrqzo xQOxPtKHfRaMPyd5LhJlu11f49i7gA7Zkk6GQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699571350; x=1700176150; 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=rxomyntegdrXYkBv8b690HuDHshTcpLqZU8Wlt/jce4=; b=PuXkLN6GguL5zFAnuObhiWfRYI/iGxTblFkrrrShXYbEXo/vWGH6Wfcwns/F1x8JiR ynX/kRtiL+K/3OKYeaaZykG5ZBVi54LAgfdRTWng2bercReEa6/GLW2/QQYdx5tdNU+C i0iJKWMMTpQs1VKz1abyJ/U4WzJSCgDfxBHUXc+XW6xXGwHe/DPpyucoT/E0DBCCA/FW +Q3/hCoOrMGV0LyKg3ptGp7p/X/bL+wr5C2nggZfA4ZDo1hyxcMdpPih1294gqjWlgR6 6eBNPomGgCmm2opDOSZs3ej6Lvk+Ry8AUdjoErCNHvYdedd+S6bzPL0+D+NOqeRmvvz8 cdag== X-Gm-Message-State: AOJu0Yx/JVxEtiloQtydyXW02Lu6DIHzWPA9jJS/EShwXpt6P+SgA311 nSx80PHqEgF1JZLDWknVvoJT5WHdsJhBc9BEd0jCkJcs+rdTqA== X-Google-Smtp-Source: AGHT+IGKOniTesvfCvLs5YMds8+B91YwUsKLoF/PQzldzk3Tcbc2YHHUCawIprdHIVuWLamZjjOz4IixoiX4 X-Received: by 2002:a05:6a20:729a:b0:181:63e5:d500 with SMTP id o26-20020a056a20729a00b0018163e5d500mr1131316pzk.6.1699571350075; Thu, 09 Nov 2023 15:09:10 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id w32-20020a634920000000b005b64e8336dcsm927286pga.20.2023.11.09.15.09.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:09:10 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1271:90f9:1b64:f6e6:867f]) by postal.iol.unh.edu (Postfix) with ESMTP id 49F42605C318; Thu, 9 Nov 2023 18:09:09 -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, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v1 4/7] dts: allow passing parameters into interactive apps Date: Thu, 9 Nov 2023 18:07:34 -0500 Message-ID: <20231109230900.24572-5-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109230900.24572-1-jspewock@iol.unh.edu> References: <20231109230900.24572-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 Modified interactive applications to allow for the ability to pass parameters into the app on start up. Also modified the way EAL parameters are handled so that the trailing "--" separator is added be default after all EAL parameters. Signed-off-by: Jeremy Spewock --- dts/framework/remote_session/remote/testpmd_shell.py | 2 +- dts/framework/testbed_model/sut_node.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dts/framework/remote_session/remote/testpmd_shell.py b/dts/framework/remote_session/remote/testpmd_shell.py index 3ea16c7ab3..3f6a86aa35 100644 --- a/dts/framework/remote_session/remote/testpmd_shell.py +++ b/dts/framework/remote_session/remote/testpmd_shell.py @@ -32,7 +32,7 @@ def _start_application( self, get_privileged_command: Callable[[str], str] | None ) -> None: """See "_start_application" in InteractiveShell.""" - self._app_args += " -- -i" + self._app_args += " -i" super()._start_application(get_privileged_command) def get_devices(self) -> list[TestPmdDevice]: diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py index 4161d3a4d5..bcac939e72 100644 --- a/dts/framework/testbed_model/sut_node.py +++ b/dts/framework/testbed_model/sut_node.py @@ -377,7 +377,8 @@ def create_interactive_shell( shell_cls: Type[InteractiveShellType], timeout: float = SETTINGS.timeout, privileged: bool = False, - eal_parameters: EalParameters | str | None = None, + eal_parameters: EalParameters | str = "", + app_parameters: str = "", ) -> InteractiveShellType: """Factory method for creating a handler for an interactive session. @@ -392,12 +393,14 @@ 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 create_eal_parameters(). + app_parameters: Additional arguments to pass into the application on the + command-line. Returns: Instance of the desired interactive application. """ - if not eal_parameters: + if not eal_parameters and shell_cls.dpdk_app: eal_parameters = self.create_eal_parameters() - + eal_parameters = f"{eal_parameters} --" # We need to append the build directory for DPDK apps if shell_cls.dpdk_app: shell_cls.path = self.main_session.join_remote_path( @@ -405,7 +408,7 @@ def create_interactive_shell( ) return super().create_interactive_shell( - shell_cls, timeout, privileged, str(eal_parameters) + shell_cls, timeout, privileged, f"{eal_parameters} {app_parameters}" ) def bind_ports_to_driver(self, for_dpdk: bool = True) -> None: From patchwork Thu Nov 9 23:07:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134043 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 B57E7432EC; Fri, 10 Nov 2023 00:09:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 272F142D45; Fri, 10 Nov 2023 00:09:17 +0100 (CET) Received: from mail-io1-f98.google.com (mail-io1-f98.google.com [209.85.166.98]) by mails.dpdk.org (Postfix) with ESMTP id 5C80341151 for ; Fri, 10 Nov 2023 00:09:13 +0100 (CET) Received: by mail-io1-f98.google.com with SMTP id ca18e2360f4ac-7a66b5f7ea7so49279339f.2 for ; Thu, 09 Nov 2023 15:09:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699571353; x=1700176153; 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=hdJVf3ypWMnb9Qt4IiEySc5/AHylOmI4+9ZLJPRV+8A=; b=Pr8ICD2Cf6yEMGi58XdgwOCX+go6+h1qNWSbYN0c11OipuHurvPIyJjwCmvJabi9rq mdodzjZ8KKSGZfRdqegwva0UQfELx/9pQY1XuS0Nx36ZYwbeADQlKsNdmTW0bNctjSNp q0kiSPfk6GMV5GN8Zr4SvjbnvrK9saj3EN0f8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699571353; x=1700176153; 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=hdJVf3ypWMnb9Qt4IiEySc5/AHylOmI4+9ZLJPRV+8A=; b=a2NHwYvJ7RBGxHfEi9AvGwA+OAh4xKBJD/loajGE64ZmEU3IQtdkSgy3mMgWo/1CIS FQ2bBd38M/ilQM2LL/kVm4ugFq+X8jneL2DBvJaTJoWdlMM8gyHjIiGJE3b8YSs+qnvN NFyrjKyA1qsAcMWVfRvmXb247mTWykbTChcPeNP70TfRMue4zDz+fcpgBIrGlcaHZn/W qyXRQH3jY6zeaFZCCHGhHqCgkf1O6/GfeD9siuqbPuqhrY0Joo2tHLAwWXcwqqWoCvI9 iPMjl9qQjOT0cTNSD9AvKYGHBTnJNDbHyzEoxyELSZcqSuU/U/+jtBKSlqhQNRtsMBKC LyUw== X-Gm-Message-State: AOJu0YyGjXmXCQDLiQUthy9zWPgxGKUmmjg32gprwyKvihFxgwvwvlux D9KNVon+hn+HW9TatS7pw95c/ixvSssE1/Sa+zXBGuzymyrJlw== X-Google-Smtp-Source: AGHT+IHPvOfc3+Pvfe1lDWVNwCtQBk0WeCJHJiD1ZkVmQ7Dia+bocvneQltyCdY7H1BX1mpspdBi/5Hed4SY X-Received: by 2002:a5d:87d3:0:b0:7a5:a391:73ae with SMTP id q19-20020a5d87d3000000b007a5a39173aemr3224346ios.17.1699571352784; Thu, 09 Nov 2023 15:09:12 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id h18-20020a0566380f1200b0042b1630fb93sm928422jas.55.2023.11.09.15.09.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:09:12 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1271:90f9:1b64:f6e6:867f]) by postal.iol.unh.edu (Postfix) with ESMTP id 3E03B605C318; Thu, 9 Nov 2023 18:09:12 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v1 5/7] dts: add optional packet filtering to scapy sniffer Date: Thu, 9 Nov 2023 18:07:35 -0500 Message-ID: <20231109230900.24572-6-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109230900.24572-1-jspewock@iol.unh.edu> References: <20231109230900.24572-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 | 13 +++++++++++-- .../testbed_model/capturing_traffic_generator.py | 12 +++++++++++- dts/framework/testbed_model/scapy.py | 11 ++++++++++- dts/framework/testbed_model/tg_node.py | 4 +++- 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py index 3b890c0451..3222f172f3 100644 --- a/dts/framework/test_suite.py +++ b/dts/framework/test_suite.py @@ -152,7 +152,11 @@ 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 + self, + packet: Packet, + duration: float = 1, + no_lldp: bool = True, + no_arp: bool = True, ) -> list[Packet]: """ Send a packet through the appropriate interface and @@ -162,7 +166,12 @@ def send_packet_and_capture( """ 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, + duration, + no_lldp, + no_arp, ) def get_expected_packet(self, packet: Packet) -> Packet: diff --git a/dts/framework/testbed_model/capturing_traffic_generator.py b/dts/framework/testbed_model/capturing_traffic_generator.py index ab98987f8e..0a0d0f7d0d 100644 --- a/dts/framework/testbed_model/capturing_traffic_generator.py +++ b/dts/framework/testbed_model/capturing_traffic_generator.py @@ -52,6 +52,8 @@ def send_packet_and_capture( send_port: Port, receive_port: Port, duration: float, + no_lldp: bool, + no_arp: bool, capture_name: str = _get_default_capture_name(), ) -> list[Packet]: """Send a packet, return received traffic. @@ -71,7 +73,7 @@ def send_packet_and_capture( A list of 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, duration, no_lldp, no_arp, capture_name ) def send_packets_and_capture( @@ -80,6 +82,8 @@ def send_packets_and_capture( send_port: Port, receive_port: Port, duration: float, + no_lldp: bool, + no_arp: bool, capture_name: str = _get_default_capture_name(), ) -> list[Packet]: """Send packets, return received traffic. @@ -93,6 +97,8 @@ def send_packets_and_capture( send_port: The egress port on the TG node. receive_port: The ingress port in the TG node. duration: Capture traffic for this amount of time after sending the packets. + no_lldp: Option to disable capturing LLDP packets + no_arp: Option to disable capturing ARP packets capture_name: The name of the .pcap file where to store the capture. Returns: @@ -108,6 +114,8 @@ def send_packets_and_capture( send_port, receive_port, duration, + no_lldp, + no_arp, ) self._logger.debug( @@ -123,6 +131,8 @@ def _send_packets_and_capture( send_port: Port, receive_port: Port, duration: float, + no_lldp: bool, + no_arp: bool, ) -> list[Packet]: """ The extended classes must implement this method which diff --git a/dts/framework/testbed_model/scapy.py b/dts/framework/testbed_model/scapy.py index af0d4dbb25..58f01af21a 100644 --- a/dts/framework/testbed_model/scapy.py +++ b/dts/framework/testbed_model/scapy.py @@ -69,6 +69,7 @@ def scapy_send_packets_and_capture( send_iface: str, recv_iface: str, duration: float, + sniff_filter: str, ) -> list[bytes]: """RPC function to send and capture packets. @@ -90,6 +91,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) @@ -264,10 +266,16 @@ def _send_packets_and_capture( send_port: Port, receive_port: Port, duration: float, + no_lldp: bool, + no_arp: bool, capture_name: str = _get_default_capture_name(), ) -> list[Packet]: binary_packets = [packet.build() for packet in packets] - + sniff_filter = [] + if no_lldp: + sniff_filter.append("ether[12:2] != 0x88cc") + if no_arp: + sniff_filter.append("ether[12:2] != 0x0806") xmlrpc_packets: list[ xmlrpc.client.Binary ] = self.rpc_server_proxy.scapy_send_packets_and_capture( @@ -275,6 +283,7 @@ def _send_packets_and_capture( send_port.logical_name, receive_port.logical_name, duration, + " && ".join(sniff_filter), ) # type: ignore[assignment] scapy_packets = [Ether(packet.data) for packet in xmlrpc_packets] diff --git a/dts/framework/testbed_model/tg_node.py b/dts/framework/testbed_model/tg_node.py index 27025cfa31..98e55b7831 100644 --- a/dts/framework/testbed_model/tg_node.py +++ b/dts/framework/testbed_model/tg_node.py @@ -56,6 +56,8 @@ def send_packet_and_capture( send_port: Port, receive_port: Port, duration: float = 1, + no_lldp: bool = True, + no_arp: bool = True, ) -> list[Packet]: """Send a packet, return received traffic. @@ -73,7 +75,7 @@ def send_packet_and_capture( 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, duration, no_lldp, no_arp ) def close(self) -> None: From patchwork Thu Nov 9 23:07:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134044 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 6469F432EC; Fri, 10 Nov 2023 00:09:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 52BB842D78; Fri, 10 Nov 2023 00:09:18 +0100 (CET) Received: from mail-oo1-f98.google.com (mail-oo1-f98.google.com [209.85.161.98]) by mails.dpdk.org (Postfix) with ESMTP id 174824064C for ; Fri, 10 Nov 2023 00:09:14 +0100 (CET) Received: by mail-oo1-f98.google.com with SMTP id 006d021491bc7-586beb5e6a7so783908eaf.1 for ; Thu, 09 Nov 2023 15:09:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699571353; x=1700176153; 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=vLcl12vn/athpjwBAY93JaVraLcW7MeDYir8SwBTE4k=; b=dvoA2znI/TT1Mv43uxQz8ZJP7TgwLgsqVudGoL/L3rrS1JI71KM3sMFqKLeRYfjBm/ xnM12qSVnXkUcSPPhyrfYnA3Tz+ATP2KZHPKzjPb5XfbC+7+E0xvpldtW3OdHlIUxCCG uTfBG4QwvetrCEc6/u/rIT9pzFVyL/5cT1aCM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699571353; x=1700176153; 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=vLcl12vn/athpjwBAY93JaVraLcW7MeDYir8SwBTE4k=; b=eBy/Cs/LQBlL2GdFkIoIl+9zcihifm2S3oi+Q1YbQFqaiHKZDhjVFhxZDt94xyNcNf VBa6nWtmYkh+K6mJsQ75Kgc5aqrc9Bh6J29Fi3htbF92pVf1R0gaAE/qTcHEnRBcm3CS R/lqWxbzurHrwVjMJbC0eV+zcURyP2DGs4rmgWG7d9QtAqbaOMLf0nOZEE98GOgAXHdJ 0C9djhGZcIScGzHo25/Mazpdhu/qMcGFJpt3b80CfbNONUCReqVCvmyrNPI6qtCoVrtB 9308dAORkh6QSGvDXMaNWJXDDg6Zgo21uvAsPay242AEgskWYcwcq9FCVX3jGT1sLXWV dbIw== X-Gm-Message-State: AOJu0YzPgSeL0X3k7Y0Sf7O6NowLE5dZ9iSj1iFwlnAfW0hZ4zu9OvYm 10uUX3tlDKFilEOmhdM9bHBm3gjpFWLVWCamYEKnftwEZ8TItQ== X-Google-Smtp-Source: AGHT+IHRgPWYRI/gZdp6tb8WhfzEsTReXExEBGGD9IIEhyn1b3/H1HgqB+quNK3GM2I12sE1WpipbboHgd5l X-Received: by 2002:a05:6870:9691:b0:1f4:a122:6b02 with SMTP id o17-20020a056870969100b001f4a1226b02mr1402745oaq.45.1699571353401; Thu, 09 Nov 2023 15:09:13 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id 1-20020a05687012c100b001dc2d6ad88csm1372021oam.20.2023.11.09.15.09.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:09:13 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1271:90f9:1b64:f6e6:867f]) by postal.iol.unh.edu (Postfix) with ESMTP id AEEF0605C319; Thu, 9 Nov 2023 18:09:12 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v1 6/7] dts: add pci addresses to EAL parameters Date: Thu, 9 Nov 2023 18:07:36 -0500 Message-ID: <20231109230900.24572-7-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109230900.24572-1-jspewock@iol.unh.edu> References: <20231109230900.24572-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 relevent PCI devices are considered when launching DPDK applications. Signed-off-by: Jeremy Spewock --- dts/framework/testbed_model/sut_node.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py index bcac939e72..f9c7bd9bf3 100644 --- a/dts/framework/testbed_model/sut_node.py +++ b/dts/framework/testbed_model/sut_node.py @@ -20,6 +20,7 @@ from framework.utils import MesonArgs from .hw import LogicalCoreCount, LogicalCoreList, VirtualDevice +from .hw.port import Port from .node import Node @@ -31,6 +32,7 @@ def __init__( prefix: str, no_pci: bool, vdevs: list[VirtualDevice], + ports: list[Port], other_eal_param: str, ): """ @@ -56,6 +58,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: @@ -65,6 +68,7 @@ def __str__(self) -> str: f"{self._prefix} " f"{self._no_pci} " f"{self._vdevs} " + f"{self._ports} " f"{self._other_eal_param}" ) @@ -308,6 +312,7 @@ def create_eal_parameters( append_prefix_timestamp: bool = True, no_pci: bool = False, vdevs: list[VirtualDevice] = None, + ports: list[Port] | None = None, other_eal_param: str = "", ) -> "EalParameters": """ @@ -350,12 +355,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 Thu Nov 9 23:07:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134045 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 76812432EC; Fri, 10 Nov 2023 00:09:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 76C2842D80; Fri, 10 Nov 2023 00:09:19 +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 466F441157 for ; Fri, 10 Nov 2023 00:09:14 +0100 (CET) Received: by mail-yw1-f228.google.com with SMTP id 00721157ae682-5a7dd65052aso17734127b3.0 for ; Thu, 09 Nov 2023 15:09:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699571353; x=1700176153; 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=6WZJatjom6fBc4Cl+Z/GP97YRbLXWZIxuBHF1O6ZbKw=; b=U9DIu+g2GBbNN6kfqH7yg2npkSgwS6T4mALEHDf0BzEpU4PpXkivDbCwYKpsgNNEIP f+JVn7GvwVonHE5RIYHXb72u4fOuHlgwP6rQQYgEs7/YhNYDdzVJTrhFfXFZ+pkMrmit v6AF2r0DGOCX1oCxcxD4DErHScQgX98Y+NlIA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699571353; x=1700176153; 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=6WZJatjom6fBc4Cl+Z/GP97YRbLXWZIxuBHF1O6ZbKw=; b=RUHBjVL/b6PPlTFhfOKjsospFH1Ej+l2SzT8RVIj5hVH/X80AobC8Xg/DrPXwk2Wqc H9fdQz8QdTpSmUtcN5MLgXWl4EKTVCr6HxhAdWo6R9Bi7JAd5bktGU6zlj6/q+qfwNuW 7Fk2zLrpU4S5P/oLPa+pv5fnwXkdKVFknn0Nz7kNb8VWP6oSAwOJ/bs6FIj55BBNcWiJ nVbShg7E4P5NCJu2mGKB9m+TuXIy+guoCQ4cQtbunSAjc1W23BQlNim2nVo1LObp0MP8 BMff17N6iD4rHBMD5q+Ow6MHkoii63LBbl0cE5URvh/XRSzaJNC+or5vugKGMjqgpJaH tVmw== X-Gm-Message-State: AOJu0YyKOQIdlC3eM4H277X2JK06wYTqculoTBDyIGjaiGPcCphmqi82 ubMNpMw/AIfw9T/WdQdXdfTGpNRa9qXJNNkcTeOM6t5Zru8Jhw== X-Google-Smtp-Source: AGHT+IEJnlXmSH/96RowEBIMuQ7sdXUTnjCIHYk+H0OjA6KtwBptZqtVT01PfLlyenIm8Il62cylO46CrdPu X-Received: by 2002:a0d:e543:0:b0:5a7:bd2b:d4ec with SMTP id o64-20020a0de543000000b005a7bd2bd4ecmr6617416ywe.3.1699571353696; Thu, 09 Nov 2023 15:09:13 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id j5-20020a816e05000000b005a89809c0a3sm1863723ywc.25.2023.11.09.15.09.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:09:13 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1271:90f9:1b64:f6e6:867f]) by postal.iol.unh.edu (Postfix) with ESMTP id 2B33C605C318; Thu, 9 Nov 2023 18:09:13 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v1 7/7] dts: allow configuring MTU of ports Date: Thu, 9 Nov 2023 18:07:37 -0500 Message-ID: <20231109230900.24572-8-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109230900.24572-1-jspewock@iol.unh.edu> References: <20231109230900.24572-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 in an OS agnostic way. Signed-off-by: Jeremy Spewock --- dts/framework/remote_session/linux_session.py | 7 +++++++ dts/framework/remote_session/os_session.py | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/dts/framework/remote_session/linux_session.py b/dts/framework/remote_session/linux_session.py index a3f1a6bf3b..dab68d41b1 100644 --- a/dts/framework/remote_session/linux_session.py +++ b/dts/framework/remote_session/linux_session.py @@ -196,6 +196,13 @@ def configure_port_ip_address( verify=True, ) + def configure_port_mtu(self, mtu: int, port: Port) -> None: + 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: state = 1 if enable else 0 self.send_command(f"sysctl -w net.ipv4.ip_forward={state}", privileged=True) diff --git a/dts/framework/remote_session/os_session.py b/dts/framework/remote_session/os_session.py index 8a709eac1c..c038f78b79 100644 --- a/dts/framework/remote_session/os_session.py +++ b/dts/framework/remote_session/os_session.py @@ -277,6 +277,15 @@ def configure_port_ip_address( Configure (add or delete) an IP address of the input port. """ + @abstractmethod + def configure_port_mtu(self, mtu: int, port: Port) -> None: + """Configure MTU on a given port. + + Args: + mtu: Desired MTU value. + port: Port to set the MTU on. + """ + @abstractmethod def configure_ipv4_forwarding(self, enable: bool) -> None: """