From patchwork Tue Jan 9 15:36:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Spewock X-Patchwork-Id: 135813 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1E16F43874; Tue, 9 Jan 2024 16:37:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7773140A79; Tue, 9 Jan 2024 16:37:02 +0100 (CET) Received: from mail-oo1-f99.google.com (mail-oo1-f99.google.com [209.85.161.99]) by mails.dpdk.org (Postfix) with ESMTP id 76381406FF for ; Tue, 9 Jan 2024 16:37:00 +0100 (CET) Received: by mail-oo1-f99.google.com with SMTP id 006d021491bc7-5981e5d4e7cso1852800eaf.0 for ; Tue, 09 Jan 2024 07:37:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704814620; x=1705419420; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pRnrX2NkCTD9Oy40zRgq71nD2pbb99S5ImuL2IF0CRE=; b=NFJ8uK6IKIylxo+VUjp60xw8gikF56WJi/0mfh9WYPrYghBSU9eRRt80i2XVhp30b0 uyn3nmFfjcE4CACjvTS+GfZpsVJKdccFGax3t6PpNCTqZwlT7Z/ormE0+X8HY6llGugf rIZ2Gsldsv9UBFesnbgKZrzhOHB0IelgNRG7k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704814620; x=1705419420; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pRnrX2NkCTD9Oy40zRgq71nD2pbb99S5ImuL2IF0CRE=; b=oSuXYzIS++/HKP2nA8kZMAbDAl1zeyD4rLYCKHOyeTG7poi6+7lw5MYseGXgyahVaP qrgjG6ER/NGbjYJfX+/OE7X1H3uzV0GWBvwYlAhsbuc2jgseJ/9UtLtoKaSpjmPVsJNd tzI/V6vgLw3nF9bmaG5IQ8iGZQUTFhN/pmk9l/tzio5wDJsfT8ehr5NmsRPCsn8ERHHn jferyqtkcOdFGwKHtwjYOoOcOBkHitTZuW26TrPo2gKkNmGLYiPmybVrGfiz6H4u/7Zt aeImU0PF2ornc9ueVNBDqddBwxLtZlPfFsPFU0odsb3Q+bv36BNBmJJZuPHdlL9mmfDj fPDw== X-Gm-Message-State: AOJu0Ywa1yxw75BaTfod9iHF0v8SUUsNtXhFk1koAyW1ivPJxR1Mh3P0 s9WH4j+vQzY4rZJIiYiLvQyotG/uzHmD/siuyjRKLyPQY7hNSWZfWQX8hA== X-Google-Smtp-Source: AGHT+IHgwk1w0U89UxP1BfV63NiudI5g3iwOhwg39AaDcBvt0ifSS44pafMbX3a4mHG0AVUrEDNT0lrXOcaC X-Received: by 2002:a4a:1ac7:0:b0:598:45be:2ca7 with SMTP id 190-20020a4a1ac7000000b0059845be2ca7mr2579860oof.11.1704814619769; Tue, 09 Jan 2024 07:36:59 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id h19-20020a4a6b53000000b00594cdd911d6sm95619oof.20.2024.01.09.07.36.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2024 07:36:59 -0800 (PST) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::1083]) by postal.iol.unh.edu (Postfix) with ESMTP id 0FB0F6043300; Tue, 9 Jan 2024 10:36:59 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, lylavoie@iol.unh.edu, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v7 4/7] dts: add pci addresses to EAL parameters Date: Tue, 9 Jan 2024 10:36:30 -0500 Message-ID: <20240109153633.766-5-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240109153633.766-1-jspewock@iol.unh.edu> References: <20240103223206.23129-1-jspewock@iol.unh.edu> <20240109153633.766-1-jspewock@iol.unh.edu> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock Added allow list to the EAL parameters created in DTS to ensure that only the relevant PCI devices are considered when launching DPDK applications. Signed-off-by: Jeremy Spewock --- dts/framework/testbed_model/sut_node.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py index 909394e756..97aa26d419 100644 --- a/dts/framework/testbed_model/sut_node.py +++ b/dts/framework/testbed_model/sut_node.py @@ -30,6 +30,7 @@ from .cpu import LogicalCoreCount, LogicalCoreList from .node import Node from .os_session import InteractiveShellType, OSSession +from .port import Port from .virtual_device import VirtualDevice @@ -46,6 +47,7 @@ def __init__( prefix: str, no_pci: bool, vdevs: list[VirtualDevice], + ports: list[Port], other_eal_param: str, ): """Initialize the parameters according to inputs. @@ -63,6 +65,7 @@ def __init__( VirtualDevice('net_ring0'), VirtualDevice('net_ring1') ] + ports: The list of ports to allow. other_eal_param: user defined DPDK EAL parameters, e.g.: ``other_eal_param='--single-file-segments'`` """ @@ -73,6 +76,7 @@ def __init__( self._prefix = f"--file-prefix={prefix}" self._no_pci = "--no-pci" if no_pci else "" self._vdevs = " ".join(f"--vdev {vdev}" for vdev in vdevs) + self._ports = " ".join(f"-a {port.pci}" for port in ports) self._other_eal_param = other_eal_param def __str__(self) -> str: @@ -83,6 +87,7 @@ def __str__(self) -> str: f"{self._prefix} " f"{self._no_pci} " f"{self._vdevs} " + f"{self._ports} " f"{self._other_eal_param}" ) @@ -347,6 +352,7 @@ def create_eal_parameters( append_prefix_timestamp: bool = True, no_pci: bool = False, vdevs: list[VirtualDevice] | None = None, + ports: list[Port] | None = None, other_eal_param: str = "", ) -> "EalParameters": """Compose the EAL parameters. @@ -370,6 +376,8 @@ def create_eal_parameters( VirtualDevice('net_ring0'), VirtualDevice('net_ring1') ] + ports: The list of ports to allow. If :data:`None`, all ports listed in `self.ports` + will be allowed. other_eal_param: user defined DPDK EAL parameters, e.g.: ``other_eal_param='--single-file-segments'``. @@ -388,12 +396,16 @@ def create_eal_parameters( if vdevs is None: vdevs = [] + if ports is None: + ports = self.ports + return EalParameters( lcore_list=lcore_list, memory_channels=self.config.memory_channels, prefix=prefix, no_pci=no_pci, vdevs=vdevs, + ports=ports, other_eal_param=other_eal_param, )