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 4393A45957; Tue, 10 Sep 2024 16:04:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D526542DC3; Tue, 10 Sep 2024 16:04:11 +0200 (CEST) Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by mails.dpdk.org (Postfix) with ESMTP id CAE75402AB for ; Tue, 10 Sep 2024 16:04:10 +0200 (CEST) Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a8d4093722bso448808666b.0 for ; Tue, 10 Sep 2024 07:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1725977050; x=1726581850; darn=dpdk.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=eVIbgmG3/vSMaERvj87wjdMm/RcRJ4xhmfx0KM9tbls=; b=T2NYkeU44ZkB1RwZxK9Sg1kvUl4he8hjoeswlPhBJ2iXpJPxQUy7DsHPvehAxYF5sy YYIuBn/jmoBrvQMKv73BCn19/elDhIuVUDSlMh5ocUMNrUewshLTVuK8XzyViamX4YoN YZxTCat0c9kM5XfWO329CbXVY4wnTT4oVPwf2L4x4n06YYdDa/nPrhKtCkp9HYZaHXO2 8m0GC4fJKLIzW+Dmsi4a/yA7E+gIUR/sbifX6uIPc0+xJsrJVmH5Jz18z97YFuRbUoP4 FvMGYUFzwgwy/9Z4y0SLg7ZFMIsVnwtP2+klAn5AnE/FqZG/tt5HC7ZPgblf3nK7kjBl hWrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725977050; x=1726581850; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eVIbgmG3/vSMaERvj87wjdMm/RcRJ4xhmfx0KM9tbls=; b=UUbOJFIFajlO9vF0J/4GNvshqDXdAkFZ9XPbC1sy8Wm+va6LptLmsG+s1jCGLhzMIA xD7uhMHc3u5P1N987EvlWCF6BNe+JkuNiOPunz84TRqhpbZCGIHXdtJAYiFnOSn6c99i mWgMK2wo+cr8k8XJzvypkWjn67dcnSj9IBMfGI4eV+s6bCQsFVBqwjQJHs8kkpLd+pbS gjurx7Z4QMC2l2CRXmoiTp/AsKhy8seoc+AUL62yuufhajj/PPy7HWgM8zxI9zVuaUkY tgytHCageHzhbVZjQghP1GcAD350qmehsvrnHcXP4sZqspmXnSz/IfskqP4o1EfQFFQ/ pGTA== X-Gm-Message-State: AOJu0YzDM9Yco3HNNmsLOTp16RytDHsFkiyu5UBBwNK9Pd4yYjyuBR98 Gw50s2FV4z/waTdbOrK9Bs0STkV9vU3NOZXvbjWtV4YxidY+uw+RhwDiRyjKIlg= X-Google-Smtp-Source: AGHT+IHD2haDwyoJNlwo6M2LvLxs/03hzxFHj1v8D/h4X0AbWKSDynPqbuiFwQp79TSULbZ3+goVcA== X-Received: by 2002:a17:907:e8e:b0:a8a:6e35:31ef with SMTP id a640c23a62f3a-a8ffadee4f7mr89498866b.49.1725977050097; Tue, 10 Sep 2024 07:04:10 -0700 (PDT) Received: from [192.168.0.113] ([84.245.121.62]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25d65cddsm481681466b.220.2024.09.10.07.04.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Sep 2024 07:04:09 -0700 (PDT) Message-ID: <309096ee-9057-45d5-ab62-cfdeb7537546@pantheon.tech> Date: Tue, 10 Sep 2024 16:04:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 4/6] dts: Rework DPDK Attributes In SUT Node Config To: Nicholas Pratte , probb@iol.unh.edu, dmarx@iol.unh.edu, jspewock@iol.unh.edu, luca.vizzarro@arm.com, yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com, paul.szczepanek@arm.com Cc: dev@dpdk.org References: <20240613201831.9748-3-npratte@iol.unh.edu> <20240705171341.23894-10-npratte@iol.unh.edu> Content-Language: en-US From: =?UTF-8?Q?Juraj_Linke=C5=A1?= In-Reply-To: <20240705171341.23894-10-npratte@iol.unh.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 > diff --git a/dts/framework/config/conf_yaml_schema.json b/dts/framework/config/conf_yaml_schema.json > index e65ea45058..b31f4d8dbe 100644 > --- a/dts/framework/config/conf_yaml_schema.json > +++ b/dts/framework/config/conf_yaml_schema.json > @@ -150,14 +150,21 @@ > "os": { > "$ref": "#/definitions/OS" > }, > - "lcores": { > - "type": "string", > - "pattern": "^(([0-9]+|([0-9]+-[0-9]+))(,([0-9]+|([0-9]+-[0-9]+)))*)?$|any", > - "description": "Optional comma-separated list of logical cores to use, e.g.: 1,2,3,4,5,18-22. Defaults to 1. An empty string means use all lcores." > - }, > - "memory_channels": { > - "type": "integer", > - "description": "How many memory channels to use. Optional, defaults to 1." > + "dpdk_config": { > + "type": "object", > + "description": "EAL arguments for DPDK execution", > + "properties": { > + "lcores": { > + "type": "string", > + "pattern": "^(([0-9]+|([0-9]+-[0-9]+))(,([0-9]+|([0-9]+-[0-9]+)))*)?$|any", > + "description": "Optional comma-separated list of logical cores to use, e.g.: 1,2,3,4,5,18-22. Defaults to 1. An empty string means use all lcores." > + }, > + "memory_channels": { > + "type": "integer", > + "description": "How many memory channels to use. Optional, defaults to 1." > + } > + }, > + "minimum": 1 > }, > "hugepages_2mb": { > "$ref": "#/definitions/hugepages_2mb" > @@ -264,23 +271,15 @@ > "description": "Optional field that allows you to skip smoke testing", > "type": "boolean" > }, > + "vdevs": { > + "description": "Optional list of names of vdevs to be used in execution", Don't forget to check these patches for execution -> test run. Also, while we're at it, let's add a dot to the end of this sentence. > diff --git a/dts/framework/testbed_model/cpu.py b/dts/framework/testbed_model/cpu.py > index a50cf44c19..cc4ca40ad9 100644 > --- a/dts/framework/testbed_model/cpu.py > +++ b/dts/framework/testbed_model/cpu.py > @@ -167,7 +167,6 @@ def __init__( > > # sorting by core is needed in case hyperthreading is enabled > self._lcores_to_filter = sorted(lcore_list, key=lambda x: x.core, reverse=not ascending) > - self.filter() This is a pretty good catch. > > @abstractmethod > def filter(self) -> list[LogicalCore]: > @@ -210,6 +209,8 @@ def filter(self) -> list[LogicalCore]: > Returns: > The filtered cores. > """ > + if 0 in self._lcores_to_filter: > + self._lcores_to_filter = self._lcores_to_filter[1:] > sockets_to_filter = self._filter_sockets(self._lcores_to_filter) > filtered_lcores = [] > for socket_to_filter in sockets_to_filter: > @@ -328,6 +329,9 @@ def filter(self) -> list[LogicalCore]: > Return: > The filtered logical CPU cores. > """ > + if 0 not in self._filter_specifier.lcore_list: > + self._lcores_to_filter = self._lcores_to_filter[1:] > + I see you actually did what I was thinking of. This should be in 2/6. I'm not a big fan of two different implementation of what should be common logic. Can we pass skip_first_core to LogicalCoreFilter.__init__() and remove the first core from self._lcores_to_filter if True (it would default to False)? skip_first core would be determined in SutNode.__init__() and then passed downstream. > diff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py > index a4511157b7..178535b617 100644 > --- a/dts/framework/testbed_model/sut_node.py > +++ b/dts/framework/testbed_model/sut_node.py > @@ -29,6 +29,7 @@ > from framework.settings import SETTINGS > from framework.utils import MesonArgs > > +from .cpu import LogicalCore, LogicalCoreList > from .node import Node > from .os_session import OSSession > from .virtual_device import VirtualDevice > @@ -75,6 +76,17 @@ def __init__(self, node_config: SutNodeConfiguration): > node_config: The SUT node's test run configuration. > """ > super().__init__(node_config) Here is where we could determine use_first_core from self.config.dpdk_config.lcores and pass that to self.filter_lcores(). > + self.lcores = self.filter_lcores(LogicalCoreList(self.config.dpdk_config.lcores)) > + if LogicalCore(lcore=0, core=0, socket=0, node=0) in self.lcores: > + self._logger.info( > + """ > + WARNING: First core being used; > + using the first core is considered risky and should only > + be done by advanced users. > + """ > + ) > + else: > + self._logger.info("Not using first core") > self.virtual_devices = [] > self.dpdk_prefix_list = [] > self._build_target_config = None