From patchwork Thu Nov 9 23:20:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134048 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 EEFFA432EC; Fri, 10 Nov 2023 00:23:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E068B41151; Fri, 10 Nov 2023 00:23:20 +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 CD8B241148 for ; Fri, 10 Nov 2023 00:23:19 +0100 (CET) Received: by mail-qt1-f226.google.com with SMTP id d75a77b69052e-41cba6e8e65so8631321cf.2 for ; Thu, 09 Nov 2023 15:23:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699572199; x=1700176999; 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=V9JnIUsiEIpjeKizpH2WPgqtoQmIxJuwO3RW6x/6msw=; b=cp11F5W29NuYipHPiVslARYxQUEhKVM+8VKIsAyu2Gc0+mIBRTq6MYXtheJij8V+s0 OtYWHbrH5qq+anDn8b4XQvf2GctcVZ+PcwPC68pRMXvWO00ZRLgshkOP1GqBQ2w4UyAW q+XcWz415xu3lgdk2ufah9BRPQcHYb8/9FmPg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699572199; x=1700176999; 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=V9JnIUsiEIpjeKizpH2WPgqtoQmIxJuwO3RW6x/6msw=; b=o61yh8OJ8geIGKwA7wq0uIzOCfXv0l3eT3uPa70zO/4JuRCemesJalZWySAiUH1Gi7 VhEJo2qUczfod1I+AiETFGd0Gt5MqpzPRlRWZi6Zd6OjWF4IUFnJ/eEe8VsT2DvscDdf oNSZ8kEfkj0A3cFkZBTTgMVNVSEMo3XP/arebijCbhrzYBcsHMGcWB2hxJUAhfxeribj JAvVC2Ap/GLCXWGPrJTLtzDi/RzBw9RgMYOjtV4Y1mxboMpp3Kf6WqJO9Cm6oABxeoJC TWulEYtd/HNX0uik+ZH0yoamRKPsU7h0HraibXj21gsTNqkk7eQwDLTW49GksMaFglv9 yN9w== X-Gm-Message-State: AOJu0YxdwJLjN6P6Ym3XFuAUFyOKxAxy6XkpN1SFirBcn5tWiMuD2lem 6M0Tb/CasNEdqr75QsI0VS3QHkDE749Ux1mOxBj+da8g2C4TdA== X-Google-Smtp-Source: AGHT+IGHVBUYI/YN6jcANw9CWvJ89ViENZxTL+9//tscLJWzPDe5fd2AbCmzGOwMWlwL/eLgyy71K5mdFiD0 X-Received: by 2002:ac8:7dc4:0:b0:418:152d:bf4 with SMTP id c4-20020ac87dc4000000b00418152d0bf4mr6608424qte.51.1699572199163; Thu, 09 Nov 2023 15:23:19 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id v19-20020a05622a189300b004199171a914sm688094qtc.2.2023.11.09.15.23.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:23:19 -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 BB954605C318; Thu, 9 Nov 2023 18:23:18 -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 v2 1/7] dts: Add scatter test suite Date: Thu, 9 Nov 2023 18:20:11 -0500 Message-ID: <20231109232223.25644-3-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109232223.25644-2-jspewock@iol.unh.edu> References: <20231109232223.25644-2-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 | 86 ++++++++++++++++++++++++++++++++++ 1 file changed, 86 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..217f465e92 --- /dev/null +++ b/dts/tests/TestSuite_scatter.py @@ -0,0 +1,86 @@ +# 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) + ) + load = hexstr(packet.getlayer(2), onlyhex=1) + 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:20:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134049 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 A89A6432EC; Fri, 10 Nov 2023 00:23:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0B8C8427D8; Fri, 10 Nov 2023 00:23:24 +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 4355B427D8 for ; Fri, 10 Nov 2023 00:23:22 +0100 (CET) Received: by mail-yb1-f228.google.com with SMTP id 3f1490d57ef6-d9ace5370a0so1577354276.0 for ; Thu, 09 Nov 2023 15:23:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699572201; x=1700177001; 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=eCXertu5tCRG8W4+vGCgsgC1ZhS5tjdjMqggaj4SQxfqMwPy+RD8GDyxdHcP9xrK+h xOnHNGpOloiASEwCBDw+rhTNDj1oK8GnYKhyDLclSDCNC/x4nN5wUaYJHPsMvctD9lF3 Bq22r1G/uywIEdv4FUjxSLTRrLWSm4gWhsEYw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699572201; x=1700177001; 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=ctca60GAGqEawbXVuXWnBKczGEmeUYXTFTuNTGW6FebiyadEoVbQB2m61QyUYZ4w5H PBzIhrAEpu7S4QRSZr2GG4aco+Tn5gV+/XIsmvQltFVduAS4tOw5vJzlkXjcH7XRFCew YZnbdtcmZg11+cjSGGGFLfcLONQxIfg4yJOSiA9ZNeAqfWeJvpUeoNUN/u7v20DWmueg z3xxO5TV0eElhhuNRSavHmSwLAWnpMEmfls4fk5FbMLdbxnDDzZqKlwd9UvKpOH8qDKK l3/eAilUFtu2hnf8731Y2w+kaHxK87eZnHrVh/1+FnuBx/VQ5B8IM3MD2lsXiGUez6U2 31ww== X-Gm-Message-State: AOJu0Yzgm35POEnQMVSyQSXJGlZEA1EOSbN+CsBlfFsxrvN56lARUE/H svFvNeDkrc2NcokRsXIpQKZgw7WFFId3uWe6H6mtvVgFdV9ZMw== X-Google-Smtp-Source: AGHT+IFhDofiuV/cbvovHyKXARKbC8G8eeMpMoj/d8otmTwXuIX6lUqPRfatC5bce3oEO2EGb/2VzjIuscty X-Received: by 2002:a25:ab87:0:b0:da0:d018:b88b with SMTP id v7-20020a25ab87000000b00da0d018b88bmr6927406ybi.42.1699572201735; Thu, 09 Nov 2023 15:23:21 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id v98-20020a25abeb000000b00d9cb2d83caasm1113210ybi.2.2023.11.09.15.23.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:23:21 -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 4C661605C318; Thu, 9 Nov 2023 18:23:21 -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 v2 2/7] dts: add waiting for port up in testpmd Date: Thu, 9 Nov 2023 18:20:12 -0500 Message-ID: <20231109232223.25644-4-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109232223.25644-2-jspewock@iol.unh.edu> References: <20231109232223.25644-2-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:20:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134050 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 A42EA432EC; Fri, 10 Nov 2023 00:23:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E36B42D27; Fri, 10 Nov 2023 00:23:27 +0100 (CET) Received: from mail-pf1-f227.google.com (mail-pf1-f227.google.com [209.85.210.227]) by mails.dpdk.org (Postfix) with ESMTP id 39AC442C24 for ; Fri, 10 Nov 2023 00:23:26 +0100 (CET) Received: by mail-pf1-f227.google.com with SMTP id d2e1a72fcca58-6b44befac59so2013181b3a.0 for ; Thu, 09 Nov 2023 15:23:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699572205; x=1700177005; 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=XgBAAC1n/lnmkb0TFdmqXAcNLDQqJQqjqiiMikh8TcIXjypCB74fRlb9rOG9KRf2Mu GUQ61M2rYNWWUUpAXgFfrIDpJRn3V5x5FrGQNqLTXPeKKs0IqeoCou4VFU/UUCqxkWSs /qoR5XPqCepK+Hb83t3KN/QGwGGCY9pcRBzdM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699572205; x=1700177005; 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=FdySptowWDHRLnuoGAaZKieuAKRD+y//vSn+aeNClXajHnNt4XNfGBEq0EnkqRj56u P+3IyRNXlEtb0pweqN3aG4DXo3MCT31QHzqDPv1fVLODbXOmSZMCqUZBFbDFTvxXUIFu ZWPer/Az/X5jeSBzzfnTR1Dr70odScTy01ZZF6MND5XmvYCLwZUiednLUnEdb8Fv/taM 3spP84K1YfwVJRA8WjcT4Pg+Ac03u7v9pPz9poVwQqEZURkv64mWWT5UZmiqlefej17I d8xpBtCNVQfxqkIHJG6b4LK5jlgdmYkyldzFHTw9muWgIVidUmJ2YQqkh5J6eRsVLyl9 qv2g== X-Gm-Message-State: AOJu0Yx8vN6N1RC4MlgF0RUuBkB0kpd1dvk+t+YakPxQYzvvG+U5b+W4 iLyY/35Ywc2qpJplzcg0GORSAvQE7w85eDPlttTOKeoiOQT3pQ== X-Google-Smtp-Source: AGHT+IEFJ2qD5zvUvw4CG/eWnOmYcaI/LVd2HJC5Bc/jUvzD9ZFzGLfxoGvHjOSX96Y/K5RPFDiW1+MdVShT X-Received: by 2002:a05:6a20:4409:b0:13e:fb5e:b460 with SMTP id ce9-20020a056a20440900b0013efb5eb460mr1508975pzb.0.1699572205456; Thu, 09 Nov 2023 15:23:25 -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-20020a634920000000b005b64e8336dcsm928082pga.20.2023.11.09.15.23.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:23:25 -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 A090E605C318; Thu, 9 Nov 2023 18:23: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, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v2 3/7] dts: add scatter to the yaml schema Date: Thu, 9 Nov 2023 18:20:13 -0500 Message-ID: <20231109232223.25644-5-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109232223.25644-2-jspewock@iol.unh.edu> References: <20231109232223.25644-2-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:20:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134051 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 9A8EF432EC; Fri, 10 Nov 2023 00:23:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6186F42C24; Fri, 10 Nov 2023 00:23:32 +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 4F5AC42D0B for ; Fri, 10 Nov 2023 00:23:30 +0100 (CET) Received: by mail-il1-f228.google.com with SMTP id e9e14a558f8ab-3594c100735so3828075ab.1 for ; Thu, 09 Nov 2023 15:23:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699572209; x=1700177009; 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=Cxxp2MzcJEbKd2fbvi0OiiYqd26k/H7qtwv/bwIxUb+H6rGFvkhkkN3/H8raszMaOt NEYOLpp6dbq/WtbVkCiEUZazmNDMsxX4uI0n9SqEApiqB/PLnfEClvhg3b+Tx5vKlFxu 9JcUnKYeNuOepqmkf7o7l91vq4hPWnGcC1tm8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699572209; x=1700177009; 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=FtCEcL2dWQwb3iQ5x6l6rLrWC3dFcn06FJPzFrsPKK0iJUhYaF15aiLxJtPDjXN4rP azrRiSeDzdGJ9ZLcMkcpKm0gK4kL0RCYI+MjX/iVjtMkX5ckIctVtZnl3jszUhRBX4no ICznJU1DOWLoUQ7wVLB1V/SAeKL77D3X5jV5B4bx1AiREmWPvhTvV3ePTXqNsXFr29iU /QtZddnqj6Ct+1y8aV9VPPA/pA97IZFbEGE0PrIrqhcc6C016NdkbXu95ViBf8sww9Cx aN23A+zZx9kIor1oE0/1W5swkC+/LVPUfUhSRFuiRymEE4TfatyEj5K6e07+iJgTOCzH DIDQ== X-Gm-Message-State: AOJu0YxQNpLbqcsQWMKTO28/YFPRLxudBZFYs0FlyDkVHvbM1fcAFdL8 cdZcAkWgKGdu5YqShPg9HQudjeNdR0z+Y8B4Z7uFS/unR3XX1A== X-Google-Smtp-Source: AGHT+IEGrrU6sNkGojY/pkPgWFVyci8oklFL2VRhoiTcG8jFCrckpGnf8hCWkf0qTPDM0ImSGd9mkctHBE3r X-Received: by 2002:a92:c56a:0:b0:351:134d:ce3d with SMTP id b10-20020a92c56a000000b00351134dce3dmr875578ilj.7.1699572209763; Thu, 09 Nov 2023 15:23:29 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id q5-20020a056e0215c500b00359b544531csm953358ilu.51.2023.11.09.15.23.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:23:29 -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 392B0605C318; Thu, 9 Nov 2023 18:23: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, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v2 4/7] dts: allow passing parameters into interactive apps Date: Thu, 9 Nov 2023 18:20:14 -0500 Message-ID: <20231109232223.25644-6-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109232223.25644-2-jspewock@iol.unh.edu> References: <20231109232223.25644-2-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:20:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134052 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 12264432EC; Fri, 10 Nov 2023 00:23:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 83A7A42D7F; Fri, 10 Nov 2023 00:23:36 +0100 (CET) Received: from mail-yb1-f227.google.com (mail-yb1-f227.google.com [209.85.219.227]) by mails.dpdk.org (Postfix) with ESMTP id 8DA2542D78 for ; Fri, 10 Nov 2023 00:23:34 +0100 (CET) Received: by mail-yb1-f227.google.com with SMTP id 3f1490d57ef6-da2b9234a9fso1574634276.3 for ; Thu, 09 Nov 2023 15:23:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699572214; x=1700177014; 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=jts/N+FP1c7zzRqad+GRA5C2YA3IlTPil7SgRerDoEjJbN3lQ5WTO6/PGrdpPjo2T4 q9C+KDJaD6NQkv9NfUsBfzjM7cr7ckhpm3r78zQ7+BSi1EgJAieS+MQPQ8oHTrovd7xp EUoaW1VtCMH6ZzHzMWfAjAzx/N4NCRBipFL3g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699572214; x=1700177014; 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=gI0OTc26I/sLfeuqmFRA0rGWTLiE9pGCPMNol+c/+tW5pT6WzBbkR3kOtVoYmE5hyj dfoS5ldaa0q3Ur2UudKjMWZrxh8Yb3YrBI1qwnkbjF5TZa45YIyxw9/SnLAKT6wuxmBk BKZROlneH+DcTlmZeYU9lajs/Mz/Trgg+aVMlZHLX2ypAry4pJA6KO5V3uILdBdmiW6f sAHk3LqIB57xv0UocM84dT9X4Wc7B+qOhVtoJKxbSpVYO5Z+PGKMR98ZogPWj/bLDipG 1cEmE9JKM5ekLcKhVgkrGgWykaJ3m90lDerGbNkANt6YXd4QY7gTlR5C8JFX+ouPQ/KE qOeg== X-Gm-Message-State: AOJu0YzKXjPK79b/hDSnWSLfr/qVqmo1qdNpBPEp8aOAAN0Fg4HnlbMU TaEPs/AkHEpC4d7zy9FoRCkvrYdFSZZqyzKd9bplaX3vAC0hyqTeIWTxJQAs9EzgUw== X-Google-Smtp-Source: AGHT+IEvK071wNhSJZ5Y/Y9imaewne8KSM6YJYX+TNk5JiphN14MpCeCdSqGOyiVlAFwuGHZqTYCLkyw+Zu9 X-Received: by 2002:a25:6953:0:b0:da2:b499:f815 with SMTP id e80-20020a256953000000b00da2b499f815mr6968640ybc.30.1699572213995; Thu, 09 Nov 2023 15:23:33 -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 v98-20020a25abeb000000b00d9cb2d83caasm1113231ybi.2.2023.11.09.15.23.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:23:33 -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 98B8B605C318; Thu, 9 Nov 2023 18:23: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, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v2 5/7] dts: add optional packet filtering to scapy sniffer Date: Thu, 9 Nov 2023 18:20:15 -0500 Message-ID: <20231109232223.25644-7-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109232223.25644-2-jspewock@iol.unh.edu> References: <20231109232223.25644-2-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:20:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134053 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 2E4C8432EC; Fri, 10 Nov 2023 00:23:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1129342DA3; Fri, 10 Nov 2023 00:23:38 +0100 (CET) Received: from mail-oo1-f97.google.com (mail-oo1-f97.google.com [209.85.161.97]) by mails.dpdk.org (Postfix) with ESMTP id 96E1C42D80 for ; Fri, 10 Nov 2023 00:23:36 +0100 (CET) Received: by mail-oo1-f97.google.com with SMTP id 006d021491bc7-586ba7cdb6bso772827eaf.2 for ; Thu, 09 Nov 2023 15:23:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699572216; x=1700177016; 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=hds0TpN1heLswhLeg9y9+6xkrHMl3sxdIUrx8LQEmijm5qZmzkSU6kEYplC/6rnQ1x aHi3UdehbjF8WfnriPac/Exs2nYBXTvJxPLbhANaylGD5GttYhq8ococ/zduY1yuc9tl LE3HLgjN8KayY/QN7qWv5jeVkk6UCWff1Onng= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699572216; x=1700177016; 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=aBWu7Gkm4D3HYR0gTfhy1O5s3q2WkJfhC9/7Vxc6TlZJRWjxZ13QrSXwheuGseZuqc HvcM15ySM8KmONC1LW3nDCOlNSPudV2cqkq1g11qh9nxSFhCoZwRlrOlO55aSrvnJUiP OfprZt40PjfcHZDlZG8ChHJXGagP3+LB4vOoFzOmK8vju3th5RmsyqMBgJqwTMbfjc/h IPuwOxgf8RRBVzOZgsUVHlV6erBU4Q9PMZfbvZ6qdcTjXqO73ikw2F/mtQ1wHzXYpkaf UrSBkBQ69Fy6mj7XOEX4hwP2I9XuFkysWqfWmaAU9r0zjIxokE2Q8AltRSkjrmsDgCZ3 8LSw== X-Gm-Message-State: AOJu0YwXl4PL3Y1LhZB/FZL1qf5yDbhi8slZy+RlAJkMRV52qUFsKKmT Ch0xlG8JRS1QzRjR8KcUSPzAf3KQMb2wzsKkO7/qTRKnO1+nWw== X-Google-Smtp-Source: AGHT+IGvOUvtzfTBjPU3J2qXdYuX7c10zsTCqEYmzZXm0rs1qJKMFpyiOleAqWjNFY5O3F5IuQqejxRE2Qc2 X-Received: by 2002:a4a:345a:0:b0:57b:6f5c:c90a with SMTP id n26-20020a4a345a000000b0057b6f5cc90amr5827326oof.8.1699572215911; Thu, 09 Nov 2023 15:23:35 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id u35-20020a4a8c26000000b00589d9237faesm949431ooj.16.2023.11.09.15.23.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:23:35 -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 5861B605C318; Thu, 9 Nov 2023 18:23:35 -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 v2 6/7] dts: add pci addresses to EAL parameters Date: Thu, 9 Nov 2023 18:20:16 -0500 Message-ID: <20231109232223.25644-8-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109232223.25644-2-jspewock@iol.unh.edu> References: <20231109232223.25644-2-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:20:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134054 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 6D1A4432EC; Fri, 10 Nov 2023 00:23:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2834942D99; Fri, 10 Nov 2023 00:23:41 +0100 (CET) Received: from mail-io1-f100.google.com (mail-io1-f100.google.com [209.85.166.100]) by mails.dpdk.org (Postfix) with ESMTP id 0C8C242D99 for ; Fri, 10 Nov 2023 00:23:40 +0100 (CET) Received: by mail-io1-f100.google.com with SMTP id ca18e2360f4ac-7a683bd610dso50154439f.1 for ; Thu, 09 Nov 2023 15:23:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699572219; x=1700177019; 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=h78AS9DGvl4y8uGEBd/U8z6tEwhz/rsX5UItRZihLAVfdLe85SFvftajzvZHT43whP 0BT0LG1nB4W+rFDi32pbef2MFDS+7v/zI2xTQnMNjMHGwGzPr9Mi7nhJuTb5e1Liv9DY o3Rej8KgyZtotNdqB6y+Bw5o/wSOzPRKhWZSA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699572219; x=1700177019; 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=AVSqfPZXBi2MP/0T6SCtawbbvwfWq7gFNqzAt/eaKvCD+9TinkVfgeQ5MlQhFKtTxm XYR4vVDpmc8213/GR/i89NB2cscHLP75UOHrpkyBcHgAF5G3uAZbAvMwEQhMo8F2f0WH WV2V6Y+chzhn06BVKMC5gaWifXE1P03kzjyq2/Wauw+a/7ofldQtCkVv6VGOV/8bTP6z 4O2ZFjfvvuPv6TVF2dyuKibF083+9RsnbP1FxDg0vmhfTXBJkyPrWXN2j3fYMuGIU27d S89SL9vsA8sPoMOOBfICBd1eEwhry99t8HYkJMVCQM+fJ5N1pp1+C/jso7fHkCCWJB1Q tyKQ== X-Gm-Message-State: AOJu0YwJvpyj4CguvB9TUOhCKkMkhZzTzwV1EkKShQ3GUTdJWafAJTNv vbc/gjQzGXH6g4TR62t/nw8tLJD2eD08auaWkhSmMmlkQmxclN9C2LO+FTq8NAlEmg== X-Google-Smtp-Source: AGHT+IFZKZBv/da7jJ9OYfBtXIJ5FYpS9ycMW7UGLWSwlSWZatJXdAsPaP9HZiJ8F7hYLMnCuPaVGkHgQazl X-Received: by 2002:a5d:9b96:0:b0:79f:d04d:ce5a with SMTP id r22-20020a5d9b96000000b0079fd04dce5amr3428512iom.2.1699572219371; Thu, 09 Nov 2023 15:23:39 -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 a13-20020a029f8d000000b0045a47d447fdsm952719jam.30.2023.11.09.15.23.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2023 15:23:39 -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 CF96B605C318; Thu, 9 Nov 2023 18:23:38 -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 v2 7/7] dts: allow configuring MTU of ports Date: Thu, 9 Nov 2023 18:20:17 -0500 Message-ID: <20231109232223.25644-9-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231109232223.25644-2-jspewock@iol.unh.edu> References: <20231109232223.25644-2-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: """