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 6B43945879; Tue, 27 Aug 2024 18:37:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 03BA540E2D; Tue, 27 Aug 2024 18:37:09 +0200 (CEST) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by mails.dpdk.org (Postfix) with ESMTP id C5DCC40E1B for ; Tue, 27 Aug 2024 18:37:06 +0200 (CEST) Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-7cd830e0711so4185831a12.0 for ; Tue, 27 Aug 2024 09:37:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1724776626; x=1725381426; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=w+zGg1SqikCO0CSSPHcS+PQvmMO1dDqefJ4/KNksePU=; b=XMR5l7mqAQE7CgfQo7yi0+oE209WNeWLEk88cMxmYJJJTlDAElOudm5mTgZ2pckpCs tLr3MZ41764dR/g/agkcUbPnbve5T1Mx2uaa0XCPMA5mtN03ROLnHDdBTHjQxiBSdYQ1 J+3X+AAAJwecn287xt0kEgcjF5kwGr03NgSUw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724776626; x=1725381426; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w+zGg1SqikCO0CSSPHcS+PQvmMO1dDqefJ4/KNksePU=; b=fwwkKfHx/w65dFiq0VH8J4ROI+0drTjoqOOieITdemRK4XXG2pqZEsxbpBG9tyx8W3 DQSwwqocHDtXalqFhwuyZ9hGBUMYSjH6q6OpYsthg7azJDEccLvVQjUejwp6ibUFd4Qb HpR/gKo2MfC2TZ2UNc8oNqo8NhfvoogZDx7Se//k2zgKBJoawaNUTZCeHdu2MyC7uIFp ib/UMcNsZZy4GEAmSroZy0JRa60xmbvhP+z4qtO1rsYLB1RhpbdurC5b92orH9iw+QMV rbZ1KFMIUNfmRFtCW5umojcVhpwQ68zgP9x0Zl8ikJBKGeiDzwTZZ3yGMEyI2JJThUsS bYFQ== X-Forwarded-Encrypted: i=1; AJvYcCUpUvA30LT/UpvHOfmKAs+NImdFhtpF2qR2SStkYRPJeC5rLf+al+vu5/FD21Aar8g61GE=@dpdk.org X-Gm-Message-State: AOJu0Yw9GTP21i+ZczjXKIeeZXyh4mYWDnSPF+lVMaDRKKNAXOLKJwS9 kU2I0dSlx5WtpgpM4UHALhNyEIwHYPNQvrddZtk6IEDRP6ZOCWfF9rlAkII6PTNdNma890bMI/4 JnlpauruSvoA+ZyPhhUnrKFIPbkhMFLCNJ1xdHw== X-Google-Smtp-Source: AGHT+IHETOQ86HPFFUxQeWfw9O1Tk5wGSgkuO8HeCrRRNu8ll8CTo10myloglrkZ4NxogksaiLKkLd//5tAWEiMVpbY= X-Received: by 2002:a17:90a:4dca:b0:2d3:d79f:e8b7 with SMTP id 98e67ed59e1d1-2d8249f9a11mr5328194a91.5.1724776625342; Tue, 27 Aug 2024 09:37:05 -0700 (PDT) MIME-Version: 1.0 References: <20240301155416.96960-1-juraj.linkes@pantheon.tech> <20240821145315.97974-1-juraj.linkes@pantheon.tech> <20240821145315.97974-9-juraj.linkes@pantheon.tech> In-Reply-To: <20240821145315.97974-9-juraj.linkes@pantheon.tech> From: Jeremy Spewock Date: Tue, 27 Aug 2024 12:36:54 -0400 Message-ID: Subject: Re: [PATCH v3 08/12] dts: add NIC capability support To: =?UTF-8?Q?Juraj_Linke=C5=A1?= Cc: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, Luca.Vizzarro@arm.com, npratte@iol.unh.edu, dmarx@iol.unh.edu, alex.chapman@arm.com, dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Wed, Aug 21, 2024 at 10:53=E2=80=AFAM Juraj Linke=C5=A1 wrote: > diff --git a/dts/framework/testbed_model/capability.py b/dts/framework/te= stbed_model/capability.py > index 8899f07f76..9a79e6ebb3 100644 > --- a/dts/framework/testbed_model/capability.py > +++ b/dts/framework/testbed_model/capability.py > @@ -5,14 +5,40 @@ > + @classmethod > + def get_supported_capabilities( > + cls, sut_node: SutNode, topology: "Topology" > + ) -> set["DecoratedNicCapability"]: > + """Overrides :meth:`~Capability.get_supported_capabilities`. > + > + The capabilities are first sorted by decorators, then reduced in= to a single function which > + is then passed to the decorator. This way we only execute each d= ecorator only once. > + """ > + supported_conditional_capabilities: set["DecoratedNicCapability"= ] =3D set() > + logger =3D get_dts_logger(f"{sut_node.name}.{cls.__name__}") > + if topology.type is Topology.type.no_link: As a follow-up, I didn't notice this during my initial review, but in testing this line was throwing attribute errors for me due to Topology not having an attribute named `type`. I think this was because of `Topology.type.no_link` since this attribute isn't initialized on the class itself. I fixed this by just replacing it with `TopologyType.no_link` locally. > + logger.debug( > + "No links available in the current topology, not getting= NIC capabilities." > + ) > + return supported_conditional_capabilities > + logger.debug( > + f"Checking which NIC capabilities from {cls.capabilities_to_= check} are supported." > + ) > + if cls.capabilities_to_check: > + capabilities_to_check_map =3D cls._get_decorated_capabilitie= s_map() > + with TestPmdShell(sut_node, privileged=3DTrue) as testpmd_sh= ell: > + for conditional_capability_fn, capabilities in capabilit= ies_to_check_map.items(): > + supported_capabilities: set[NicCapability] =3D set() >