From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B25594380D; Wed, 3 Jan 2024 23:33:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DEAA640A87; Wed, 3 Jan 2024 23:33:11 +0100 (CET) Received: from mail-oa1-f97.google.com (mail-oa1-f97.google.com [209.85.160.97]) by mails.dpdk.org (Postfix) with ESMTP id 46D6840A79 for ; Wed, 3 Jan 2024 23:33:10 +0100 (CET) Received: by mail-oa1-f97.google.com with SMTP id 586e51a60fabf-204520717b3so6828654fac.0 for ; Wed, 03 Jan 2024 14:33:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1704321189; x=1704925989; 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=9O25ducMATwG+pavw82jWa5njc2pAl93LdrUmF2Ic6s=; b=VQHv9CuqazYdAzK+9tN0GkShK3U49KpRCjEtAxbqeU65d5rWIrmVMGoBmcQHFQYpYS vJp6uKc50nqWZ8SwgSk3sV9AKivAF+YIPmg+Zt51HRLHyWrRhq1qY6NZ/Lzjm3tUgy3M egLuszdZqJB7lh/1JNOYI+GkGx74FYfL24cxE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704321189; x=1704925989; 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=9O25ducMATwG+pavw82jWa5njc2pAl93LdrUmF2Ic6s=; b=bt37eMnH5B4/lCnVEE/GP3i8XAZsfLXV31wR6Y8Ee1beqhJ+/KaHcvDbWeaj6l/s7+ QR5AQosqLtRUUHK1x4VtiYr80WcSjS0ttfEEvz4eMTlMxw1Z2IxNosrPDkSq6HLbTtpm hGp21h7+AMgoM6OwnZe1Y+VtxJrjkUVWreC03G2mUD7sKpGMBSjSFCZLgNTExBlAYdxb Zy6WDgL4byvsOtedIBLO/gacXe0VzF5OZO525EH/Vs5T9R0DNb+cBosry9JiK/orwW1I GtdGjWjJtbnKQigrfxV0azFEwVSYQziD6okX5eZafXZsT/vwhCZVzTs5NkMcLmP39fBz G6KA== X-Gm-Message-State: AOJu0Yw2eDXbZsRBMYpDX/ZNVQ9aHsC7eWXfFnhgNZO4OQsPPut7xlNM 41hjF64q0/uE7tqo052IqGFKQGlXNBh+fzbd7rs/wnzq9DoVOQsxE4BaiQ== X-Google-Smtp-Source: AGHT+IHU0p+3o8WWgdTl+oCvCb5/rPc2/r9SHpSrKvoSGR/Dw0nVL3mLdFpvMCcgZ8zPpvToJJ5p/n7ccJ7H X-Received: by 2002:a05:6870:e38b:b0:204:d10:6c7 with SMTP id x11-20020a056870e38b00b002040d1006c7mr22146918oad.82.1704321189710; Wed, 03 Jan 2024 14:33:09 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id 23-20020a056870135700b002040c3b9a59sm984658oac.43.2024.01.03.14.33.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2024 14:33:09 -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 DDBA4605C311; Wed, 3 Jan 2024 17:33:08 -0500 (EST) From: jspewock@iol.unh.edu To: Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, yoan.picchi@foss.arm.com, lylavoie@iol.unh.edu, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v6 4/7] dts: add pci addresses to EAL parameters Date: Wed, 3 Jan 2024 17:32:03 -0500 Message-ID: <20240103223206.23129-5-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240103223206.23129-1-jspewock@iol.unh.edu> References: <20240103221217.18954-1-jspewock@iol.unh.edu> <20240103223206.23129-1-jspewock@iol.unh.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 4df18bc183..cc894fb07d 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, ) -- 2.43.0