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 5DEA045905; Wed, 4 Sep 2024 20:18:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB17A427C8; Wed, 4 Sep 2024 20:18:16 +0200 (CEST) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id 468904275A for ; Wed, 4 Sep 2024 20:18:15 +0200 (CEST) Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-2d8a744aa9bso2959344a91.3 for ; Wed, 04 Sep 2024 11:18:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1725473894; x=1726078694; 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=jzZQxqzYfxp0HNpjahJ5NZYBaSTEwO3PvXWCqYV8Xi4=; b=Dy/wMuQHkb6rJOgANFwmVM6YoYEDXhK76pN/l2+GLqtyrpPxchoC5VRKOECZvZcRFw tluWOwgWdX12DIQfRSFNppylYa7Bm7pj8Iakof3oX+ZfzGgtgWgYKhbXBIu/TcNYEojD xCQFViN1fHYNmTqwOxy77S9Yczt2kLzvZaBPg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725473894; x=1726078694; 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=jzZQxqzYfxp0HNpjahJ5NZYBaSTEwO3PvXWCqYV8Xi4=; b=llFLzSVeFMhi0ucVBE9BnfbZKKs57541IWvPX7C9nojeYBIuK0h8QmKyl4OLQTNde+ qcukzYHniJ18PWN3PMmP14yzlm3Zg0LI/7VJlHgsGyrWKYLQdwPzoAYXZHQ5IH3fm3hn gVjM1p/Rpe27McL72WgiZXYZw/Ykf/w1CANoVSn7XpgXDZqjG8nVUSI1K33qYzYiI+3o S9K+FoORmVyX45WQHfwoEoWamNhfFq4I+hBQVATWEd9ht18H6grSyTpaWgd7jTX9AwkL wJgdxPx5mvkz5IXRbrhEewCJ81w0d6s6sMSHwj1Qn4/HmPb+/fvu2fzLAu1SIIJMjWl+ TEeg== X-Forwarded-Encrypted: i=1; AJvYcCUUexc+7NP0C//yBjeSDa3pVJIQvQde9OAaBqabDMX9uaTQxH1CYVhSu6hSNEHJ6CgWlus=@dpdk.org X-Gm-Message-State: AOJu0YwBEBtdhf8uNaMV2IAO8KBkc6gouMqhg/9U1xHSsNFtWD51E9XP Y1h7TiCLWydQtwxvtTVpTdlkSf1wIQFGYiU3ZHQHBv8GnZ1TNdn0vZGKfbQ2ftyjTufE3h2Ut6v bhtlPOq2IAc+mgT2fDx+5X6Ynrt0I+7OLWJItlg== X-Google-Smtp-Source: AGHT+IH6ElAkuQ9Qawh41psbVM5PvrtmhwqaC4ojdRwqJKnPDGvwMPhZckELWx48Xv6Sf/hnffff5GWJunuHjg8Owt4= X-Received: by 2002:a17:90b:1a8e:b0:2d3:c6a7:5c99 with SMTP id 98e67ed59e1d1-2d89727315bmr13056105a91.8.1725473894137; Wed, 04 Sep 2024 11:18:14 -0700 (PDT) MIME-Version: 1.0 References: <20240821184305.28028-2-npratte@iol.unh.edu> <20240821184305.28028-3-npratte@iol.unh.edu> In-Reply-To: <20240821184305.28028-3-npratte@iol.unh.edu> From: Jeremy Spewock Date: Wed, 4 Sep 2024 14:18:01 -0400 Message-ID: Subject: Re: [PATCH v1 1/3] dts: rework port attributes in config module To: Nicholas Pratte Cc: yoan.picchi@foss.arm.com, luca.vizzarro@arm.com, probb@iol.unh.edu, paul.szczepanek@arm.com, Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech, 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 2:43=E2=80=AFPM Nicholas Pratte wrote: > diff --git a/dts/framework/config/__init__.py b/dts/framework/config/__in= it__.py > index df60a5030e..534821ed22 100644 > --- a/dts/framework/config/__init__.py > +++ b/dts/framework/config/__init__.py > @@ -151,11 +151,10 @@ class PortConfig: > """ > > node: str > + name: str > pci: str > os_driver_for_dpdk: str > os_driver: str > - peer_node: str > - peer_pci: str > > @classmethod > def from_dict(cls, node: str, d: PortConfigDict) -> Self: > @@ -487,12 +486,19 @@ def from_dict( > system_under_test_node, SutNodeConfiguration > ), f"Invalid SUT configuration {system_under_test_node}" > > - tg_name =3D d["traffic_generator_node"] > + tg_name =3D d["traffic_generator_node"]["node_name"] > assert tg_name in node_map, f"Unknown TG {tg_name} in test run {= d}" > traffic_generator_node =3D node_map[tg_name] > assert isinstance( > traffic_generator_node, TGNodeConfiguration > ), f"Invalid TG configuration {traffic_generator_node}" > + assert len(traffic_generator_node.ports) =3D=3D len( > + system_under_test_node.ports > + ), "Insufficient ports defined on nodes." Do we want to assert that the list of ports on the tester is the same as the number on the SUT, or would it be better here to assert that the same number of SUT and TG ports are present in the test_run? There could be a case where a TG is the generator for multiple SUT hosts and therefore maybe the TG has 4 ports, but each of the SUT nodes only has 2 which would get flagged as invalid in this assertion. Maybe something better to compare here is the length of d["traffic_generator_node"]["test_bed"] and d["system_under_test_node"]["test_bed"]. > + for port_name in d["system_under_test_node"]["test_bed"]: > + assert port_name in {port.name: port for port in system_unde= r_test_node.ports} A little nit-picky, but you could achieve the same thing here using a list rather than a dictionary here that might be a little easier to read since we don't need the port info anyway: assert port_name in [port.name for port in system_under_test_node.ports] > + for port_name in d["traffic_generator_node"]["test_bed"]: > + assert port_name in {port.name: port for port in traffic_gen= erator_node.ports} > > vdevs =3D ( > d["system_under_test_node"]["vdevs"] if "vdevs" in d["system= _under_test_node"] else [] > 2.44.0 >