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 1A5964586E; Mon, 26 Aug 2024 18:54:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E9B7D400EF; Mon, 26 Aug 2024 18:54:18 +0200 (CEST) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id 47A584003C for ; Mon, 26 Aug 2024 18:54:17 +0200 (CEST) Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2d3c5f769d6so3006416a91.3 for ; Mon, 26 Aug 2024 09:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1724691256; x=1725296056; 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=C64a4lrYMznZ4oemMLMIsAKoajecb209Tzg04ZceUMM=; b=INETjh36tw/9atrkwVs6fBCKrDqtOrjAZGU3M5Oyv7A/NzHAzcN7VKRnEHmckOgO7Z s56g3P6LC0mdZjrJeNBtjesH4g75waDkwg0VNYTehWtQBfyEdl0ajzBG8WTyoAB/cGPf 38BUlq8Oom3fB/tHFENbXONMr8Hb5pAfigIlw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724691256; x=1725296056; 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=C64a4lrYMznZ4oemMLMIsAKoajecb209Tzg04ZceUMM=; b=P70FPGDSPjaUf9944LOMSQwpZcjGDqtEdGsOGsLdWSs1QjUqM0axMSYimMYZHDDgXh k+jpaDTAsXN713MstOTFAVnJ1A1ducqBG3RPnb3qO41mgs5Z2GINh3Or8QJssqozf+Zg 13z8eNOol7wFGBkU594hMCWsT6kAzGIbetLiaTlX004en0/gBic7FhOp93bLia8PgzfC n3BUTkCg+rE1+zQnzj780p1ERiKjgcRROtAUN6ABrRw2qjfla9LpKoHEMP5/vkaVTFe4 zk/JTwlIJDhCDeprgoPFQ2GynTJBzZTjwVPEZ9D6e1TPmSpTNWmL8DCsZxy99psRWpS8 SQtQ== X-Forwarded-Encrypted: i=1; AJvYcCUak/RUhfWcDZxRbXwxRP8h//CXL/Nx7tcU9bCKcLUzeozoBJiEjUBjMW0AiUNUAVSjreU=@dpdk.org X-Gm-Message-State: AOJu0YwsEYs4G5NiKd39FrUfHDJZGoYJY8/btaxBKX7zXRTGkfaCpWQ9 fh0WrxosZyRJ2Rmg3rp6vkGhNY8DmiqCmyA29QMXzTSdPltBJS6752OTd2gvKo8NsMVx3jfX1v3 eikN5mPDCuDWlmuV7tfDBO/pS6QFjGZAS/y0dQg== X-Google-Smtp-Source: AGHT+IGMrubjV32wtIpWQ7jcNb+4tgb7pRZE8gOXDAfgepWgE/uLl/TXoMs5aU9cm80Bx7Trx09dIFJGvqDwR2Um8GA= X-Received: by 2002:a17:90a:bd7:b0:2c8:85c:750b with SMTP id 98e67ed59e1d1-2d646d0b614mr11039451a91.34.1724691256225; Mon, 26 Aug 2024 09:54:16 -0700 (PDT) MIME-Version: 1.0 References: <20240301155416.96960-1-juraj.linkes@pantheon.tech> <20240821145315.97974-1-juraj.linkes@pantheon.tech> <20240821145315.97974-6-juraj.linkes@pantheon.tech> In-Reply-To: <20240821145315.97974-6-juraj.linkes@pantheon.tech> From: Jeremy Spewock Date: Mon, 26 Aug 2024 12:54:04 -0400 Message-ID: Subject: Re: [PATCH v3 05/12] dts: add support for simpler topologies 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 I just had one question below, otherwise: Reviewed-by: Jeremy Spewock On Wed, Aug 21, 2024 at 10:53=E2=80=AFAM Juraj Linke=C5=A1 wrote: > diff --git a/dts/framework/testbed_model/topology.py b/dts/framework/test= bed_model/topology.py > new file mode 100644 > index 0000000000..19632ee890 > --- /dev/null > +++ b/dts/framework/testbed_model/topology.py > + > + > +class TopologyType(IntEnum): > + """Supported topology types.""" > + > + #: A topology with no Traffic Generator. > + no_link =3D 0 > + #: A topology with one physical link between the SUT node and the TG= node. > + one_link =3D 1 > + #: A topology with two physical links between the Sut node and the T= G node. > + two_links =3D 2 > + > + > +class Topology: > + """Testbed topology. > + > + The topology contains ports processed into ingress and egress ports. > + It's assumed that port0 of the SUT node is connected to port0 of the= TG node and so on. Do we need to make this assumption when you are comparing the port directly to its peer and matching the addresses? I think you could specify in conf.yaml that port 0 on the SUT is one of your ports and its peer is port 1 on the TG and because you do the matching, this would work fine. > + If there are no ports on a node, dummy ports (ports with no actual v= alues) are stored. > + If there is only one link available, the ports of this link are stor= ed > + as both ingress and egress ports. > + > + The dummy ports shouldn't be used. It's up to :class:`~framework.run= ner.DTSRunner` > + to ensure no test case or suite requiring actual links is executed > + when the topology prohibits it and up to the developers to make sure= that test cases > + not requiring any links don't use any ports. Otherwise, the underlyi= ng methods > + using the ports will fail. > + > + Attributes: > + type: The type of the topology. > + tg_port_egress: The egress port of the TG node. > + sut_port_ingress: The ingress port of the SUT node. > + sut_port_egress: The egress port of the SUT node. > + tg_port_ingress: The ingress port of the TG node. > + """ > + > + type: TopologyType > + tg_port_egress: Port > + sut_port_ingress: Port > + sut_port_egress: Port > + tg_port_ingress: Port > + > + def __init__(self, sut_ports: Iterable[Port], tg_ports: Iterable[Por= t]): > + """Create the topology from `sut_ports` and `tg_ports`. > + > + Args: > + sut_ports: The SUT node's ports. > + tg_ports: The TG node's ports. > + """ > + port_links =3D [] > + for sut_port in sut_ports: > + for tg_port in tg_ports: > + if (sut_port.identifier, sut_port.peer) =3D=3D ( > + tg_port.peer, > + tg_port.identifier, > + ): > + port_links.append(PortLink(sut_port=3Dsut_port, tg_p= ort=3Dtg_port)) > + > + self.type =3D TopologyType(len(port_links)) >