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 8B2A84596E; Thu, 12 Sep 2024 14:36:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F1F040265; Thu, 12 Sep 2024 14:36:23 +0200 (CEST) Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.47]) by mails.dpdk.org (Postfix) with ESMTP id 8814C40144 for ; Thu, 12 Sep 2024 14:36:22 +0200 (CEST) Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-27c147db58bso392040fac.1 for ; Thu, 12 Sep 2024 05:36:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1726144582; x=1726749382; 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=vIQgc2/STTB3YYRZae8vdmqLVKSpjas01LTFdP25yTw=; b=IIISJ4BWGDDQbYz+xegWm8uWLeMaZF9BWzJoAVeJrIL6/atETjyAIbNZaF0gePweOe IUreNQ3sNu5t/v49aA7r0oEY+rXpCU5xB8UB0GZBMO7UR4IH+jSXD4jjlqtdfSfZpyxQ whjFOZa0z7UIRydS0jHp8Acr3Fkfj+UvQ/Tc4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726144582; x=1726749382; 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=vIQgc2/STTB3YYRZae8vdmqLVKSpjas01LTFdP25yTw=; b=nqwEgFWClDt0AJyh9TPrrYtCc+OuC5LVE5x4+dQaIPV6jgicP704uZuusQcOVkzbS9 hiJDlvdjHRG1jlQPQhnzzq7Kzp/UftvoSpWXxALHtp3htB9LdSM4TeZJFjbi1XuNVoG6 2hpC8AWj8tR40x9XRxidMcETcaraMF0Oj1e8NbjFXnxt9macDC09qlOGD08RwpsLvTTu riQZiY7VM5H5z3v4K3DB7J//N520KONPWUMIvbcjNI1uQeG1KW9DHIwBhiiecrPrvTwr l+10HuDdtN+LbFSzFL37mznVuFiDsrbMk2pduDUkacvKnvtVX8kwo3e0bDyoKz3pXIyc 89BQ== X-Forwarded-Encrypted: i=1; AJvYcCXlOEz4oNG0ZkR9fejXTZSZSQ7JTpRd6sbpR+CKGxVgZdf+NqNvT/LCN4ulTuB16cL2FQ4=@dpdk.org X-Gm-Message-State: AOJu0YxFu/BA/2liuVbNNBFjE0Tphi/MUiVN4JkTUfQGrkbDp3109nly HNH0wIV9it9O5t8ri8AihhhrJ1PNdyS6ru8VdxWxyrYapDmGEwJ/bZFHv1yq8/j4Ojt6N+apZjE gHt0LUZwjj6vhQjFW/36P84NBQMTVZ+Nz1TUNdg== X-Google-Smtp-Source: AGHT+IHVNKj3OPlcZDNnrDpLNNnBGoZarv7SPGuawIAAVcTZBNtvL1pMKpXIAByMKX3E8FVMUd5YUSwNUiUePcm/mys= X-Received: by 2002:a05:6870:420c:b0:270:6dfc:b145 with SMTP id 586e51a60fabf-27c3f26c387mr1484795fac.16.1726144581784; Thu, 12 Sep 2024 05:36:21 -0700 (PDT) MIME-Version: 1.0 References: <20240904152827.11914-1-jspewock@iol.unh.edu> <20240904152827.11914-2-jspewock@iol.unh.edu> In-Reply-To: <20240904152827.11914-2-jspewock@iol.unh.edu> From: Patrick Robb Date: Thu, 12 Sep 2024 08:35:29 -0400 Message-ID: Subject: Re: [PATCH v1 1/1] dts: add send_packets to test suites and rework packet addressing To: jspewock@iol.unh.edu Cc: wathsala.vithanage@arm.com, paul.szczepanek@arm.com, thomas@monjalon.net, yoan.picchi@foss.arm.com, Luca.Vizzarro@arm.com, npratte@iol.unh.edu, Honnappa.Nagarahalli@arm.com, alex.chapman@arm.com, juraj.linkes@pantheon.tech, 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 This looks good, except for the fact that a method for sending a list of packets has been added since you submitted this patch (which does return the packet list, not that it matters for your application). So, this will need to be resubmitted with your patch reformatted for _adjust_addresses() to be used by luca's send_packet_and_capture -> send_packets_and_capture approach which is now in the framework. On Wed, Sep 4, 2024 at 11:28=E2=80=AFAM wrote: > > From: Jeremy Spewock > > Currently the only method provided in the test suite class for sending > packets sends a single packet and then captures the results. There is, > in some cases, a need to send multiple packets at once while not really > needing to capture any traffic received back. The method to do this > exists in the traffic generator already, but this patch exposes the > method to test suites. > > This patch also updates the _adjust_addresses method of test suites so > that addresses of packets are only modified if the developer did not > configure them beforehand. This allows for developers to have more > control over the content of their packets when sending them through the > framework. > > Signed-off-by: Jeremy Spewock > --- > dts/framework/test_suite.py | 87 +++++++++++++++++++------- > dts/framework/testbed_model/tg_node.py | 9 +++ > 2 files changed, 75 insertions(+), 21 deletions(-) > > diff --git a/dts/framework/test_suite.py b/dts/framework/test_suite.py > index 694b2eba65..11aaa0a93a 100644 > --- a/dts/framework/test_suite.py > +++ b/dts/framework/test_suite.py > @@ -199,7 +199,7 @@ def send_packet_and_capture( > Returns: > A list of received packets. > """ > - packet =3D self._adjust_addresses(packet) > + packet =3D self._adjust_addresses([packet])[0] > return self.tg_node.send_packet_and_capture( > packet, > self._tg_port_egress, > @@ -208,6 +208,18 @@ def send_packet_and_capture( > duration, > ) > > + def send_packets( > + self, > + packets: list[Packet], > + ) -> None: > + """Send packets using the traffic generator and do not capture r= eceived traffic. > + > + Args: > + packets: Packets to send. > + """ > + packets =3D self._adjust_addresses(packets) > + self.tg_node.send_packets(packets, self._tg_port_egress) > + > def get_expected_packet(self, packet: Packet) -> Packet: > """Inject the proper L2/L3 addresses into `packet`. > > @@ -217,41 +229,74 @@ def get_expected_packet(self, packet: Packet) -> Pa= cket: > Returns: > `packet` with injected L2/L3 addresses. > """ > - return self._adjust_addresses(packet, expected=3DTrue) > + return self._adjust_addresses([packet], expected=3DTrue)[0] > > - def _adjust_addresses(self, packet: Packet, expected: bool =3D False= ) -> Packet: > + def _adjust_addresses(self, packets: list[Packet], expected: bool = =3D False) -> list[Packet]: > """L2 and L3 address additions in both directions. ^Just confirming again I think this implementation is fine, the patch just needs to be reformatted to work on top of the new testsuite/tgnode pktgen methods. Cheers.