From patchwork Thu Dec 14 22:10: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: 135214 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 8FD98436F4; Thu, 14 Dec 2023 23:11:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BEB2443378; Thu, 14 Dec 2023 23:11:24 +0100 (CET) Received: from mail-vk1-f227.google.com (mail-vk1-f227.google.com [209.85.221.227]) by mails.dpdk.org (Postfix) with ESMTP id 2FDA443369 for ; Thu, 14 Dec 2023 23:11:23 +0100 (CET) Received: by mail-vk1-f227.google.com with SMTP id 71dfb90a1353d-4b2e0492fffso9654e0c.0 for ; Thu, 14 Dec 2023 14:11:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1702591882; x=1703196682; 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=MgS8k8OADUeMeErqqsCQEs6yw8FVHzxDoNQ5Ppxx2DY=; b=Isoii0lclmv7CzlqU1uhjD727wDm1aia0eYDH7ivmei3lruOewc376pLrlwfnTS6dU Snm30UJTTjtjW54W5K1qUwKYz0KkLF4VTaUqTdgxaHBSsiQsANysyJZsRwt6PRJVWQH0 WEqc7pltz6x1XPS5WkHsI0WZ+oftOxFy0VP7Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702591882; x=1703196682; 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=MgS8k8OADUeMeErqqsCQEs6yw8FVHzxDoNQ5Ppxx2DY=; b=wDEIXsNVR3T9SaWgdLflrl3W6HqvwRXWDFlzRpCuFm6GS2mCuq7oH+zSbXu5gNfvPl CM7OIzyvNJeETd2nzRV5P+sQ6G3Bdc6ikHXq01DSN/yjvXGOo4+SD2wT/1LWw9IApJ1d ZBXputkifISOVJZptNOxZVKlpuAdokEjc1b61guMEU6wmo/hfR4cqjWbrugdx9f+aRh+ MSp3UE5Whs2bDWTVP6Dbm5iRgBY++8VL8gtFcY4GWBojiy7Wqx0P4OpHayLv1Bi2qngz 9nFBfJUfgwubr5TXVpY89d/S8s+kUBhDox+Gdw5DfLn5PmsuaS6bpehpYlHxV+ppzeRD APuQ== X-Gm-Message-State: AOJu0YxHT8vQQQgYRgmZgU/88lpqxEM0+YDYgjhYhyzZvLBZen4vg5la 90lwr+htsVgxbaI5pOTjGsx2DhK5IoGhpA/BYAyto7zUgvGzY+3p3tgUorX6l7LoGQ== X-Google-Smtp-Source: AGHT+IEv+rgTIK1BAA45ZMeYabCrSirsGjyn1pNnQ+3iTW73HWuYqLUJ5YQ477HZE84IAgwuIWxG98oYs8L0 X-Received: by 2002:a05:6122:2507:b0:4b2:9f0e:21bc with SMTP id cl7-20020a056122250700b004b29f0e21bcmr11203757vkb.1.1702591882494; Thu, 14 Dec 2023 14:11:22 -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 gd9-20020a0561221d4900b004b300d00665sm1580593vkb.6.2023.12.14.14.11.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Dec 2023 14:11:22 -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 DA075605C311; Thu, 14 Dec 2023 17:11: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 v4 4/7] dts: add pci addresses to EAL parameters Date: Thu, 14 Dec 2023 17:10:10 -0500 Message-ID: <20231214221012.9598-6-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.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 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py index 9c92232d9e..77caea2fc9 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, ): """ @@ -46,6 +48,7 @@ def __init__( VirtualDevice('net_ring0'), VirtualDevice('net_ring1') ] + :param ports: the list of ports to allow. :param other_eal_param: user defined DPDK eal parameters, eg: other_eal_param='--single-file-segments' """ @@ -56,6 +59,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 +69,7 @@ def __str__(self) -> str: f"{self._prefix} " f"{self._no_pci} " f"{self._vdevs} " + f"{self._ports} " f"{self._other_eal_param}" ) @@ -294,6 +299,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": """ @@ -317,6 +323,7 @@ def create_eal_parameters( VirtualDevice('net_ring0'), VirtualDevice('net_ring1') ] + :param ports: the list of ports to allow. :param other_eal_param: user defined DPDK eal parameters, eg: other_eal_param='--single-file-segments' :return: eal param string, eg: @@ -334,12 +341,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, )