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 0C4DD4590C; Thu, 5 Sep 2024 11:43:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9581740264; Thu, 5 Sep 2024 11:43:03 +0200 (CEST) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by mails.dpdk.org (Postfix) with ESMTP id 091BA4025C for ; Thu, 5 Sep 2024 11:43:02 +0200 (CEST) Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a8692bbec79so84909666b.3 for ; Thu, 05 Sep 2024 02:43:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pantheon.tech; s=google; t=1725529381; x=1726134181; 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=AwlkLsbn3E6K3xNrqmrJecm36HygEnFhLVavxJYiIok=; b=TJnfs1wY4+lWy63HkQ5Qi7HjAAabrigoRRiGuYN+D0SSgxnmSr4d53uaYvwiOPdZZp vfJJPER4anyohojsChzesEPXERXtGQeNQYEuZG9imSJIEzqKMRtJDz35MF1nPycSdq4c Hv1AvTUvG5DA/frjA0/nCoNi0E3KdblvY5TvrFsLi03Woq5//03eFmIY3dwYLtLSYljW eEIf1ejKdrDgfA9cDq/GHOwppLFTV63COFfUi9Z+LvbZDfSIcgQrBXWZmY/ntzaxwqoo 2qSBBd67CHHIdA6162enHyilQOamV7xPMM3zyfBhADELUlNRLo8VCQlK2Olfj7R/cK+z YxMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725529381; x=1726134181; 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=AwlkLsbn3E6K3xNrqmrJecm36HygEnFhLVavxJYiIok=; b=lxKHGIawVvivcChZdPZj9uD+UWQ/egcJO3Ps/iF8WtlqX+j/mFr9xD3HCREIf5+v+R 3XeJEQ2wmnypCTwDARPcb4HZ/u9b460+CcZxfJXpCbrcjJanajG9pQOwgKKDyefnsgte lHXVyJtQGxQhvIxhna3D4RhD/EwGZ2ZI0hLOYUvQrr3PZnX1t72TQ8r/nleKo5rMHtKq aTYZ6UECkEEXOBVabRiFtobq4drEZfZ60RQ7slyE+E1CLFHcRCuCLFAB2+/KWceAJc+c BN5EaLytc70ldRY1dt2YG8CgGRvQqV4gab6BLXqvFvDy5OZsqHynKXPmrWv5h6LpZcYm 1pcQ== X-Forwarded-Encrypted: i=1; AJvYcCX43Mj+K2k2Dz/829nCqc6mmK55dCI+LPX2QCWNAHqG4crhUXWlDarQm10j5QOt9EpYcaU=@dpdk.org X-Gm-Message-State: AOJu0Yxys9NnPDM4Awh0QRd3uZnFtKyRr4HZ/XyG4ieTfn/NfF7/0rS5 vRVP69lB8xFCOxZbj4E0V0Dsljik7qTcMMU/b89CoCnyT+HLhXQxzaV/WpiaVT4= X-Google-Smtp-Source: AGHT+IHra4rIP3X3tGKvDATjJA0wES67UrfV6QnVDHXkXdmYOmpXsoEA/O4Jqw7UI8+ioIwcVzlCTA== X-Received: by 2002:a17:907:dac:b0:a8a:73b2:7c4d with SMTP id a640c23a62f3a-a8a73b27e84mr84504666b.34.1725529381379; Thu, 05 Sep 2024 02:43:01 -0700 (PDT) Received: from [192.168.200.22] ([84.245.121.62]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8a61fbb093sm113205566b.11.2024.09.05.02.43.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Sep 2024 02:43:01 -0700 (PDT) Message-ID: <7cc91a1c-8e53-4a34-9d08-10e793ec4210@pantheon.tech> Date: Thu, 5 Sep 2024 11:42:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 05/12] dts: add support for simpler topologies To: Jeremy Spewock 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 References: <20240301155416.96960-1-juraj.linkes@pantheon.tech> <20240821145315.97974-1-juraj.linkes@pantheon.tech> <20240821145315.97974-6-juraj.linkes@pantheon.tech> Content-Language: en-US From: =?UTF-8?Q?Juraj_Linke=C5=A1?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 26. 8. 2024 18:54, Jeremy Spewock wrote: > I just had one question below, otherwise: > > Reviewed-by: Jeremy Spewock > > On Wed, Aug 21, 2024 at 10:53 AM Juraj Linkeš > wrote: > >> diff --git a/dts/framework/testbed_model/topology.py b/dts/framework/testbed_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 = 0 >> + #: A topology with one physical link between the SUT node and the TG node. >> + one_link = 1 >> + #: A topology with two physical links between the Sut node and the TG node. >> + two_links = 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. > Yes, the assumption is not adhered to yet. I guess I put this here because we've been discussing this in the calls, but the actual code doesn't use this. I'll remove this line. >> + If there are no ports on a node, dummy ports (ports with no actual values) are stored. >> + If there is only one link available, the ports of this link are stored >> + as both ingress and egress ports. >> + >> + The dummy ports shouldn't be used. It's up to :class:`~framework.runner.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 underlying 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[Port]): >> + """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 = [] >> + for sut_port in sut_ports: >> + for tg_port in tg_ports: >> + if (sut_port.identifier, sut_port.peer) == ( >> + tg_port.peer, >> + tg_port.identifier, >> + ): >> + port_links.append(PortLink(sut_port=sut_port, tg_port=tg_port)) >> + >> + self.type = TopologyType(len(port_links)) > >>