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 99A55459CE; Wed, 18 Sep 2024 18:52:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E5CF4025E; Wed, 18 Sep 2024 18:52:59 +0200 (CEST) Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mails.dpdk.org (Postfix) with ESMTP id AD2E24003C for ; Wed, 18 Sep 2024 18:52:58 +0200 (CEST) Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2d8815ef6d2so5871885a91.0 for ; Wed, 18 Sep 2024 09:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1726678378; x=1727283178; 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=ILBXlGM3RN1phe6rwwlm39ZqChIua5wZ03Xqttd1HJk=; b=LqEg+prfMY/pduh/K+va12C0wu+MiLnsCJp9jqFMfALn1/8jkeToaa+pW07QiBuNSU y0zmW0jj5gGvapVpDGZ9RPQbC90mLBX7CTnuFysWzpNYhQO2VwXhQQjkIE+lMy1BLBX9 KAg3H/P8PzraYdxtnEeF7/CgyPy7qjfR7nLMg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726678378; x=1727283178; 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=ILBXlGM3RN1phe6rwwlm39ZqChIua5wZ03Xqttd1HJk=; b=TvLYxAf9Ledg3PRbyWX4oRhkvXG10j+qh/DzDgV5wpYi72ZSiHJ/ZXRQBkfAAJmx24 7lPqHBFTJV34UI55hcmUIEuJ/4Bew/+2HQrRfjGtsxUljs8RK54BHlxB/ljXamYZFeOL 9XudeYQ9OtYxbdiVagqQ1IAvoe1NzPy99bZxMs/2R5TF2J+RM3G03xZMU5LbsnVbcn0q u4VNmPfXXGqGrYQI4ITqFs62GluVkyZ7zph7ZScNgCdsIuE2BguGHLxu58LUFl0aiySk RjajcI0yhP4L4MiodMBn6DQFwdduFWIDbAtlm/Vk1KvZUaN7DoJCWz/N1bRTDKLj5uEq 6ckQ== X-Forwarded-Encrypted: i=1; AJvYcCULXyRxu0VDN0rp35WwKExStPdNNmpF++kqfD6vP8gRQytLvPTZH5vHI5vNby5JJd5ZRdk=@dpdk.org X-Gm-Message-State: AOJu0Yx2d/HaEx0cJhU6UPMZasvXke+eUvaMXbC0pW0dTdZhQAO77otO faKzqRYP6LstRC8t9SqI/jVAe65fpl0imVbrruOzlG3p9WflBQrpT0sy0qCzNCGfDyl+4P4yT2C sKMxMwTVUXG9OyGOli244T+CVX8cTmnfrHZtR7w== X-Google-Smtp-Source: AGHT+IGEsYNWX1mChdRNRjBN1qtrLDO33OZ14OZE3OPPx8PuBvMq849DQHF7rE4cTDRUwaaR5Si/l9Uaxdihyuf/rvI= X-Received: by 2002:a17:90b:4b44:b0:2da:8c08:6a29 with SMTP id 98e67ed59e1d1-2db9ffb11b8mr29023314a91.8.1726678377673; Wed, 18 Sep 2024 09:52:57 -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> <0d6ab3ba-58bd-4750-8113-79d8285bc19a@pantheon.tech> In-Reply-To: <0d6ab3ba-58bd-4750-8113-79d8285bc19a@pantheon.tech> From: Jeremy Spewock Date: Wed, 18 Sep 2024 12:52:45 -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, Sep 18, 2024 at 8:58=E2=80=AFAM Juraj Linke=C5=A1 wrote: > > > > On 27. 8. 2024 18:36, Jeremy Spewock wrote: > > 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= /testbed_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= into a single function which > >> + is then passed to the decorator. This way we only execute eac= h decorator only once. > >> + """ > >> + supported_conditional_capabilities: set["DecoratedNicCapabili= ty"] =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. > > > > I also ran into this, the type attribute is not a class variable. Your > solution works (and I also originally fixed it with exactly that), but I > then I realized topology.type.no_link also works (and was probably my > intention), which doesn't require the extra import of TopologyType. Right, that's smart. I forget that you can do that with enums.