From patchwork Mon Nov 13 20:28:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134178 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 42CF74331E; Mon, 13 Nov 2023 21:28:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14E98402CF; Mon, 13 Nov 2023 21:28:52 +0100 (CET) Received: from mail-wm1-f97.google.com (mail-wm1-f97.google.com [209.85.128.97]) by mails.dpdk.org (Postfix) with ESMTP id ECF7A4026F for ; Mon, 13 Nov 2023 21:28:49 +0100 (CET) Received: by mail-wm1-f97.google.com with SMTP id 5b1f17b1804b1-40838915cecso39614405e9.2 for ; Mon, 13 Nov 2023 12:28:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699907329; x=1700512129; 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=Ice+N/gBOHJ/jxX3IZpsj33PFi2gR6zJ66n9WWMVhjLtMv64gFD9tYKVRsv0fNgrnE wXwybVu0ITfNTgXOq3gbs5aKkHxfJt5evGnIyQ3pqGo7go5dPrC+13yMPVuRDhKtaHCy /ulaIUzUZsqqiMr5oi4HcvFgvQWwzfs68BiCA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699907329; x=1700512129; 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=HIt2KfqhC0WAWORVzF93cJ500S6CnlIZCASk5rG5yfKYnbziWfT2BNUZ1aoL6/+jin euduHFwUpb1BBSsNFZHCeeRWcfL59W02Fr5oz1p7kf2aNYyPFsbm5lZfvphhLlRIqGym pK0DA0u+8WxgCrX978pcMEe99VK4tlY0aHd0MdCYEg9u6lboaXHyy7loAbML8gSYtXmv +mofH4+ms41Ms7WSCKf4lzM4aJUlXTbCJQy2c8+mkM7KQwpWdW2pveKBxGJUjROz8ora /dM4R7vPIPqXaP2FqJbovXc6CijM/9JEM4ll50mRKBexcZF/rqJfer4HOE2qc+W74Hjv 1y3Q== X-Gm-Message-State: AOJu0YxcRn7AwsBH2UJQPc3pnN4PjyAky1ZBY2488BJ9Rne3aPczWsC7 E9se5ceF2GOA/7jahNOg5fBeOut5LocmzTXZO/msodQ85Mqong== X-Google-Smtp-Source: AGHT+IGS0ML5l1i0loxqs7UQ4TqC5N0yaiLQOmy4qMrYt+dE2dtiYwBlVk25qzLVnL7kINXxWMjWewPxqI7k X-Received: by 2002:a05:600c:4703:b0:408:febf:831f with SMTP id v3-20020a05600c470300b00408febf831fmr5455874wmo.28.1699907329659; Mon, 13 Nov 2023 12:28:49 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id i22-20020a05600c355600b00407effd761csm5658298wmq.11.2023.11.13.12.28.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2023 12:28:49 -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 58D3E605C345; Mon, 13 Nov 2023 15:28:48 -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 v3 1/7] dts: Add scatter test suite Date: Mon, 13 Nov 2023 15:28:06 -0500 Message-ID: <20231113202833.12900-2-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231113202833.12900-1-jspewock@iol.unh.edu> References: <20231113202833.12900-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 Acked-by: Patrick Robb --- 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 Mon Nov 13 20:28:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134179 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 883104331E; Mon, 13 Nov 2023 21:29:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 21486402E0; Mon, 13 Nov 2023 21:28:53 +0100 (CET) Received: from mail-wr1-f100.google.com (mail-wr1-f100.google.com [209.85.221.100]) by mails.dpdk.org (Postfix) with ESMTP id AB5B6402BD for ; Mon, 13 Nov 2023 21:28:50 +0100 (CET) Received: by mail-wr1-f100.google.com with SMTP id ffacd0b85a97d-32df66c691dso2831700f8f.3 for ; Mon, 13 Nov 2023 12:28:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699907330; x=1700512130; 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=i9UcQ8zx68Np+yX5IAMjcBubVznqIP5sHjuu9kfrsgIoiHJTbNbSRbW5qvfyWqiq/w s33bEaSdRyYxSFi2o5/1LZvXbUPvX7raHb6SYukugecIQB5KPIMuEWXV7p53wgC5lM1w ZejuIrZvHq1RtSaC/7m9Qgv17NfVGzrFVoTIU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699907330; x=1700512130; 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=g3RyW29boCUdRsSB/mZQK93tfZ0YO/7CFObDs20F6Zmli4Gw8bA8XUg3yyTlsDkmM8 vjVvecG/7FF1Ami3ZfkR1TfNGxqQc5tTEPTecU3YfRhPeg4prTPi58EIGGmE7ORyEhwJ DhDPlGCej/y14cKo8F/wcjFmkyp7tviTlmYB1sYvJiiGd73gnWIo0iG9YEPC1WCIvH8W R2pDoK3n2ydAUm8gF2DTaMr0mQJGD/8m3wZ5gTegNCBkECySgzFLO7EQTKVvaA73VnWi j2PQ4h/hLr9huEerb4GzMrLMa0TflrB8clBD/CaGWKv1IqIMbGrt2tH5Vp3gPEfcHewh 9p2w== X-Gm-Message-State: AOJu0Yx46qsmUP3gHRIsQVebvoQz1e3mXOXwa+yF92F5yA9tX/EYdEAd 1nxvaKOQ6c0oJ112Ti95s0YKcFgTPagjiHc2bWXCrNuRhJGItg== X-Google-Smtp-Source: AGHT+IEa60Ta8d051AiOZH/JdcIGB5omEaDcmiD1AS/CkQEzImoH8D+dQgI6RFRUlaKVBDUWmqBj/Q8J55lk X-Received: by 2002:a5d:5445:0:b0:32d:8094:f4c8 with SMTP id w5-20020a5d5445000000b0032d8094f4c8mr5763595wrv.19.1699907330277; Mon, 13 Nov 2023 12:28:50 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id co12-20020a0560000a0c00b0033141c7f1a9sm779300wrb.103.2023.11.13.12.28.49 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2023 12:28:50 -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 2D8C0605C344; Mon, 13 Nov 2023 15:28:49 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v3 2/7] dts: add waiting for port up in testpmd Date: Mon, 13 Nov 2023 15:28:07 -0500 Message-ID: <20231113202833.12900-3-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231113202833.12900-1-jspewock@iol.unh.edu> References: <20231113202833.12900-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 Mon Nov 13 20:28:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134180 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 A45944331E; Mon, 13 Nov 2023 21:29:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A47B40608; Mon, 13 Nov 2023 21:28:54 +0100 (CET) Received: from mail-lj1-f226.google.com (mail-lj1-f226.google.com [209.85.208.226]) by mails.dpdk.org (Postfix) with ESMTP id 9D174402BD for ; Mon, 13 Nov 2023 21:28:51 +0100 (CET) Received: by mail-lj1-f226.google.com with SMTP id 38308e7fff4ca-2c83d37a492so27652351fa.3 for ; Mon, 13 Nov 2023 12:28:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699907331; x=1700512131; 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=ySA5jmMsq6dzap/sxpjwos08WGBtOo4h9uTv4MKizWU=; b=XPg+Z40A/7eR5q6nSsfFoiQFirTQ+4gpaASVVtR35WQF+8jhkhbyByT38mcOwCnOsG 2DUiqq0RbV4uioUg+gSznnHzHYl4Eq9AidFg4coVuRDkU18OhE835hPoQSSphd8mXPDk eukA9fTBCPbAWmNUL8TUbETlTEzfCcl1oD4Wg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699907331; x=1700512131; 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=ySA5jmMsq6dzap/sxpjwos08WGBtOo4h9uTv4MKizWU=; b=ldgFpCtkFmHATtKmzJhueZqtMtwhwlU4E1tUX4r76dhtW9mLG4Y+pf74kNV3CoaTAf jd06xuxOWEM8FlSTD7OUqrxgRyL6tmBm5xSlVvIuWwwp6qq/S6qJYww/oj/QGRXGZ1CJ K7Gq2v8vOVM6cf9qefTSeY5CnVqlCTGHTWNO0PWkOgAYgbUoinezilLvf+cLybmVHZHA fSAtaylUi80OuGffEj5vxM444f/AX4w5wPiiK/0CNz8R2i9+TGU76AYb8B+K8AawMyoj 8Wu1dedBSufmv9UjkCDdw5WvFGc/mj48JcwsGfA30RJP6w0wv7NgcJT9TTond+M/5GEP wyEg== X-Gm-Message-State: AOJu0YzuGWbrqDp7wLvKzSByr0R5ZRsWo0ZmyZF+IwAPYj1RY7qkUGOc CS0xWlgNQ2CjXLeFVVnv3zFJBQKJ2dzxGx919BQamjPpYr/kbA== X-Google-Smtp-Source: AGHT+IHI9mreVI3lg5S+XysGQzo9o6dct/yd6VBJTJ74PaywUvOPWO2gQyYqxlZ/pvceQPfRizkaP4BleXbb X-Received: by 2002:a19:6907:0:b0:507:9777:7a7 with SMTP id e7-20020a196907000000b00507977707a7mr3958648lfc.17.1699907331014; Mon, 13 Nov 2023 12:28:51 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id s1-20020a1709060c0100b009a5f5d570b5sm1774669ejf.256.2023.11.13.12.28.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2023 12:28:50 -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 E36F6605C345; Mon, 13 Nov 2023 15:28:49 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v3 3/7] dts: add scatter to the yaml schema Date: Mon, 13 Nov 2023 15:28:08 -0500 Message-ID: <20231113202833.12900-4-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231113202833.12900-1-jspewock@iol.unh.edu> References: <20231113202833.12900-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..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 Mon Nov 13 20:28:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134181 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 4D81C4331E; Mon, 13 Nov 2023 21:29:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E54040693; Mon, 13 Nov 2023 21:28:56 +0100 (CET) Received: from mail-lf1-f99.google.com (mail-lf1-f99.google.com [209.85.167.99]) by mails.dpdk.org (Postfix) with ESMTP id A39E6402DA for ; Mon, 13 Nov 2023 21:28:52 +0100 (CET) Received: by mail-lf1-f99.google.com with SMTP id 2adb3069b0e04-50a80241f39so2300312e87.3 for ; Mon, 13 Nov 2023 12:28:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699907332; x=1700512132; 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=L7WkDm/AWsdB4mA1uAY60OO5RsTlSQaWMff0jDmPCKy3vY/FW6cDexcmB4gQma/Yuo XepsDm+9LiHy9hqDwnB9UvYiUBq356Jxb/5mYZUIqIj0Av02IpDqM4glRlcfQ/tL+8W0 TTCatC+tiuY4SUPXifxx2yjwPlgvS9WTMb0R4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699907332; x=1700512132; 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=KcoZkApbAUwxPak/mfI6tCUCfgGKTLrHkweULac3IDu9s4E+OJ7pdujVLuPg1lCZ1K a97KCkKCRVIP43jWQzgum25SnmtpXOat6BhCXTk4WvTh6Vt5k3l8AsYIasPQItw/pvg6 OX0qHtexDezhLMOdjTrgZg++5bCZg/iutMo2S1e2kCHEEsCUYOWQunOhG8ITuyG9EuJN VA69MGEM6cosXXrvkY4UsxpYXftSECRkT6JdGRQZcFL3aTW0Lfbdv4+PBp/n4DNMRyHR QM67vJP8iORfV9PKqAdxZ2RLE3w1fgksPpIqpXo2ZDiqbv7NseYdhVzQB7lzTXIwalVw /QGw== X-Gm-Message-State: AOJu0YxQ1NkSMbTrEmveah9+pz0Lvl4N2dWwhqfs/d2PK+xStPxo7SDm 0QkNczDLkp55QqHj1P+wY4BUolx/jfyXxT05IyC8fzlnBtwD72kFXjCR73b5klzHvQ== X-Google-Smtp-Source: AGHT+IG1nlg+5IT2cNBZS/2pOpoWa8p6HLBb4vbsnGVYbAYZKKKBcEuqWe9Ywp9Ifx5snBENqT8UlOE2FOU0 X-Received: by 2002:ac2:4198:0:b0:509:2b82:385c with SMTP id z24-20020ac24198000000b005092b82385cmr5220716lfh.61.1699907332037; Mon, 13 Nov 2023 12:28:52 -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 l9-20020a170906414900b0099da0f859f4sm1788409ejk.28.2023.11.13.12.28.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2023 12:28:52 -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 04CF7605C344; Mon, 13 Nov 2023 15:28:51 -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 v3 4/7] dts: allow passing parameters into interactive apps Date: Mon, 13 Nov 2023 15:28:09 -0500 Message-ID: <20231113202833.12900-5-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231113202833.12900-1-jspewock@iol.unh.edu> References: <20231113202833.12900-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 Mon Nov 13 20:28:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 134182 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 CFB7A4331E; Mon, 13 Nov 2023 21:29:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3BCD140A67; Mon, 13 Nov 2023 21:28:57 +0100 (CET) Received: from mail-wm1-f97.google.com (mail-wm1-f97.google.com [209.85.128.97]) by mails.dpdk.org (Postfix) with ESMTP id 8C40D402E6 for ; Mon, 13 Nov 2023 21:28:53 +0100 (CET) Received: by mail-wm1-f97.google.com with SMTP id 5b1f17b1804b1-40839807e82so28613005e9.0 for ; Mon, 13 Nov 2023 12:28:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699907333; x=1700512133; 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=CzEyDqBfZrtprRxg4XcGvjei2mFp+W9dgogniWGJ4Uz0DsRCKSE7ZuBK19CgK2Pxtr oXemV9uWHH7jj4x5jNNK3vN0oL/974o3AF+339ZxyiQ0AmLF1z3I9n8p7CwGsVBMlswI 3PzBVfrUeH9qfi2VSRkQJHskMLqni5KhPqOlk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699907333; x=1700512133; 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=LXxfqkeHVRtklB+6iXpIgDkWIlpMhwby1s909dBmMtk/o97pxXiEYN9cVTnhr+1eOh 4RoyG016z0RtwZG6d5m9bpIl2zqZoySgwfU1zrwMfOjgY0cUzmYf8gn91XHAe2pHrhrJ 2BZd32CiF9PvidEjM7lVgRe6wFH1SqqCpTChmMy5aS1h4ljszVjSDrr426QIpCuR/SAk yeqeYrLlRFVCa4HKllW4Tc2VQCKTkIhIdeYnMSLDH20OpntV80GiNAQd6lDrSiuAd0KR HJ7YMwhSMVO8BGtKugRluqARbWcGJQTj2kPL2H8OtMR6ZhS2wNMufCi2riJq5ztk9K1B QVVQ== X-Gm-Message-State: AOJu0YzrCt5cMaAxTcA/odGIuLazZBY3OpcUQ1uKoCFDVGxI8KsezYNJ 2MZjSnl9VMzBnEhzfb5CkM0vE32zGi2s7+gQIYRV8U0r81Fv2sn6eoDfczKm1KShjQ== X-Google-Smtp-Source: AGHT+IE2EelwBhJOpnr8+luaWmXM4uqOULMXNlbIgr3aMUzPhqXN7Jw5bLIGSU4Qg2HoD6oKbx+27NpemTdS X-Received: by 2002:a05:600c:5025:b0:3fe:d67d:5040 with SMTP id n37-20020a05600c502500b003fed67d5040mr465943wmr.5.1699907333126; Mon, 13 Nov 2023 12:28:53 -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 r22-20020a05600c159600b0040654dc5913sm5582331wmf.26.2023.11.13.12.28.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2023 12:28:53 -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 DBAA4605C345; Mon, 13 Nov 2023 15:28:51 -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 v3 5/7] dts: add optional packet filtering to scapy sniffer Date: Mon, 13 Nov 2023 15:28:10 -0500 Message-ID: <20231113202833.12900-6-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231113202833.12900-1-jspewock@iol.unh.edu> References: <20231113202833.12900-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 Mon Nov 13 20:28: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: 134183 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 754D44331E; Mon, 13 Nov 2023 21:29:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3EC5B40A7D; Mon, 13 Nov 2023 21:28:58 +0100 (CET) Received: from mail-wr1-f99.google.com (mail-wr1-f99.google.com [209.85.221.99]) by mails.dpdk.org (Postfix) with ESMTP id 31834402F0 for ; Mon, 13 Nov 2023 21:28:54 +0100 (CET) Received: by mail-wr1-f99.google.com with SMTP id ffacd0b85a97d-33139ecdca7so2126181f8f.0 for ; Mon, 13 Nov 2023 12:28:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699907334; x=1700512134; 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=xMEA6FZD6uRCEotPe03RBRH7D5gBNkd5S2tXE0Wzl80=; b=Z+2mZx9/2a5xgoJkT6VkQ0gN7N7iL+WlIGY2vsjFI/jpmElZqoJx8fDbUBiDaSBB7m 5HHGl5vV8zJqEg202n8KntxMk1qjnxR26J7j+Nl/7GqIGrscCywlVX3IuIAB97YYnuIy VYH+5lP25DsoyxHzwTwCHRLgkpHYOZeYsm/68= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699907334; x=1700512134; 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=xMEA6FZD6uRCEotPe03RBRH7D5gBNkd5S2tXE0Wzl80=; b=Y3BgZb9xAZ+ogEugOwRwlxJ9M5JDjonZDJjFYRT0BcpsQKTRRqHRtUGALukghapC4s MpVfRHW8DZYi6UtHZDfq5mapxwUcZbvBL4rbF2Bcou76EDRXxFJ7VFpXmxqtO3mAvk7H gcXrnjoFvur8P+V6vrWltDV09FwVGbuKuu2Kq9yzLk09NH4J/nx3MrPIw5xTbEk+5kHG OgR4CakIKDS6KbK+trpInU7617VJcyFN2W3Xji1IG22SKLtQYpWSGGQiqW1gkHPEHNet N9A4HoKcZLB7oiqm/czIq3RZpLw5CUjdIOhZZG1od4SBghyDfo35YivuRyQY/exRM8Z2 nNLA== X-Gm-Message-State: AOJu0YwqhALz2h1H/IuFDWkyUcG+u3P9RWwbvprENn2KzTQufUXZopEA n7646wnmjjsbdXHYx0wlLYoaJpVnfD3k+vL2aDP1rSOrAuAGFaCZPups6CffXdAqxw== X-Google-Smtp-Source: AGHT+IF3WszbpcCIOJanvOEYoJFb1dTEQ6LUioz4sykRt8b596G41ZHPGbC97euYKUy8fwhaCIb8szmDnf/E X-Received: by 2002:a5d:6a4c:0:b0:32f:e1a2:5269 with SMTP id t12-20020a5d6a4c000000b0032fe1a25269mr5407500wrw.3.1699907333875; Mon, 13 Nov 2023 12:28:53 -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 d6-20020adffd86000000b0032daf28aa62sm1315117wrr.45.2023.11.13.12.28.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2023 12:28:53 -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 A4C70605C344; Mon, 13 Nov 2023 15:28:52 -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 v3 6/7] dts: add pci addresses to EAL parameters Date: Mon, 13 Nov 2023 15:28:11 -0500 Message-ID: <20231113202833.12900-7-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231113202833.12900-1-jspewock@iol.unh.edu> References: <20231113202833.12900-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 | 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 Mon Nov 13 20:28: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: 134184 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 8C04B4331E; Mon, 13 Nov 2023 21:29:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A6FBF40DFB; Mon, 13 Nov 2023 21:28:59 +0100 (CET) Received: from mail-lf1-f99.google.com (mail-lf1-f99.google.com [209.85.167.99]) by mails.dpdk.org (Postfix) with ESMTP id C8D8B40685 for ; Mon, 13 Nov 2023 21:28:55 +0100 (CET) Received: by mail-lf1-f99.google.com with SMTP id 2adb3069b0e04-507bd644a96so6975505e87.3 for ; Mon, 13 Nov 2023 12:28:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1699907335; x=1700512135; 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=bIQPkeMceVZUeatimCQuScEVHwHt/VI4UjlTKTHqyYOFu9W4mwob+k/h2HpCjvpiDj rb6mr6m1wXU3CmAgIEhqkC6KZx5qPpO8Bs8yu/8HfRVpqgRV2naiDuzQqBiq1IFcWr43 l82CSXNFBZK8N5CIX9VoMO7TnjUxK2slSSGB8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699907335; x=1700512135; 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=e1eg0HW3miKx/fH7hX2ZrFodTwWRLhn+YrZt081Q5xe5RqAqUrDo+BtvsCBDcNpUc5 9R89itTiXhQ8kBp2v41ahxZbYKfg57boz+Pjet6rpr9TUfjWFjYXl5lWzWm9muxeSirF 5jJtBv/dLg1Js6/WxNo1tKHxCuzYp+cymqYfw9iXRbU7nbxUj4lkzDpu1UiGgF0EtgBw 4IEYCDSsYVHMyQaNHT/hPnKj0bVUPNbx5cd4T/CosxLYgMsUXU48o2oE5MY1oGEvO824 63u82GcHNqgLSiz9bBd1hRpG4/vPx7rsZynzF1VQIHWEjA7NBVSXtl9EAfh6pWzSeh1p C/Gg== X-Gm-Message-State: AOJu0Yz1MUI0Mp2rTbd7fR79rn56Jn4PXpyJZo96spl9RP/UB3rP2yb1 FFcM3mlyHA9VrPTxGywkeiFZN09tRlSL3w/hfnLaZZV9mkDUBySRsc8RWczj4CHfHA== X-Google-Smtp-Source: AGHT+IEzTWOJQ46cwcvQl7FrEGVSd+lSalYI09kEwhIIvC3GQVKdF1z+8LE8PbOTInwSESxksgJsv1hL+VKp X-Received: by 2002:a19:ac03:0:b0:508:1a25:a190 with SMTP id g3-20020a19ac03000000b005081a25a190mr5075220lfc.23.1699907335358; Mon, 13 Nov 2023 12:28:55 -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 k8-20020a0565123d8800b0050a72f43623sm1557258lfv.97.2023.11.13.12.28.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Nov 2023 12:28:55 -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 0248B605C345; Mon, 13 Nov 2023 15:28:54 -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 v3 7/7] dts: allow configuring MTU of ports Date: Mon, 13 Nov 2023 15:28:12 -0500 Message-ID: <20231113202833.12900-8-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231113202833.12900-1-jspewock@iol.unh.edu> References: <20231113202833.12900-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: """